var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b ||= {})
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
// node_modules/.pnpm/@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs@7.8.2/node_modules/@angular/core/fesm2022/not_found.mjs
var _currentInjector = void 0;
function getCurrentInjector() {
return _currentInjector;
}
function setCurrentInjector(injector) {
const former = _currentInjector;
_currentInjector = injector;
return former;
}
var NOT_FOUND = Symbol("NotFound");
function isNotFound(e) {
return e === NOT_FOUND || e?.name === "\u0275NotFound";
}
// node_modules/.pnpm/@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs@7.8.2/node_modules/@angular/core/fesm2022/signal.mjs
function defaultEquals(a, b) {
return Object.is(a, b);
}
var activeConsumer = null;
var inNotificationPhase = false;
var epoch = 1;
var postProducerCreatedFn = null;
var SIGNAL = /* @__PURE__ */ Symbol("SIGNAL");
function setActiveConsumer(consumer) {
const prev = activeConsumer;
activeConsumer = consumer;
return prev;
}
function getActiveConsumer() {
return activeConsumer;
}
function isInNotificationPhase() {
return inNotificationPhase;
}
var REACTIVE_NODE = {
version: 0,
lastCleanEpoch: 0,
dirty: false,
producers: void 0,
producersTail: void 0,
consumers: void 0,
consumersTail: void 0,
recomputing: false,
consumerAllowSignalWrites: false,
consumerIsAlwaysLive: false,
kind: "unknown",
producerMustRecompute: () => false,
producerRecomputeValue: () => {
},
consumerMarkedDirty: () => {
},
consumerOnSignalRead: () => {
}
};
function producerAccessed(node) {
if (inNotificationPhase) {
throw new Error(typeof ngDevMode !== "undefined" && ngDevMode ? `Assertion error: signal read during notification phase` : "");
}
if (activeConsumer === null) {
return;
}
activeConsumer.consumerOnSignalRead(node);
const prevProducerLink = activeConsumer.producersTail;
if (prevProducerLink !== void 0 && prevProducerLink.producer === node) {
return;
}
let nextProducerLink = void 0;
const isRecomputing = activeConsumer.recomputing;
if (isRecomputing) {
nextProducerLink = prevProducerLink !== void 0 ? prevProducerLink.nextProducer : activeConsumer.producers;
if (nextProducerLink !== void 0 && nextProducerLink.producer === node) {
activeConsumer.producersTail = nextProducerLink;
nextProducerLink.lastReadVersion = node.version;
return;
}
}
const prevConsumerLink = node.consumersTail;
if (prevConsumerLink !== void 0 && prevConsumerLink.consumer === activeConsumer && // However, we have to make sure that the link we've discovered isn't from a node that is incrementally rebuilding its producer list
(!isRecomputing || isValidLink(prevConsumerLink, activeConsumer))) {
return;
}
const isLive = consumerIsLive(activeConsumer);
const newLink = {
producer: node,
consumer: activeConsumer,
// instead of eagerly destroying the previous link, we delay until we've finished recomputing
// the producers list, so that we can destroy all of the old links at once.
nextProducer: nextProducerLink,
prevConsumer: prevConsumerLink,
lastReadVersion: node.version,
nextConsumer: void 0
};
activeConsumer.producersTail = newLink;
if (prevProducerLink !== void 0) {
prevProducerLink.nextProducer = newLink;
} else {
activeConsumer.producers = newLink;
}
if (isLive) {
producerAddLiveConsumer(node, newLink);
}
}
function producerIncrementEpoch() {
epoch++;
}
function producerUpdateValueVersion(node) {
if (consumerIsLive(node) && !node.dirty) {
return;
}
if (!node.dirty && node.lastCleanEpoch === epoch) {
return;
}
if (!node.producerMustRecompute(node) && !consumerPollProducersForChange(node)) {
producerMarkClean(node);
return;
}
node.producerRecomputeValue(node);
producerMarkClean(node);
}
function producerNotifyConsumers(node) {
if (node.consumers === void 0) {
return;
}
const prev = inNotificationPhase;
inNotificationPhase = true;
try {
for (let link = node.consumers; link !== void 0; link = link.nextConsumer) {
const consumer = link.consumer;
if (!consumer.dirty) {
consumerMarkDirty(consumer);
}
}
} finally {
inNotificationPhase = prev;
}
}
function producerUpdatesAllowed() {
return activeConsumer?.consumerAllowSignalWrites !== false;
}
function consumerMarkDirty(node) {
node.dirty = true;
producerNotifyConsumers(node);
node.consumerMarkedDirty?.(node);
}
function producerMarkClean(node) {
node.dirty = false;
node.lastCleanEpoch = epoch;
}
function consumerBeforeComputation(node) {
if (node) {
node.producersTail = void 0;
node.recomputing = true;
}
return setActiveConsumer(node);
}
function consumerAfterComputation(node, prevConsumer) {
setActiveConsumer(prevConsumer);
if (!node) {
return;
}
node.recomputing = false;
const producersTail = node.producersTail;
let toRemove = producersTail !== void 0 ? producersTail.nextProducer : node.producers;
if (toRemove !== void 0) {
if (consumerIsLive(node)) {
do {
toRemove = producerRemoveLiveConsumerLink(toRemove);
} while (toRemove !== void 0);
}
if (producersTail !== void 0) {
producersTail.nextProducer = void 0;
} else {
node.producers = void 0;
}
}
}
function consumerPollProducersForChange(node) {
for (let link = node.producers; link !== void 0; link = link.nextProducer) {
const producer = link.producer;
const seenVersion = link.lastReadVersion;
if (seenVersion !== producer.version) {
return true;
}
producerUpdateValueVersion(producer);
if (seenVersion !== producer.version) {
return true;
}
}
return false;
}
function consumerDestroy(node) {
if (consumerIsLive(node)) {
let link = node.producers;
while (link !== void 0) {
link = producerRemoveLiveConsumerLink(link);
}
}
node.producers = void 0;
node.producersTail = void 0;
node.consumers = void 0;
node.consumersTail = void 0;
}
function producerAddLiveConsumer(node, link) {
const consumersTail = node.consumersTail;
const wasLive = consumerIsLive(node);
if (consumersTail !== void 0) {
link.nextConsumer = consumersTail.nextConsumer;
consumersTail.nextConsumer = link;
} else {
link.nextConsumer = void 0;
node.consumers = link;
}
link.prevConsumer = consumersTail;
node.consumersTail = link;
if (!wasLive) {
for (let link2 = node.producers; link2 !== void 0; link2 = link2.nextProducer) {
producerAddLiveConsumer(link2.producer, link2);
}
}
}
function producerRemoveLiveConsumerLink(link) {
const producer = link.producer;
const nextProducer = link.nextProducer;
const nextConsumer = link.nextConsumer;
const prevConsumer = link.prevConsumer;
link.nextConsumer = void 0;
link.prevConsumer = void 0;
if (nextConsumer !== void 0) {
nextConsumer.prevConsumer = prevConsumer;
} else {
producer.consumersTail = prevConsumer;
}
if (prevConsumer !== void 0) {
prevConsumer.nextConsumer = nextConsumer;
} else {
producer.consumers = nextConsumer;
if (!consumerIsLive(producer)) {
let producerLink = producer.producers;
while (producerLink !== void 0) {
producerLink = producerRemoveLiveConsumerLink(producerLink);
}
}
}
return nextProducer;
}
function consumerIsLive(node) {
return node.consumerIsAlwaysLive || node.consumers !== void 0;
}
function runPostProducerCreatedFn(node) {
postProducerCreatedFn?.(node);
}
function isValidLink(checkLink, consumer) {
const producersTail = consumer.producersTail;
if (producersTail !== void 0) {
let link = consumer.producers;
do {
if (link === checkLink) {
return true;
}
if (link === producersTail) {
break;
}
link = link.nextProducer;
} while (link !== void 0);
}
return false;
}
function createComputed(computation, equal) {
const node = Object.create(COMPUTED_NODE);
node.computation = computation;
if (equal !== void 0) {
node.equal = equal;
}
const computed2 = () => {
producerUpdateValueVersion(node);
producerAccessed(node);
if (node.value === ERRORED) {
throw node.error;
}
return node.value;
};
computed2[SIGNAL] = node;
if (typeof ngDevMode !== "undefined" && ngDevMode) {
const debugName = node.debugName ? " (" + node.debugName + ")" : "";
computed2.toString = () => `[Computed${debugName}: ${node.value}]`;
}
runPostProducerCreatedFn(node);
return computed2;
}
var UNSET = /* @__PURE__ */ Symbol("UNSET");
var COMPUTING = /* @__PURE__ */ Symbol("COMPUTING");
var ERRORED = /* @__PURE__ */ Symbol("ERRORED");
var COMPUTED_NODE = /* @__PURE__ */ (() => {
return __spreadProps(__spreadValues({}, REACTIVE_NODE), {
value: UNSET,
dirty: true,
error: null,
equal: defaultEquals,
kind: "computed",
producerMustRecompute(node) {
return node.value === UNSET || node.value === COMPUTING;
},
producerRecomputeValue(node) {
if (node.value === COMPUTING) {
throw new Error(typeof ngDevMode !== "undefined" && ngDevMode ? "Detected cycle in computations." : "");
}
const oldValue = node.value;
node.value = COMPUTING;
const prevConsumer = consumerBeforeComputation(node);
let newValue;
let wasEqual = false;
try {
newValue = node.computation();
setActiveConsumer(null);
wasEqual = oldValue !== UNSET && oldValue !== ERRORED && newValue !== ERRORED && node.equal(oldValue, newValue);
} catch (err) {
newValue = ERRORED;
node.error = err;
} finally {
consumerAfterComputation(node, prevConsumer);
}
if (wasEqual) {
node.value = oldValue;
return;
}
node.value = newValue;
node.version++;
}
});
})();
function defaultThrowError() {
throw new Error();
}
var throwInvalidWriteToSignalErrorFn = defaultThrowError;
function throwInvalidWriteToSignalError(node) {
throwInvalidWriteToSignalErrorFn(node);
}
function setThrowInvalidWriteToSignalError(fn) {
throwInvalidWriteToSignalErrorFn = fn;
}
var postSignalSetFn = null;
function createSignal(initialValue, equal) {
const node = Object.create(SIGNAL_NODE);
node.value = initialValue;
if (equal !== void 0) {
node.equal = equal;
}
const getter = (() => signalGetFn(node));
getter[SIGNAL] = node;
if (typeof ngDevMode !== "undefined" && ngDevMode) {
const debugName = node.debugName ? " (" + node.debugName + ")" : "";
getter.toString = () => `[Signal${debugName}: ${node.value}]`;
}
runPostProducerCreatedFn(node);
const set = (newValue) => signalSetFn(node, newValue);
const update = (updateFn) => signalUpdateFn(node, updateFn);
return [getter, set, update];
}
function signalGetFn(node) {
producerAccessed(node);
return node.value;
}
function signalSetFn(node, newValue) {
if (!producerUpdatesAllowed()) {
throwInvalidWriteToSignalError(node);
}
if (!node.equal(node.value, newValue)) {
node.value = newValue;
signalValueChanged(node);
}
}
function signalUpdateFn(node, updater) {
if (!producerUpdatesAllowed()) {
throwInvalidWriteToSignalError(node);
}
signalSetFn(node, updater(node.value));
}
var SIGNAL_NODE = /* @__PURE__ */ (() => {
return __spreadProps(__spreadValues({}, REACTIVE_NODE), {
equal: defaultEquals,
value: void 0,
kind: "signal"
});
})();
function signalValueChanged(node) {
node.version++;
producerIncrementEpoch();
producerNotifyConsumers(node);
postSignalSetFn?.(node);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/isFunction.js
function isFunction(value) {
return typeof value === "function";
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/createErrorClass.js
function createErrorClass(createImpl) {
const _super = (instance) => {
Error.call(instance);
instance.stack = new Error().stack;
};
const ctorFunc = createImpl(_super);
ctorFunc.prototype = Object.create(Error.prototype);
ctorFunc.prototype.constructor = ctorFunc;
return ctorFunc;
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/UnsubscriptionError.js
var UnsubscriptionError = createErrorClass((_super) => function UnsubscriptionErrorImpl(errors) {
_super(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;
});
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/arrRemove.js
function arrRemove(arr, item) {
if (arr) {
const index = arr.indexOf(item);
0 <= index && arr.splice(index, 1);
}
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/Subscription.js
var Subscription = class _Subscription {
constructor(initialTeardown) {
this.initialTeardown = initialTeardown;
this.closed = false;
this._parentage = null;
this._finalizers = null;
}
unsubscribe() {
let errors;
if (!this.closed) {
this.closed = true;
const { _parentage } = this;
if (_parentage) {
this._parentage = null;
if (Array.isArray(_parentage)) {
for (const parent of _parentage) {
parent.remove(this);
}
} else {
_parentage.remove(this);
}
}
const { initialTeardown: initialFinalizer } = this;
if (isFunction(initialFinalizer)) {
try {
initialFinalizer();
} catch (e) {
errors = e instanceof UnsubscriptionError ? e.errors : [e];
}
}
const { _finalizers } = this;
if (_finalizers) {
this._finalizers = null;
for (const finalizer of _finalizers) {
try {
execFinalizer(finalizer);
} catch (err) {
errors = errors !== null && errors !== void 0 ? errors : [];
if (err instanceof UnsubscriptionError) {
errors = [...errors, ...err.errors];
} else {
errors.push(err);
}
}
}
}
if (errors) {
throw new UnsubscriptionError(errors);
}
}
}
add(teardown) {
var _a;
if (teardown && teardown !== this) {
if (this.closed) {
execFinalizer(teardown);
} else {
if (teardown instanceof _Subscription) {
if (teardown.closed || teardown._hasParent(this)) {
return;
}
teardown._addParent(this);
}
(this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
}
}
}
_hasParent(parent) {
const { _parentage } = this;
return _parentage === parent || Array.isArray(_parentage) && _parentage.includes(parent);
}
_addParent(parent) {
const { _parentage } = this;
this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
}
_removeParent(parent) {
const { _parentage } = this;
if (_parentage === parent) {
this._parentage = null;
} else if (Array.isArray(_parentage)) {
arrRemove(_parentage, parent);
}
}
remove(teardown) {
const { _finalizers } = this;
_finalizers && arrRemove(_finalizers, teardown);
if (teardown instanceof _Subscription) {
teardown._removeParent(this);
}
}
};
Subscription.EMPTY = (() => {
const empty = new Subscription();
empty.closed = true;
return empty;
})();
var EMPTY_SUBSCRIPTION = Subscription.EMPTY;
function isSubscription(value) {
return value instanceof Subscription || value && "closed" in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe);
}
function execFinalizer(finalizer) {
if (isFunction(finalizer)) {
finalizer();
} else {
finalizer.unsubscribe();
}
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/config.js
var config = {
onUnhandledError: null,
onStoppedNotification: null,
Promise: void 0,
useDeprecatedSynchronousErrorHandling: false,
useDeprecatedNextContext: false
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/timeoutProvider.js
var timeoutProvider = {
setTimeout(handler, timeout, ...args) {
const { delegate } = timeoutProvider;
if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
return delegate.setTimeout(handler, timeout, ...args);
}
return setTimeout(handler, timeout, ...args);
},
clearTimeout(handle) {
const { delegate } = timeoutProvider;
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
},
delegate: void 0
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/reportUnhandledError.js
function reportUnhandledError(err) {
timeoutProvider.setTimeout(() => {
const { onUnhandledError } = config;
if (onUnhandledError) {
onUnhandledError(err);
} else {
throw err;
}
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/noop.js
function noop() {
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/NotificationFactories.js
var COMPLETE_NOTIFICATION = (() => createNotification("C", void 0, void 0))();
function errorNotification(error) {
return createNotification("E", void 0, error);
}
function nextNotification(value) {
return createNotification("N", value, void 0);
}
function createNotification(kind, value, error) {
return {
kind,
value,
error
};
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/errorContext.js
var context = null;
function errorContext(cb) {
if (config.useDeprecatedSynchronousErrorHandling) {
const isRoot = !context;
if (isRoot) {
context = { errorThrown: false, error: null };
}
cb();
if (isRoot) {
const { errorThrown, error } = context;
context = null;
if (errorThrown) {
throw error;
}
}
} else {
cb();
}
}
function captureError(err) {
if (config.useDeprecatedSynchronousErrorHandling && context) {
context.errorThrown = true;
context.error = err;
}
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/Subscriber.js
var Subscriber = class extends Subscription {
constructor(destination) {
super();
this.isStopped = false;
if (destination) {
this.destination = destination;
if (isSubscription(destination)) {
destination.add(this);
}
} else {
this.destination = EMPTY_OBSERVER;
}
}
static create(next, error, complete) {
return new SafeSubscriber(next, error, complete);
}
next(value) {
if (this.isStopped) {
handleStoppedNotification(nextNotification(value), this);
} else {
this._next(value);
}
}
error(err) {
if (this.isStopped) {
handleStoppedNotification(errorNotification(err), this);
} else {
this.isStopped = true;
this._error(err);
}
}
complete() {
if (this.isStopped) {
handleStoppedNotification(COMPLETE_NOTIFICATION, this);
} else {
this.isStopped = true;
this._complete();
}
}
unsubscribe() {
if (!this.closed) {
this.isStopped = true;
super.unsubscribe();
this.destination = null;
}
}
_next(value) {
this.destination.next(value);
}
_error(err) {
try {
this.destination.error(err);
} finally {
this.unsubscribe();
}
}
_complete() {
try {
this.destination.complete();
} finally {
this.unsubscribe();
}
}
};
var _bind = Function.prototype.bind;
function bind(fn, thisArg) {
return _bind.call(fn, thisArg);
}
var ConsumerObserver = class {
constructor(partialObserver) {
this.partialObserver = partialObserver;
}
next(value) {
const { partialObserver } = this;
if (partialObserver.next) {
try {
partialObserver.next(value);
} catch (error) {
handleUnhandledError(error);
}
}
}
error(err) {
const { partialObserver } = this;
if (partialObserver.error) {
try {
partialObserver.error(err);
} catch (error) {
handleUnhandledError(error);
}
} else {
handleUnhandledError(err);
}
}
complete() {
const { partialObserver } = this;
if (partialObserver.complete) {
try {
partialObserver.complete();
} catch (error) {
handleUnhandledError(error);
}
}
}
};
var SafeSubscriber = class extends Subscriber {
constructor(observerOrNext, error, complete) {
super();
let partialObserver;
if (isFunction(observerOrNext) || !observerOrNext) {
partialObserver = {
next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : void 0,
error: error !== null && error !== void 0 ? error : void 0,
complete: complete !== null && complete !== void 0 ? complete : void 0
};
} else {
let context2;
if (this && config.useDeprecatedNextContext) {
context2 = Object.create(observerOrNext);
context2.unsubscribe = () => this.unsubscribe();
partialObserver = {
next: observerOrNext.next && bind(observerOrNext.next, context2),
error: observerOrNext.error && bind(observerOrNext.error, context2),
complete: observerOrNext.complete && bind(observerOrNext.complete, context2)
};
} else {
partialObserver = observerOrNext;
}
}
this.destination = new ConsumerObserver(partialObserver);
}
};
function handleUnhandledError(error) {
if (config.useDeprecatedSynchronousErrorHandling) {
captureError(error);
} else {
reportUnhandledError(error);
}
}
function defaultErrorHandler(err) {
throw err;
}
function handleStoppedNotification(notification, subscriber) {
const { onStoppedNotification } = config;
onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));
}
var EMPTY_OBSERVER = {
closed: true,
next: noop,
error: defaultErrorHandler,
complete: noop
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/symbol/observable.js
var observable = (() => typeof Symbol === "function" && Symbol.observable || "@@observable")();
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/identity.js
function identity(x) {
return x;
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/pipe.js
function pipeFromArray(fns) {
if (fns.length === 0) {
return identity;
}
if (fns.length === 1) {
return fns[0];
}
return function piped(input2) {
return fns.reduce((prev, fn) => fn(prev), input2);
};
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/Observable.js
var Observable = class _Observable {
constructor(subscribe) {
if (subscribe) {
this._subscribe = subscribe;
}
}
lift(operator) {
const observable2 = new _Observable();
observable2.source = this;
observable2.operator = operator;
return observable2;
}
subscribe(observerOrNext, error, complete) {
const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
errorContext(() => {
const { operator, source } = this;
subscriber.add(operator ? operator.call(subscriber, source) : source ? this._subscribe(subscriber) : this._trySubscribe(subscriber));
});
return subscriber;
}
_trySubscribe(sink) {
try {
return this._subscribe(sink);
} catch (err) {
sink.error(err);
}
}
forEach(next, promiseCtor) {
promiseCtor = getPromiseCtor(promiseCtor);
return new promiseCtor((resolve, reject) => {
const subscriber = new SafeSubscriber({
next: (value) => {
try {
next(value);
} catch (err) {
reject(err);
subscriber.unsubscribe();
}
},
error: reject,
complete: resolve
});
this.subscribe(subscriber);
});
}
_subscribe(subscriber) {
var _a;
return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
}
[observable]() {
return this;
}
pipe(...operations) {
return 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) {
var _a;
return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
}
function isObserver(value) {
return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
}
function isSubscriber(value) {
return value && value instanceof Subscriber || isObserver(value) && isSubscription(value);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/lift.js
function hasLift(source) {
return isFunction(source === null || source === void 0 ? void 0 : source.lift);
}
function operate(init) {
return (source) => {
if (hasLift(source)) {
return source.lift(function(liftedSource) {
try {
return init(liftedSource, this);
} catch (err) {
this.error(err);
}
});
}
throw new TypeError("Unable to lift unknown Observable type");
};
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/OperatorSubscriber.js
function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
}
var OperatorSubscriber = class extends Subscriber {
constructor(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
super(destination);
this.onFinalize = onFinalize;
this.shouldUnsubscribe = shouldUnsubscribe;
this._next = onNext ? function(value) {
try {
onNext(value);
} catch (err) {
destination.error(err);
}
} : super._next;
this._error = onError ? function(err) {
try {
onError(err);
} catch (err2) {
destination.error(err2);
} finally {
this.unsubscribe();
}
} : super._error;
this._complete = onComplete ? function() {
try {
onComplete();
} catch (err) {
destination.error(err);
} finally {
this.unsubscribe();
}
} : super._complete;
}
unsubscribe() {
var _a;
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
const { closed } = this;
super.unsubscribe();
!closed && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
}
}
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/refCount.js
function refCount() {
return operate((source, subscriber) => {
let connection = null;
source._refCount++;
const refCounter = createOperatorSubscriber(subscriber, void 0, void 0, void 0, () => {
if (!source || source._refCount <= 0 || 0 < --source._refCount) {
connection = null;
return;
}
const sharedConnection = source._connection;
const conn = connection;
connection = null;
if (sharedConnection && (!conn || sharedConnection === conn)) {
sharedConnection.unsubscribe();
}
subscriber.unsubscribe();
});
source.subscribe(refCounter);
if (!refCounter.closed) {
connection = source.connect();
}
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/observable/ConnectableObservable.js
var ConnectableObservable = class extends Observable {
constructor(source, subjectFactory) {
super();
this.source = source;
this.subjectFactory = subjectFactory;
this._subject = null;
this._refCount = 0;
this._connection = null;
if (hasLift(source)) {
this.lift = source.lift;
}
}
_subscribe(subscriber) {
return this.getSubject().subscribe(subscriber);
}
getSubject() {
const subject = this._subject;
if (!subject || subject.isStopped) {
this._subject = this.subjectFactory();
}
return this._subject;
}
_teardown() {
this._refCount = 0;
const { _connection } = this;
this._subject = this._connection = null;
_connection === null || _connection === void 0 ? void 0 : _connection.unsubscribe();
}
connect() {
let connection = this._connection;
if (!connection) {
connection = this._connection = new Subscription();
const subject = this.getSubject();
connection.add(this.source.subscribe(createOperatorSubscriber(subject, void 0, () => {
this._teardown();
subject.complete();
}, (err) => {
this._teardown();
subject.error(err);
}, () => this._teardown())));
if (connection.closed) {
this._connection = null;
connection = Subscription.EMPTY;
}
}
return connection;
}
refCount() {
return refCount()(this);
}
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/animationFrameProvider.js
var animationFrameProvider = {
schedule(callback) {
let request = requestAnimationFrame;
let cancel = cancelAnimationFrame;
const { delegate } = animationFrameProvider;
if (delegate) {
request = delegate.requestAnimationFrame;
cancel = delegate.cancelAnimationFrame;
}
const handle = request((timestamp) => {
cancel = void 0;
callback(timestamp);
});
return new Subscription(() => cancel === null || cancel === void 0 ? void 0 : cancel(handle));
},
requestAnimationFrame(...args) {
const { delegate } = animationFrameProvider;
return ((delegate === null || delegate === void 0 ? void 0 : delegate.requestAnimationFrame) || requestAnimationFrame)(...args);
},
cancelAnimationFrame(...args) {
const { delegate } = animationFrameProvider;
return ((delegate === null || delegate === void 0 ? void 0 : delegate.cancelAnimationFrame) || cancelAnimationFrame)(...args);
},
delegate: void 0
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/ObjectUnsubscribedError.js
var ObjectUnsubscribedError = createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
_super(this);
this.name = "ObjectUnsubscribedError";
this.message = "object unsubscribed";
});
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/Subject.js
var Subject = class extends Observable {
constructor() {
super();
this.closed = false;
this.currentObservers = null;
this.observers = [];
this.isStopped = false;
this.hasError = false;
this.thrownError = null;
}
lift(operator) {
const subject = new AnonymousSubject(this, this);
subject.operator = operator;
return subject;
}
_throwIfClosed() {
if (this.closed) {
throw new ObjectUnsubscribedError();
}
}
next(value) {
errorContext(() => {
this._throwIfClosed();
if (!this.isStopped) {
if (!this.currentObservers) {
this.currentObservers = Array.from(this.observers);
}
for (const observer of this.currentObservers) {
observer.next(value);
}
}
});
}
error(err) {
errorContext(() => {
this._throwIfClosed();
if (!this.isStopped) {
this.hasError = this.isStopped = true;
this.thrownError = err;
const { observers } = this;
while (observers.length) {
observers.shift().error(err);
}
}
});
}
complete() {
errorContext(() => {
this._throwIfClosed();
if (!this.isStopped) {
this.isStopped = true;
const { observers } = this;
while (observers.length) {
observers.shift().complete();
}
}
});
}
unsubscribe() {
this.isStopped = this.closed = true;
this.observers = this.currentObservers = null;
}
get observed() {
var _a;
return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
}
_trySubscribe(subscriber) {
this._throwIfClosed();
return super._trySubscribe(subscriber);
}
_subscribe(subscriber) {
this._throwIfClosed();
this._checkFinalizedStatuses(subscriber);
return this._innerSubscribe(subscriber);
}
_innerSubscribe(subscriber) {
const { hasError, isStopped, observers } = this;
if (hasError || isStopped) {
return EMPTY_SUBSCRIPTION;
}
this.currentObservers = null;
observers.push(subscriber);
return new Subscription(() => {
this.currentObservers = null;
arrRemove(observers, subscriber);
});
}
_checkFinalizedStatuses(subscriber) {
const { hasError, thrownError, isStopped } = this;
if (hasError) {
subscriber.error(thrownError);
} else if (isStopped) {
subscriber.complete();
}
}
asObservable() {
const observable2 = new Observable();
observable2.source = this;
return observable2;
}
};
Subject.create = (destination, source) => {
return new AnonymousSubject(destination, source);
};
var AnonymousSubject = class extends Subject {
constructor(destination, source) {
super();
this.destination = destination;
this.source = source;
}
next(value) {
var _a, _b;
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);
}
error(err) {
var _a, _b;
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);
}
complete() {
var _a, _b;
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);
}
_subscribe(subscriber) {
var _a, _b;
return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;
}
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/BehaviorSubject.js
var BehaviorSubject = class extends Subject {
constructor(_value) {
super();
this._value = _value;
}
get value() {
return this.getValue();
}
_subscribe(subscriber) {
const subscription = super._subscribe(subscriber);
!subscription.closed && subscriber.next(this._value);
return subscription;
}
getValue() {
const { hasError, thrownError, _value } = this;
if (hasError) {
throw thrownError;
}
this._throwIfClosed();
return _value;
}
next(value) {
super.next(this._value = value);
}
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/dateTimestampProvider.js
var dateTimestampProvider = {
now() {
return (dateTimestampProvider.delegate || Date).now();
},
delegate: void 0
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/ReplaySubject.js
var ReplaySubject = class extends Subject {
constructor(_bufferSize = Infinity, _windowTime = Infinity, _timestampProvider = dateTimestampProvider) {
super();
this._bufferSize = _bufferSize;
this._windowTime = _windowTime;
this._timestampProvider = _timestampProvider;
this._buffer = [];
this._infiniteTimeWindow = true;
this._infiniteTimeWindow = _windowTime === Infinity;
this._bufferSize = Math.max(1, _bufferSize);
this._windowTime = Math.max(1, _windowTime);
}
next(value) {
const { isStopped, _buffer, _infiniteTimeWindow, _timestampProvider, _windowTime } = this;
if (!isStopped) {
_buffer.push(value);
!_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);
}
this._trimBuffer();
super.next(value);
}
_subscribe(subscriber) {
this._throwIfClosed();
this._trimBuffer();
const subscription = this._innerSubscribe(subscriber);
const { _infiniteTimeWindow, _buffer } = this;
const copy = _buffer.slice();
for (let i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) {
subscriber.next(copy[i]);
}
this._checkFinalizedStatuses(subscriber);
return subscription;
}
_trimBuffer() {
const { _bufferSize, _timestampProvider, _buffer, _infiniteTimeWindow } = this;
const adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;
_bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);
if (!_infiniteTimeWindow) {
const now = _timestampProvider.now();
let last2 = 0;
for (let i = 1; i < _buffer.length && _buffer[i] <= now; i += 2) {
last2 = i;
}
last2 && _buffer.splice(0, last2 + 1);
}
}
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/Action.js
var Action = class extends Subscription {
constructor(scheduler, work) {
super();
}
schedule(state, delay = 0) {
return this;
}
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/intervalProvider.js
var intervalProvider = {
setInterval(handler, timeout, ...args) {
const { delegate } = intervalProvider;
if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {
return delegate.setInterval(handler, timeout, ...args);
}
return setInterval(handler, timeout, ...args);
},
clearInterval(handle) {
const { delegate } = intervalProvider;
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);
},
delegate: void 0
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/AsyncAction.js
var AsyncAction = class extends Action {
constructor(scheduler, work) {
super(scheduler, work);
this.scheduler = scheduler;
this.work = work;
this.pending = false;
}
schedule(state, delay = 0) {
var _a;
if (this.closed) {
return this;
}
this.state = state;
const id = this.id;
const scheduler = this.scheduler;
if (id != null) {
this.id = this.recycleAsyncId(scheduler, id, delay);
}
this.pending = true;
this.delay = delay;
this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);
return this;
}
requestAsyncId(scheduler, _id, delay = 0) {
return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);
}
recycleAsyncId(_scheduler, id, delay = 0) {
if (delay != null && this.delay === delay && this.pending === false) {
return id;
}
if (id != null) {
intervalProvider.clearInterval(id);
}
return void 0;
}
execute(state, delay) {
if (this.closed) {
return new Error("executing a cancelled action");
}
this.pending = false;
const error = this._execute(state, delay);
if (error) {
return error;
} else if (this.pending === false && this.id != null) {
this.id = this.recycleAsyncId(this.scheduler, this.id, null);
}
}
_execute(state, _delay) {
let errored = false;
let errorValue;
try {
this.work(state);
} catch (e) {
errored = true;
errorValue = e ? e : new Error("Scheduled action threw falsy error");
}
if (errored) {
this.unsubscribe();
return errorValue;
}
}
unsubscribe() {
if (!this.closed) {
const { id, scheduler } = this;
const { actions } = scheduler;
this.work = this.state = this.scheduler = null;
this.pending = false;
arrRemove(actions, this);
if (id != null) {
this.id = this.recycleAsyncId(scheduler, id, null);
}
this.delay = null;
super.unsubscribe();
}
}
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/Immediate.js
var nextHandle = 1;
var resolved;
var activeHandles = {};
function findAndClearHandle(handle) {
if (handle in activeHandles) {
delete activeHandles[handle];
return true;
}
return false;
}
var Immediate = {
setImmediate(cb) {
const handle = nextHandle++;
activeHandles[handle] = true;
if (!resolved) {
resolved = Promise.resolve();
}
resolved.then(() => findAndClearHandle(handle) && cb());
return handle;
},
clearImmediate(handle) {
findAndClearHandle(handle);
}
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/immediateProvider.js
var { setImmediate, clearImmediate } = Immediate;
var immediateProvider = {
setImmediate(...args) {
const { delegate } = immediateProvider;
return ((delegate === null || delegate === void 0 ? void 0 : delegate.setImmediate) || setImmediate)(...args);
},
clearImmediate(handle) {
const { delegate } = immediateProvider;
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearImmediate) || clearImmediate)(handle);
},
delegate: void 0
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/AsapAction.js
var AsapAction = class extends AsyncAction {
constructor(scheduler, work) {
super(scheduler, work);
this.scheduler = scheduler;
this.work = work;
}
requestAsyncId(scheduler, id, delay = 0) {
if (delay !== null && delay > 0) {
return super.requestAsyncId(scheduler, id, delay);
}
scheduler.actions.push(this);
return scheduler._scheduled || (scheduler._scheduled = immediateProvider.setImmediate(scheduler.flush.bind(scheduler, void 0)));
}
recycleAsyncId(scheduler, id, delay = 0) {
var _a;
if (delay != null ? delay > 0 : this.delay > 0) {
return super.recycleAsyncId(scheduler, id, delay);
}
const { actions } = scheduler;
if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
immediateProvider.clearImmediate(id);
if (scheduler._scheduled === id) {
scheduler._scheduled = void 0;
}
}
return void 0;
}
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/Scheduler.js
var Scheduler = class _Scheduler {
constructor(schedulerActionCtor, now = _Scheduler.now) {
this.schedulerActionCtor = schedulerActionCtor;
this.now = now;
}
schedule(work, delay = 0, state) {
return new this.schedulerActionCtor(this, work).schedule(state, delay);
}
};
Scheduler.now = dateTimestampProvider.now;
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/AsyncScheduler.js
var AsyncScheduler = class extends Scheduler {
constructor(SchedulerAction, now = Scheduler.now) {
super(SchedulerAction, now);
this.actions = [];
this._active = false;
}
flush(action) {
const { actions } = this;
if (this._active) {
actions.push(action);
return;
}
let error;
this._active = true;
do {
if (error = action.execute(action.state, action.delay)) {
break;
}
} while (action = actions.shift());
this._active = false;
if (error) {
while (action = actions.shift()) {
action.unsubscribe();
}
throw error;
}
}
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/AsapScheduler.js
var AsapScheduler = class extends AsyncScheduler {
flush(action) {
this._active = true;
const flushId = this._scheduled;
this._scheduled = void 0;
const { actions } = this;
let error;
action = action || actions.shift();
do {
if (error = action.execute(action.state, action.delay)) {
break;
}
} while ((action = actions[0]) && action.id === flushId && actions.shift());
this._active = false;
if (error) {
while ((action = actions[0]) && action.id === flushId && actions.shift()) {
action.unsubscribe();
}
throw error;
}
}
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/asap.js
var asapScheduler = new AsapScheduler(AsapAction);
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/async.js
var asyncScheduler = new AsyncScheduler(AsyncAction);
var async = asyncScheduler;
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameAction.js
var AnimationFrameAction = class extends AsyncAction {
constructor(scheduler, work) {
super(scheduler, work);
this.scheduler = scheduler;
this.work = work;
}
requestAsyncId(scheduler, id, delay = 0) {
if (delay !== null && delay > 0) {
return super.requestAsyncId(scheduler, id, delay);
}
scheduler.actions.push(this);
return scheduler._scheduled || (scheduler._scheduled = animationFrameProvider.requestAnimationFrame(() => scheduler.flush(void 0)));
}
recycleAsyncId(scheduler, id, delay = 0) {
var _a;
if (delay != null ? delay > 0 : this.delay > 0) {
return super.recycleAsyncId(scheduler, id, delay);
}
const { actions } = scheduler;
if (id != null && id === scheduler._scheduled && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
animationFrameProvider.cancelAnimationFrame(id);
scheduler._scheduled = void 0;
}
return void 0;
}
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameScheduler.js
var AnimationFrameScheduler = class extends AsyncScheduler {
flush(action) {
this._active = true;
let flushId;
if (action) {
flushId = action.id;
} else {
flushId = this._scheduled;
this._scheduled = void 0;
}
const { actions } = this;
let error;
action = action || actions.shift();
do {
if (error = action.execute(action.state, action.delay)) {
break;
}
} while ((action = actions[0]) && action.id === flushId && actions.shift());
this._active = false;
if (error) {
while ((action = actions[0]) && action.id === flushId && actions.shift()) {
action.unsubscribe();
}
throw error;
}
}
};
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduler/animationFrame.js
var animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction);
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/observable/empty.js
var EMPTY = new Observable((subscriber) => subscriber.complete());
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/isScheduler.js
function isScheduler(value) {
return value && isFunction(value.schedule);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/args.js
function last(arr) {
return arr[arr.length - 1];
}
function popResultSelector(args) {
return isFunction(last(args)) ? args.pop() : void 0;
}
function popScheduler(args) {
return isScheduler(last(args)) ? args.pop() : void 0;
}
function popNumber(args, defaultValue) {
return typeof last(args) === "number" ? args.pop() : defaultValue;
}
// node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
function __awaiter(thisArg, _arguments, P2, generator) {
function adopt(value) {
return value instanceof P2 ? value : new P2(function(resolve) {
resolve(value);
});
}
return new (P2 || (P2 = Promise))(function(resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function() {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
return this;
}, i;
function awaitReturn(f) {
return function(v) {
return Promise.resolve(v).then(f, reject);
};
}
function verb(n, f) {
if (g[n]) {
i[n] = function(v) {
return new Promise(function(a, b) {
q.push([n, v, a, b]) > 1 || resume(n, v);
});
};
if (f) i[n] = f(i[n]);
}
}
function resume(n, v) {
try {
step(g[n](v));
} catch (e) {
settle(q[0][3], e);
}
}
function step(r) {
r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
}
function fulfill(value) {
resume("next", value);
}
function reject(value) {
resume("throw", value);
}
function settle(f, v) {
if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
}
}
function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
return this;
}, i);
function verb(n) {
i[n] = o[n] && function(v) {
return new Promise(function(resolve, reject) {
v = o[n](v), settle(resolve, reject, v.done, v.value);
});
};
}
function settle(resolve, reject, d, v) {
Promise.resolve(v).then(function(v2) {
resolve({ value: v2, done: d });
}, reject);
}
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/isArrayLike.js
var isArrayLike = ((x) => x && typeof x.length === "number" && typeof x !== "function");
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/isPromise.js
function isPromise(value) {
return isFunction(value === null || value === void 0 ? void 0 : value.then);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/isInteropObservable.js
function isInteropObservable(input2) {
return isFunction(input2[observable]);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/isAsyncIterable.js
function isAsyncIterable(obj) {
return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/throwUnobservableError.js
function createInvalidObservableTypeError(input2) {
return new TypeError(`You provided ${input2 !== null && typeof input2 === "object" ? "an invalid object" : `'${input2}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/symbol/iterator.js
function getSymbolIterator() {
if (typeof Symbol !== "function" || !Symbol.iterator) {
return "@@iterator";
}
return Symbol.iterator;
}
var iterator = getSymbolIterator();
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/isIterable.js
function isIterable(input2) {
return isFunction(input2 === null || input2 === void 0 ? void 0 : input2[iterator]);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/isReadableStreamLike.js
function readableStreamLikeToAsyncGenerator(readableStream) {
return __asyncGenerator(this, arguments, function* readableStreamLikeToAsyncGenerator_1() {
const reader = readableStream.getReader();
try {
while (true) {
const { value, done } = yield __await(reader.read());
if (done) {
return yield __await(void 0);
}
yield yield __await(value);
}
} finally {
reader.releaseLock();
}
});
}
function isReadableStreamLike(obj) {
return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/observable/innerFrom.js
function innerFrom(input2) {
if (input2 instanceof Observable) {
return input2;
}
if (input2 != null) {
if (isInteropObservable(input2)) {
return fromInteropObservable(input2);
}
if (isArrayLike(input2)) {
return fromArrayLike(input2);
}
if (isPromise(input2)) {
return fromPromise(input2);
}
if (isAsyncIterable(input2)) {
return fromAsyncIterable(input2);
}
if (isIterable(input2)) {
return fromIterable(input2);
}
if (isReadableStreamLike(input2)) {
return fromReadableStreamLike(input2);
}
}
throw createInvalidObservableTypeError(input2);
}
function fromInteropObservable(obj) {
return new Observable((subscriber) => {
const obs = obj[observable]();
if (isFunction(obs.subscribe)) {
return obs.subscribe(subscriber);
}
throw new TypeError("Provided object does not correctly implement Symbol.observable");
});
}
function fromArrayLike(array) {
return new Observable((subscriber) => {
for (let i = 0; i < array.length && !subscriber.closed; i++) {
subscriber.next(array[i]);
}
subscriber.complete();
});
}
function fromPromise(promise) {
return new Observable((subscriber) => {
promise.then((value) => {
if (!subscriber.closed) {
subscriber.next(value);
subscriber.complete();
}
}, (err) => subscriber.error(err)).then(null, reportUnhandledError);
});
}
function fromIterable(iterable) {
return new Observable((subscriber) => {
for (const value of iterable) {
subscriber.next(value);
if (subscriber.closed) {
return;
}
}
subscriber.complete();
});
}
function fromAsyncIterable(asyncIterable) {
return new Observable((subscriber) => {
process(asyncIterable, subscriber).catch((err) => subscriber.error(err));
});
}
function fromReadableStreamLike(readableStream) {
return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));
}
function process(asyncIterable, subscriber) {
var asyncIterable_1, asyncIterable_1_1;
var e_1, _a;
return __awaiter(this, void 0, void 0, function* () {
try {
for (asyncIterable_1 = __asyncValues(asyncIterable); asyncIterable_1_1 = yield asyncIterable_1.next(), !asyncIterable_1_1.done; ) {
const value = asyncIterable_1_1.value;
subscriber.next(value);
if (subscriber.closed) {
return;
}
}
} catch (e_1_1) {
e_1 = { error: e_1_1 };
} finally {
try {
if (asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return)) yield _a.call(asyncIterable_1);
} finally {
if (e_1) throw e_1.error;
}
}
subscriber.complete();
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/executeSchedule.js
function executeSchedule(parentSubscription, scheduler, work, delay = 0, repeat = false) {
const scheduleSubscription = scheduler.schedule(function() {
work();
if (repeat) {
parentSubscription.add(this.schedule(null, delay));
} else {
this.unsubscribe();
}
}, delay);
parentSubscription.add(scheduleSubscription);
if (!repeat) {
return scheduleSubscription;
}
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/observeOn.js
function observeOn(scheduler, delay = 0) {
return operate((source, subscriber) => {
source.subscribe(createOperatorSubscriber(subscriber, (value) => executeSchedule(subscriber, scheduler, () => subscriber.next(value), delay), () => executeSchedule(subscriber, scheduler, () => subscriber.complete(), delay), (err) => executeSchedule(subscriber, scheduler, () => subscriber.error(err), delay)));
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/subscribeOn.js
function subscribeOn(scheduler, delay = 0) {
return operate((source, subscriber) => {
subscriber.add(scheduler.schedule(() => source.subscribe(subscriber), delay));
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduled/scheduleObservable.js
function scheduleObservable(input2, scheduler) {
return innerFrom(input2).pipe(subscribeOn(scheduler), observeOn(scheduler));
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduled/schedulePromise.js
function schedulePromise(input2, scheduler) {
return innerFrom(input2).pipe(subscribeOn(scheduler), observeOn(scheduler));
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduled/scheduleArray.js
function scheduleArray(input2, scheduler) {
return new Observable((subscriber) => {
let i = 0;
return scheduler.schedule(function() {
if (i === input2.length) {
subscriber.complete();
} else {
subscriber.next(input2[i++]);
if (!subscriber.closed) {
this.schedule();
}
}
});
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduled/scheduleIterable.js
function scheduleIterable(input2, scheduler) {
return new Observable((subscriber) => {
let iterator2;
executeSchedule(subscriber, scheduler, () => {
iterator2 = input2[iterator]();
executeSchedule(subscriber, scheduler, () => {
let value;
let done;
try {
({ value, done } = iterator2.next());
} catch (err) {
subscriber.error(err);
return;
}
if (done) {
subscriber.complete();
} else {
subscriber.next(value);
}
}, 0, true);
});
return () => isFunction(iterator2 === null || iterator2 === void 0 ? void 0 : iterator2.return) && iterator2.return();
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduled/scheduleAsyncIterable.js
function scheduleAsyncIterable(input2, scheduler) {
if (!input2) {
throw new Error("Iterable cannot be null");
}
return new Observable((subscriber) => {
executeSchedule(subscriber, scheduler, () => {
const iterator2 = input2[Symbol.asyncIterator]();
executeSchedule(subscriber, scheduler, () => {
iterator2.next().then((result) => {
if (result.done) {
subscriber.complete();
} else {
subscriber.next(result.value);
}
});
}, 0, true);
});
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduled/scheduleReadableStreamLike.js
function scheduleReadableStreamLike(input2, scheduler) {
return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input2), scheduler);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/scheduled/scheduled.js
function scheduled(input2, scheduler) {
if (input2 != null) {
if (isInteropObservable(input2)) {
return scheduleObservable(input2, scheduler);
}
if (isArrayLike(input2)) {
return scheduleArray(input2, scheduler);
}
if (isPromise(input2)) {
return schedulePromise(input2, scheduler);
}
if (isAsyncIterable(input2)) {
return scheduleAsyncIterable(input2, scheduler);
}
if (isIterable(input2)) {
return scheduleIterable(input2, scheduler);
}
if (isReadableStreamLike(input2)) {
return scheduleReadableStreamLike(input2, scheduler);
}
}
throw createInvalidObservableTypeError(input2);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/observable/from.js
function from(input2, scheduler) {
return scheduler ? scheduled(input2, scheduler) : innerFrom(input2);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/observable/of.js
function of(...args) {
const scheduler = popScheduler(args);
return from(args, scheduler);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/observable/throwError.js
function throwError(errorOrErrorFactory, scheduler) {
const errorFactory = isFunction(errorOrErrorFactory) ? errorOrErrorFactory : () => errorOrErrorFactory;
const init = (subscriber) => subscriber.error(errorFactory());
return new Observable(scheduler ? (subscriber) => scheduler.schedule(init, 0, subscriber) : init);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/isObservable.js
function isObservable(obj) {
return !!obj && (obj instanceof Observable || isFunction(obj.lift) && isFunction(obj.subscribe));
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/EmptyError.js
var EmptyError = createErrorClass((_super) => function EmptyErrorImpl() {
_super(this);
this.name = "EmptyError";
this.message = "no elements in sequence";
});
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/isDate.js
function isValidDate(value) {
return value instanceof Date && !isNaN(value);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/map.js
function map(project, thisArg) {
return operate((source, subscriber) => {
let index = 0;
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
subscriber.next(project.call(thisArg, value, index++));
}));
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/mapOneOrManyArgs.js
var { isArray } = Array;
function callOrApply(fn, args) {
return isArray(args) ? fn(...args) : fn(args);
}
function mapOneOrManyArgs(fn) {
return map((args) => callOrApply(fn, args));
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/argsArgArrayOrObject.js
var { isArray: isArray2 } = Array;
var { getPrototypeOf, prototype: objectProto, keys: getKeys } = Object;
function argsArgArrayOrObject(args) {
if (args.length === 1) {
const first2 = args[0];
if (isArray2(first2)) {
return { args: first2, keys: null };
}
if (isPOJO(first2)) {
const keys = getKeys(first2);
return {
args: keys.map((key) => first2[key]),
keys
};
}
}
return { args, keys: null };
}
function isPOJO(obj) {
return obj && typeof obj === "object" && getPrototypeOf(obj) === objectProto;
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/createObject.js
function createObject(keys, values) {
return keys.reduce((result, key, i) => (result[key] = values[i], result), {});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/observable/combineLatest.js
function combineLatest(...args) {
const scheduler = popScheduler(args);
const resultSelector = popResultSelector(args);
const { args: observables, keys } = argsArgArrayOrObject(args);
if (observables.length === 0) {
return from([], scheduler);
}
const result = new Observable(combineLatestInit(observables, scheduler, keys ? (values) => createObject(keys, values) : identity));
return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;
}
function combineLatestInit(observables, scheduler, valueTransform = identity) {
return (subscriber) => {
maybeSchedule(scheduler, () => {
const { length } = observables;
const values = new Array(length);
let active = length;
let remainingFirstValues = length;
for (let i = 0; i < length; i++) {
maybeSchedule(scheduler, () => {
const source = from(observables[i], scheduler);
let hasFirstValue = false;
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
values[i] = value;
if (!hasFirstValue) {
hasFirstValue = true;
remainingFirstValues--;
}
if (!remainingFirstValues) {
subscriber.next(valueTransform(values.slice()));
}
}, () => {
if (!--active) {
subscriber.complete();
}
}));
}, subscriber);
}
}, subscriber);
};
}
function maybeSchedule(scheduler, execute, subscription) {
if (scheduler) {
executeSchedule(subscription, scheduler, execute);
} else {
execute();
}
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/mergeInternals.js
function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {
const buffer = [];
let active = 0;
let index = 0;
let isComplete = false;
const checkComplete = () => {
if (isComplete && !buffer.length && !active) {
subscriber.complete();
}
};
const outerNext = (value) => active < concurrent ? doInnerSub(value) : buffer.push(value);
const doInnerSub = (value) => {
expand && subscriber.next(value);
active++;
let innerComplete = false;
innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, (innerValue) => {
onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);
if (expand) {
outerNext(innerValue);
} else {
subscriber.next(innerValue);
}
}, () => {
innerComplete = true;
}, void 0, () => {
if (innerComplete) {
try {
active--;
while (buffer.length && active < concurrent) {
const bufferedValue = buffer.shift();
if (innerSubScheduler) {
executeSchedule(subscriber, innerSubScheduler, () => doInnerSub(bufferedValue));
} else {
doInnerSub(bufferedValue);
}
}
checkComplete();
} catch (err) {
subscriber.error(err);
}
}
}));
};
source.subscribe(createOperatorSubscriber(subscriber, outerNext, () => {
isComplete = true;
checkComplete();
}));
return () => {
additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();
};
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/mergeMap.js
function mergeMap(project, resultSelector, concurrent = Infinity) {
if (isFunction(resultSelector)) {
return mergeMap((a, i) => map((b, ii) => resultSelector(a, b, i, ii))(innerFrom(project(a, i))), concurrent);
} else if (typeof resultSelector === "number") {
concurrent = resultSelector;
}
return operate((source, subscriber) => mergeInternals(source, subscriber, project, concurrent));
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/mergeAll.js
function mergeAll(concurrent = Infinity) {
return mergeMap(identity, concurrent);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/concatAll.js
function concatAll() {
return mergeAll(1);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/observable/concat.js
function concat(...args) {
return concatAll()(from(args, popScheduler(args)));
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/observable/defer.js
function defer(observableFactory) {
return new Observable((subscriber) => {
innerFrom(observableFactory()).subscribe(subscriber);
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/observable/forkJoin.js
function forkJoin(...args) {
const resultSelector = popResultSelector(args);
const { args: sources, keys } = argsArgArrayOrObject(args);
const result = new Observable((subscriber) => {
const { length } = sources;
if (!length) {
subscriber.complete();
return;
}
const values = new Array(length);
let remainingCompletions = length;
let remainingEmissions = length;
for (let sourceIndex = 0; sourceIndex < length; sourceIndex++) {
let hasValue = false;
innerFrom(sources[sourceIndex]).subscribe(createOperatorSubscriber(subscriber, (value) => {
if (!hasValue) {
hasValue = true;
remainingEmissions--;
}
values[sourceIndex] = value;
}, () => remainingCompletions--, void 0, () => {
if (!remainingCompletions || !hasValue) {
if (!remainingEmissions) {
subscriber.next(keys ? createObject(keys, values) : values);
}
subscriber.complete();
}
}));
}
});
return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/observable/fromEvent.js
var nodeEventEmitterMethods = ["addListener", "removeListener"];
var eventTargetMethods = ["addEventListener", "removeEventListener"];
var jqueryMethods = ["on", "off"];
function fromEvent(target, eventName, options, resultSelector) {
if (isFunction(options)) {
resultSelector = options;
options = void 0;
}
if (resultSelector) {
return fromEvent(target, eventName, options).pipe(mapOneOrManyArgs(resultSelector));
}
const [add, remove2] = isEventTarget(target) ? eventTargetMethods.map((methodName) => (handler) => target[methodName](eventName, handler, options)) : isNodeStyleEventEmitter(target) ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName)) : isJQueryStyleEventEmitter(target) ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName)) : [];
if (!add) {
if (isArrayLike(target)) {
return mergeMap((subTarget) => fromEvent(subTarget, eventName, options))(innerFrom(target));
}
}
if (!add) {
throw new TypeError("Invalid event target");
}
return new Observable((subscriber) => {
const handler = (...args) => subscriber.next(1 < args.length ? args : args[0]);
add(handler);
return () => remove2(handler);
});
}
function toCommonHandlerRegistry(target, eventName) {
return (methodName) => (handler) => target[methodName](eventName, handler);
}
function isNodeStyleEventEmitter(target) {
return isFunction(target.addListener) && isFunction(target.removeListener);
}
function isJQueryStyleEventEmitter(target) {
return isFunction(target.on) && isFunction(target.off);
}
function isEventTarget(target) {
return isFunction(target.addEventListener) && isFunction(target.removeEventListener);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/observable/timer.js
function timer(dueTime = 0, intervalOrScheduler, scheduler = async) {
let intervalDuration = -1;
if (intervalOrScheduler != null) {
if (isScheduler(intervalOrScheduler)) {
scheduler = intervalOrScheduler;
} else {
intervalDuration = intervalOrScheduler;
}
}
return new Observable((subscriber) => {
let due = isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime;
if (due < 0) {
due = 0;
}
let n = 0;
return scheduler.schedule(function() {
if (!subscriber.closed) {
subscriber.next(n++);
if (0 <= intervalDuration) {
this.schedule(void 0, intervalDuration);
} else {
subscriber.complete();
}
}
}, due);
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/observable/merge.js
function merge(...args) {
const scheduler = popScheduler(args);
const concurrent = popNumber(args, Infinity);
const sources = args;
return !sources.length ? EMPTY : sources.length === 1 ? innerFrom(sources[0]) : mergeAll(concurrent)(from(sources, scheduler));
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/util/argsOrArgArray.js
var { isArray: isArray3 } = Array;
function argsOrArgArray(args) {
return args.length === 1 && isArray3(args[0]) ? args[0] : args;
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/filter.js
function filter(predicate, thisArg) {
return operate((source, subscriber) => {
let index = 0;
source.subscribe(createOperatorSubscriber(subscriber, (value) => predicate.call(thisArg, value, index++) && subscriber.next(value)));
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/observable/race.js
function race(...sources) {
sources = argsOrArgArray(sources);
return sources.length === 1 ? innerFrom(sources[0]) : new Observable(raceInit(sources));
}
function raceInit(sources) {
return (subscriber) => {
let subscriptions = [];
for (let i = 0; subscriptions && !subscriber.closed && i < sources.length; i++) {
subscriptions.push(innerFrom(sources[i]).subscribe(createOperatorSubscriber(subscriber, (value) => {
if (subscriptions) {
for (let s = 0; s < subscriptions.length; s++) {
s !== i && subscriptions[s].unsubscribe();
}
subscriptions = null;
}
subscriber.next(value);
})));
}
};
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/audit.js
function audit(durationSelector) {
return operate((source, subscriber) => {
let hasValue = false;
let lastValue = null;
let durationSubscriber = null;
let isComplete = false;
const endDuration = () => {
durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
durationSubscriber = null;
if (hasValue) {
hasValue = false;
const value = lastValue;
lastValue = null;
subscriber.next(value);
}
isComplete && subscriber.complete();
};
const cleanupDuration = () => {
durationSubscriber = null;
isComplete && subscriber.complete();
};
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
hasValue = true;
lastValue = value;
if (!durationSubscriber) {
innerFrom(durationSelector(value)).subscribe(durationSubscriber = createOperatorSubscriber(subscriber, endDuration, cleanupDuration));
}
}, () => {
isComplete = true;
(!hasValue || !durationSubscriber || durationSubscriber.closed) && subscriber.complete();
}));
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/auditTime.js
function auditTime(duration, scheduler = asyncScheduler) {
return audit(() => timer(duration, scheduler));
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/catchError.js
function catchError(selector) {
return operate((source, subscriber) => {
let innerSub = null;
let syncUnsub = false;
let handledResult;
innerSub = source.subscribe(createOperatorSubscriber(subscriber, void 0, void 0, (err) => {
handledResult = innerFrom(selector(err, catchError(selector)(source)));
if (innerSub) {
innerSub.unsubscribe();
innerSub = null;
handledResult.subscribe(subscriber);
} else {
syncUnsub = true;
}
}));
if (syncUnsub) {
innerSub.unsubscribe();
innerSub = null;
handledResult.subscribe(subscriber);
}
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/concatMap.js
function concatMap(project, resultSelector) {
return isFunction(resultSelector) ? mergeMap(project, resultSelector, 1) : mergeMap(project, 1);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/debounceTime.js
function debounceTime(dueTime, scheduler = asyncScheduler) {
return operate((source, subscriber) => {
let activeTask = null;
let lastValue = null;
let lastTime = null;
const emit = () => {
if (activeTask) {
activeTask.unsubscribe();
activeTask = null;
const value = lastValue;
lastValue = null;
subscriber.next(value);
}
};
function emitWhenIdle() {
const targetTime = lastTime + dueTime;
const now = scheduler.now();
if (now < targetTime) {
activeTask = this.schedule(void 0, targetTime - now);
subscriber.add(activeTask);
return;
}
emit();
}
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
lastValue = value;
lastTime = scheduler.now();
if (!activeTask) {
activeTask = scheduler.schedule(emitWhenIdle, dueTime);
subscriber.add(activeTask);
}
}, () => {
emit();
subscriber.complete();
}, void 0, () => {
lastValue = activeTask = null;
}));
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/defaultIfEmpty.js
function defaultIfEmpty(defaultValue) {
return operate((source, subscriber) => {
let hasValue = false;
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
hasValue = true;
subscriber.next(value);
}, () => {
if (!hasValue) {
subscriber.next(defaultValue);
}
subscriber.complete();
}));
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/take.js
function take(count) {
return count <= 0 ? () => EMPTY : operate((source, subscriber) => {
let seen = 0;
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
if (++seen <= count) {
subscriber.next(value);
if (count <= seen) {
subscriber.complete();
}
}
}));
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/distinctUntilChanged.js
function distinctUntilChanged(comparator, keySelector = identity) {
comparator = comparator !== null && comparator !== void 0 ? comparator : defaultCompare;
return operate((source, subscriber) => {
let previousKey;
let first2 = true;
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
const currentKey = keySelector(value);
if (first2 || !comparator(previousKey, currentKey)) {
first2 = false;
previousKey = currentKey;
subscriber.next(value);
}
}));
});
}
function defaultCompare(a, b) {
return a === b;
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/throwIfEmpty.js
function throwIfEmpty(errorFactory = defaultErrorFactory) {
return operate((source, subscriber) => {
let hasValue = false;
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
hasValue = true;
subscriber.next(value);
}, () => hasValue ? subscriber.complete() : subscriber.error(errorFactory())));
});
}
function defaultErrorFactory() {
return new EmptyError();
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/exhaustMap.js
function exhaustMap(project, resultSelector) {
if (resultSelector) {
return (source) => source.pipe(exhaustMap((a, i) => innerFrom(project(a, i)).pipe(map((b, ii) => resultSelector(a, b, i, ii)))));
}
return operate((source, subscriber) => {
let index = 0;
let innerSub = null;
let isComplete = false;
source.subscribe(createOperatorSubscriber(subscriber, (outerValue) => {
if (!innerSub) {
innerSub = createOperatorSubscriber(subscriber, void 0, () => {
innerSub = null;
isComplete && subscriber.complete();
});
innerFrom(project(outerValue, index++)).subscribe(innerSub);
}
}, () => {
isComplete = true;
!innerSub && subscriber.complete();
}));
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/finalize.js
function finalize(callback) {
return operate((source, subscriber) => {
try {
source.subscribe(subscriber);
} finally {
subscriber.add(callback);
}
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/first.js
function first(predicate, defaultValue) {
const hasDefaultValue = arguments.length >= 2;
return (source) => source.pipe(predicate ? filter((v, i) => predicate(v, i, source)) : identity, take(1), hasDefaultValue ? defaultIfEmpty(defaultValue) : throwIfEmpty(() => new EmptyError()));
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/pairwise.js
function pairwise() {
return operate((source, subscriber) => {
let prev;
let hasPrev = false;
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
const p = prev;
prev = value;
hasPrev && subscriber.next([p, value]);
hasPrev = true;
}));
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/share.js
function share(options = {}) {
const { connector = () => new Subject(), resetOnError = true, resetOnComplete = true, resetOnRefCountZero = true } = options;
return (wrapperSource) => {
let connection;
let resetConnection;
let subject;
let refCount2 = 0;
let hasCompleted = false;
let hasErrored = false;
const cancelReset = () => {
resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();
resetConnection = void 0;
};
const reset = () => {
cancelReset();
connection = subject = void 0;
hasCompleted = hasErrored = false;
};
const resetAndUnsubscribe = () => {
const conn = connection;
reset();
conn === null || conn === void 0 ? void 0 : conn.unsubscribe();
};
return operate((source, subscriber) => {
refCount2++;
if (!hasErrored && !hasCompleted) {
cancelReset();
}
const dest = subject = subject !== null && subject !== void 0 ? subject : connector();
subscriber.add(() => {
refCount2--;
if (refCount2 === 0 && !hasErrored && !hasCompleted) {
resetConnection = handleReset(resetAndUnsubscribe, resetOnRefCountZero);
}
});
dest.subscribe(subscriber);
if (!connection && refCount2 > 0) {
connection = new SafeSubscriber({
next: (value) => dest.next(value),
error: (err) => {
hasErrored = true;
cancelReset();
resetConnection = handleReset(reset, resetOnError, err);
dest.error(err);
},
complete: () => {
hasCompleted = true;
cancelReset();
resetConnection = handleReset(reset, resetOnComplete);
dest.complete();
}
});
innerFrom(source).subscribe(connection);
}
})(wrapperSource);
};
}
function handleReset(reset, on, ...args) {
if (on === true) {
reset();
return;
}
if (on === false) {
return;
}
const onSubscriber = new SafeSubscriber({
next: () => {
onSubscriber.unsubscribe();
reset();
}
});
return innerFrom(on(...args)).subscribe(onSubscriber);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/shareReplay.js
function shareReplay(configOrBufferSize, windowTime, scheduler) {
let bufferSize;
let refCount2 = false;
if (configOrBufferSize && typeof configOrBufferSize === "object") {
({ bufferSize = Infinity, windowTime = Infinity, refCount: refCount2 = false, scheduler } = configOrBufferSize);
} else {
bufferSize = configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity;
}
return share({
connector: () => new ReplaySubject(bufferSize, windowTime, scheduler),
resetOnError: true,
resetOnComplete: false,
resetOnRefCountZero: refCount2
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/skip.js
function skip(count) {
return filter((_, index) => count <= index);
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/startWith.js
function startWith(...values) {
const scheduler = popScheduler(values);
return operate((source, subscriber) => {
(scheduler ? concat(values, source, scheduler) : concat(values, source)).subscribe(subscriber);
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/switchMap.js
function switchMap(project, resultSelector) {
return operate((source, subscriber) => {
let innerSubscriber = null;
let index = 0;
let isComplete = false;
const checkComplete = () => isComplete && !innerSubscriber && subscriber.complete();
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
innerSubscriber === null || innerSubscriber === void 0 ? void 0 : innerSubscriber.unsubscribe();
let innerIndex = 0;
const outerIndex = index++;
innerFrom(project(value, outerIndex)).subscribe(innerSubscriber = createOperatorSubscriber(subscriber, (innerValue) => subscriber.next(resultSelector ? resultSelector(value, innerValue, outerIndex, innerIndex++) : innerValue), () => {
innerSubscriber = null;
checkComplete();
}));
}, () => {
isComplete = true;
checkComplete();
}));
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/takeUntil.js
function takeUntil(notifier) {
return operate((source, subscriber) => {
innerFrom(notifier).subscribe(createOperatorSubscriber(subscriber, () => subscriber.complete(), noop));
!subscriber.closed && source.subscribe(subscriber);
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/takeWhile.js
function takeWhile(predicate, inclusive = false) {
return operate((source, subscriber) => {
let index = 0;
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
const result = predicate(value, index++);
(result || inclusive) && subscriber.next(value);
!result && subscriber.complete();
}));
});
}
// node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm/internal/operators/tap.js
function tap(observerOrNext, error, complete) {
const tapObserver = isFunction(observerOrNext) || error || complete ? { next: observerOrNext, error, complete } : observerOrNext;
return tapObserver ? operate((source, subscriber) => {
var _a;
(_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
let isUnsub = true;
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
var _a2;
(_a2 = tapObserver.next) === null || _a2 === void 0 ? void 0 : _a2.call(tapObserver, value);
subscriber.next(value);
}, () => {
var _a2;
isUnsub = false;
(_a2 = tapObserver.complete) === null || _a2 === void 0 ? void 0 : _a2.call(tapObserver);
subscriber.complete();
}, (err) => {
var _a2;
isUnsub = false;
(_a2 = tapObserver.error) === null || _a2 === void 0 ? void 0 : _a2.call(tapObserver, err);
subscriber.error(err);
}, () => {
var _a2, _b;
if (isUnsub) {
(_a2 = tapObserver.unsubscribe) === null || _a2 === void 0 ? void 0 : _a2.call(tapObserver);
}
(_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);
}));
}) : identity;
}
// node_modules/.pnpm/@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs@7.8.2/node_modules/@angular/core/fesm2022/untracked.mjs
function createLinkedSignal(sourceFn, computationFn, equalityFn) {
const node = Object.create(LINKED_SIGNAL_NODE);
node.source = sourceFn;
node.computation = computationFn;
if (equalityFn != void 0) {
node.equal = equalityFn;
}
const linkedSignalGetter = () => {
producerUpdateValueVersion(node);
producerAccessed(node);
if (node.value === ERRORED) {
throw node.error;
}
return node.value;
};
const getter = linkedSignalGetter;
getter[SIGNAL] = node;
if (typeof ngDevMode !== "undefined" && ngDevMode) {
const debugName = node.debugName ? " (" + node.debugName + ")" : "";
getter.toString = () => `[LinkedSignal${debugName}: ${node.value}]`;
}
runPostProducerCreatedFn(node);
return getter;
}
function linkedSignalSetFn(node, newValue) {
producerUpdateValueVersion(node);
signalSetFn(node, newValue);
producerMarkClean(node);
}
function linkedSignalUpdateFn(node, updater) {
producerUpdateValueVersion(node);
signalUpdateFn(node, updater);
producerMarkClean(node);
}
var LINKED_SIGNAL_NODE = /* @__PURE__ */ (() => {
return __spreadProps(__spreadValues({}, REACTIVE_NODE), {
value: UNSET,
dirty: true,
error: null,
equal: defaultEquals,
kind: "linkedSignal",
producerMustRecompute(node) {
return node.value === UNSET || node.value === COMPUTING;
},
producerRecomputeValue(node) {
if (node.value === COMPUTING) {
throw new Error(typeof ngDevMode !== "undefined" && ngDevMode ? "Detected cycle in computations." : "");
}
const oldValue = node.value;
node.value = COMPUTING;
const prevConsumer = consumerBeforeComputation(node);
let newValue;
try {
const newSourceValue = node.source();
const prev = oldValue === UNSET || oldValue === ERRORED ? void 0 : {
source: node.sourceValue,
value: oldValue
};
newValue = node.computation(newSourceValue, prev);
node.sourceValue = newSourceValue;
} catch (err) {
newValue = ERRORED;
node.error = err;
} finally {
consumerAfterComputation(node, prevConsumer);
}
if (oldValue !== UNSET && newValue !== ERRORED && node.equal(oldValue, newValue)) {
node.value = oldValue;
return;
}
node.value = newValue;
node.version++;
}
});
})();
function untracked(nonReactiveReadsFn) {
const prevConsumer = setActiveConsumer(null);
try {
return nonReactiveReadsFn();
} finally {
setActiveConsumer(prevConsumer);
}
}
// node_modules/.pnpm/@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs@7.8.2/node_modules/@angular/core/fesm2022/root_effect_scheduler.mjs
var ERROR_DETAILS_PAGE_BASE_URL = "https://angular.dev/errors";
var XSS_SECURITY_URL = "https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss";
var RuntimeError = class extends Error {
code;
constructor(code, message) {
super(formatRuntimeError(code, message));
this.code = code;
}
};
function formatRuntimeErrorCode(code) {
return `NG0${Math.abs(code)}`;
}
function formatRuntimeError(code, message) {
const fullCode = formatRuntimeErrorCode(code);
let errorMessage = `${fullCode}${message ? ": " + message : ""}`;
if (ngDevMode && code < 0) {
const addPeriodSeparator = !errorMessage.match(/[.,;!?\n]$/);
const separator = addPeriodSeparator ? "." : "";
errorMessage = `${errorMessage}${separator} Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`;
}
return errorMessage;
}
var _global = globalThis;
function ngDevModeResetPerfCounters() {
const locationString = typeof location !== "undefined" ? location.toString() : "";
const newCounters = {
hydratedNodes: 0,
hydratedComponents: 0,
dehydratedViewsRemoved: 0,
dehydratedViewsCleanupRuns: 0,
componentsSkippedHydration: 0,
deferBlocksWithIncrementalHydration: 0
};
const allowNgDevModeTrue = locationString.indexOf("ngDevMode=false") === -1;
if (!allowNgDevModeTrue) {
_global["ngDevMode"] = false;
} else {
if (typeof _global["ngDevMode"] !== "object") {
_global["ngDevMode"] = {};
}
Object.assign(_global["ngDevMode"], newCounters);
}
return newCounters;
}
function initNgDevMode() {
if (typeof ngDevMode === "undefined" || ngDevMode) {
if (typeof ngDevMode !== "object" || Object.keys(ngDevMode).length === 0) {
ngDevModeResetPerfCounters();
}
return typeof ngDevMode !== "undefined" && !!ngDevMode;
}
return false;
}
function getClosureSafeProperty(objWithPropertyToExtract) {
for (let key in objWithPropertyToExtract) {
if (objWithPropertyToExtract[key] === getClosureSafeProperty) {
return key;
}
}
throw Error(typeof ngDevMode !== "undefined" && ngDevMode ? "Could not find renamed property on target object." : "");
}
function fillProperties(target, source) {
for (const key in source) {
if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {
target[key] = source[key];
}
}
}
function stringify(token) {
if (typeof token === "string") {
return token;
}
if (Array.isArray(token)) {
return `[${token.map(stringify).join(", ")}]`;
}
if (token == null) {
return "" + token;
}
const name = token.overriddenName || token.name;
if (name) {
return `${name}`;
}
const result = token.toString();
if (result == null) {
return "" + result;
}
const newLineIndex = result.indexOf("\n");
return newLineIndex >= 0 ? result.slice(0, newLineIndex) : result;
}
function concatStringsWithSpace(before, after) {
if (!before)
return after || "";
if (!after)
return before;
return `${before} ${after}`;
}
var __forward_ref__ = getClosureSafeProperty({ __forward_ref__: getClosureSafeProperty });
function forwardRef(forwardRefFn) {
forwardRefFn.__forward_ref__ = forwardRef;
forwardRefFn.toString = function() {
return stringify(this());
};
return forwardRefFn;
}
function resolveForwardRef(type) {
return isForwardRef(type) ? type() : type;
}
function isForwardRef(fn) {
return typeof fn === "function" && fn.hasOwnProperty(__forward_ref__) && fn.__forward_ref__ === forwardRef;
}
function assertNumber(actual, msg) {
if (!(typeof actual === "number")) {
throwError2(msg, typeof actual, "number", "===");
}
}
function assertNumberInRange(actual, minInclusive, maxInclusive) {
assertNumber(actual, "Expected a number");
assertLessThanOrEqual(actual, maxInclusive, "Expected number to be less than or equal to");
assertGreaterThanOrEqual(actual, minInclusive, "Expected number to be greater than or equal to");
}
function assertString(actual, msg) {
if (!(typeof actual === "string")) {
throwError2(msg, actual === null ? "null" : typeof actual, "string", "===");
}
}
function assertFunction(actual, msg) {
if (!(typeof actual === "function")) {
throwError2(msg, actual === null ? "null" : typeof actual, "function", "===");
}
}
function assertEqual(actual, expected, msg) {
if (!(actual == expected)) {
throwError2(msg, actual, expected, "==");
}
}
function assertNotEqual(actual, expected, msg) {
if (!(actual != expected)) {
throwError2(msg, actual, expected, "!=");
}
}
function assertSame(actual, expected, msg) {
if (!(actual === expected)) {
throwError2(msg, actual, expected, "===");
}
}
function assertNotSame(actual, expected, msg) {
if (!(actual !== expected)) {
throwError2(msg, actual, expected, "!==");
}
}
function assertLessThan(actual, expected, msg) {
if (!(actual < expected)) {
throwError2(msg, actual, expected, "<");
}
}
function assertLessThanOrEqual(actual, expected, msg) {
if (!(actual <= expected)) {
throwError2(msg, actual, expected, "<=");
}
}
function assertGreaterThan(actual, expected, msg) {
if (!(actual > expected)) {
throwError2(msg, actual, expected, ">");
}
}
function assertGreaterThanOrEqual(actual, expected, msg) {
if (!(actual >= expected)) {
throwError2(msg, actual, expected, ">=");
}
}
function assertDefined(actual, msg) {
if (actual == null) {
throwError2(msg, actual, null, "!=");
}
}
function throwError2(msg, actual, expected, comparison) {
throw new Error(`ASSERTION ERROR: ${msg}` + (comparison == null ? "" : ` [Expected=> ${expected} ${comparison} ${actual} <=Actual]`));
}
function assertDomNode(node) {
if (!(node instanceof Node)) {
throwError2(`The provided value must be an instance of a DOM Node but got ${stringify(node)}`);
}
}
function assertElement(node) {
if (!(node instanceof Element)) {
throwError2(`The provided value must be an element but got ${stringify(node)}`);
}
}
function assertIndexInRange(arr, index) {
assertDefined(arr, "Array must be defined.");
const maxLen = arr.length;
if (index < 0 || index >= maxLen) {
throwError2(`Index expected to be less than ${maxLen} but got ${index}`);
}
}
function assertOneOf(value, ...validValues) {
if (validValues.indexOf(value) !== -1)
return true;
throwError2(`Expected value to be one of ${JSON.stringify(validValues)} but was ${JSON.stringify(value)}.`);
}
function assertNotReactive(fn) {
if (getActiveConsumer() !== null) {
throwError2(`${fn}() should never be called in a reactive context.`);
}
}
function \u0275\u0275defineInjectable(opts) {
return {
token: opts.token,
providedIn: opts.providedIn || null,
factory: opts.factory,
value: void 0
};
}
function \u0275\u0275defineInjector(options) {
return { providers: options.providers || [], imports: options.imports || [] };
}
function getInjectableDef(type) {
return getOwnDefinition(type, NG_PROV_DEF);
}
function getOwnDefinition(type, field) {
return type.hasOwnProperty(field) && type[field] || null;
}
function getInheritedInjectableDef(type) {
const def = type?.[NG_PROV_DEF] ?? null;
if (def) {
ngDevMode && console.warn(`DEPRECATED: DI is instantiating a token "${type.name}" that inherits its @Injectable decorator but does not provide one itself.
This will become an error in a future version of Angular. Please add @Injectable() to the "${type.name}" class.`);
return def;
} else {
return null;
}
}
function getInjectorDef(type) {
return type && type.hasOwnProperty(NG_INJ_DEF) ? type[NG_INJ_DEF] : null;
}
var NG_PROV_DEF = getClosureSafeProperty({ \u0275prov: getClosureSafeProperty });
var NG_INJ_DEF = getClosureSafeProperty({ \u0275inj: getClosureSafeProperty });
var InjectionToken = class {
_desc;
/** @internal */
ngMetadataName = "InjectionToken";
\u0275prov;
/**
* @param _desc Description for the token,
* used only for debugging purposes,
* it should but does not need to be unique
* @param options Options for the token's usage, as described above
*/
constructor(_desc, options) {
this._desc = _desc;
this.\u0275prov = void 0;
if (typeof options == "number") {
(typeof ngDevMode === "undefined" || ngDevMode) && assertLessThan(options, 0, "Only negative numbers are supported here");
this.__NG_ELEMENT_ID__ = options;
} else if (options !== void 0) {
this.\u0275prov = \u0275\u0275defineInjectable({
token: this,
providedIn: options.providedIn || "root",
factory: options.factory
});
}
}
/**
* @internal
*/
get multi() {
return this;
}
toString() {
return `InjectionToken ${this._desc}`;
}
};
var _injectorProfilerContext;
function getInjectorProfilerContext() {
!ngDevMode && throwError2("getInjectorProfilerContext should never be called in production mode");
return _injectorProfilerContext;
}
function setInjectorProfilerContext(context2) {
!ngDevMode && throwError2("setInjectorProfilerContext should never be called in production mode");
const previous = _injectorProfilerContext;
_injectorProfilerContext = context2;
return previous;
}
var injectorProfilerCallbacks = [];
var NOOP_PROFILER_REMOVAL = () => {
};
function removeProfiler(profiler2) {
const profilerIdx = injectorProfilerCallbacks.indexOf(profiler2);
if (profilerIdx !== -1) {
injectorProfilerCallbacks.splice(profilerIdx, 1);
}
}
function setInjectorProfiler(injectorProfiler2) {
!ngDevMode && throwError2("setInjectorProfiler should never be called in production mode");
if (injectorProfiler2 !== null) {
if (!injectorProfilerCallbacks.includes(injectorProfiler2)) {
injectorProfilerCallbacks.push(injectorProfiler2);
}
return () => removeProfiler(injectorProfiler2);
} else {
injectorProfilerCallbacks.length = 0;
return NOOP_PROFILER_REMOVAL;
}
}
function injectorProfiler(event) {
!ngDevMode && throwError2("Injector profiler should never be called in production mode");
for (let i = 0; i < injectorProfilerCallbacks.length; i++) {
const injectorProfilerCallback = injectorProfilerCallbacks[i];
injectorProfilerCallback(event);
}
}
function emitProviderConfiguredEvent(eventProvider, isViewProvider = false) {
!ngDevMode && throwError2("Injector profiler should never be called in production mode");
let token;
if (typeof eventProvider === "function") {
token = eventProvider;
} else if (eventProvider instanceof InjectionToken) {
token = eventProvider;
} else {
token = resolveForwardRef(eventProvider.provide);
}
let provider = eventProvider;
if (eventProvider instanceof InjectionToken) {
provider = eventProvider.\u0275prov || eventProvider;
}
injectorProfiler({
type: 2,
context: getInjectorProfilerContext(),
providerRecord: { token, provider, isViewProvider }
});
}
function emitInjectorToCreateInstanceEvent(token) {
!ngDevMode && throwError2("Injector profiler should never be called in production mode");
injectorProfiler({
type: 4,
context: getInjectorProfilerContext(),
token
});
}
function emitInstanceCreatedByInjectorEvent(instance) {
!ngDevMode && throwError2("Injector profiler should never be called in production mode");
injectorProfiler({
type: 1,
context: getInjectorProfilerContext(),
instance: { value: instance }
});
}
function emitInjectEvent(token, value, flags) {
!ngDevMode && throwError2("Injector profiler should never be called in production mode");
injectorProfiler({
type: 0,
context: getInjectorProfilerContext(),
service: { token, value, flags }
});
}
function emitEffectCreatedEvent(effect2) {
!ngDevMode && throwError2("Injector profiler should never be called in production mode");
injectorProfiler({
type: 3,
context: getInjectorProfilerContext(),
effect: effect2
});
}
function runInInjectorProfilerContext(injector, token, callback) {
!ngDevMode && throwError2("runInInjectorProfilerContext should never be called in production mode");
const prevInjectContext = setInjectorProfilerContext({ injector, token });
try {
callback();
} finally {
setInjectorProfilerContext(prevInjectContext);
}
}
function isEnvironmentProviders(value) {
return value && !!value.\u0275providers;
}
var NG_COMP_DEF = getClosureSafeProperty({ \u0275cmp: getClosureSafeProperty });
var NG_DIR_DEF = getClosureSafeProperty({ \u0275dir: getClosureSafeProperty });
var NG_PIPE_DEF = getClosureSafeProperty({ \u0275pipe: getClosureSafeProperty });
var NG_MOD_DEF = getClosureSafeProperty({ \u0275mod: getClosureSafeProperty });
var NG_FACTORY_DEF = getClosureSafeProperty({ \u0275fac: getClosureSafeProperty });
var NG_ELEMENT_ID = getClosureSafeProperty({
__NG_ELEMENT_ID__: getClosureSafeProperty
});
var NG_ENV_ID = getClosureSafeProperty({ __NG_ENV_ID__: getClosureSafeProperty });
function renderStringify(value) {
if (typeof value === "string")
return value;
if (value == null)
return "";
return String(value);
}
function stringifyForError(value) {
if (typeof value === "function")
return value.name || value.toString();
if (typeof value === "object" && value != null && typeof value.type === "function") {
return value.type.name || value.type.toString();
}
return renderStringify(value);
}
var NG_RUNTIME_ERROR_CODE = getClosureSafeProperty({ "ngErrorCode": getClosureSafeProperty });
var NG_RUNTIME_ERROR_MESSAGE = getClosureSafeProperty({ "ngErrorMessage": getClosureSafeProperty });
var NG_TOKEN_PATH = getClosureSafeProperty({ "ngTokenPath": getClosureSafeProperty });
function cyclicDependencyError(token, path) {
const message = ngDevMode ? `Circular dependency detected for \`${token}\`.` : "";
return createRuntimeError(message, -200, path);
}
function cyclicDependencyErrorWithDetails(token, path) {
return augmentRuntimeError(cyclicDependencyError(token, path), null);
}
function throwMixedMultiProviderError() {
throw new Error(`Cannot mix multi providers and regular providers`);
}
function throwInvalidProviderError(ngModuleType, providers, provider) {
if (ngModuleType && providers) {
const providerDetail = providers.map((v) => v == provider ? "?" + provider + "?" : "...");
throw new Error(`Invalid provider for the NgModule '${stringify(ngModuleType)}' - only instances of Provider and Type are allowed, got: [${providerDetail.join(", ")}]`);
} else if (isEnvironmentProviders(provider)) {
if (provider.\u0275fromNgModule) {
throw new RuntimeError(207, `Invalid providers from 'importProvidersFrom' present in a non-environment injector. 'importProvidersFrom' can't be used for component providers.`);
} else {
throw new RuntimeError(207, `Invalid providers present in a non-environment injector. 'EnvironmentProviders' can't be used for component providers.`);
}
} else {
throw new Error("Invalid provider");
}
}
function throwProviderNotFoundError(token, injectorName) {
const errorMessage = ngDevMode && `No provider for ${stringifyForError(token)} found${injectorName ? ` in ${injectorName}` : ""}`;
throw new RuntimeError(-201, errorMessage);
}
function prependTokenToDependencyPath(error, token) {
error[NG_TOKEN_PATH] ??= [];
const currentPath = error[NG_TOKEN_PATH];
let pathStr;
if (typeof token === "object" && "multi" in token && token?.multi === true) {
assertDefined(token.provide, "Token with multi: true should have a provide property");
pathStr = stringifyForError(token.provide);
} else {
pathStr = stringifyForError(token);
}
if (currentPath[0] !== pathStr) {
error[NG_TOKEN_PATH].unshift(pathStr);
}
}
function augmentRuntimeError(error, source) {
const tokenPath = error[NG_TOKEN_PATH];
const errorCode = error[NG_RUNTIME_ERROR_CODE];
const message = error[NG_RUNTIME_ERROR_MESSAGE] || error.message;
error.message = formatErrorMessage(message, errorCode, tokenPath, source);
return error;
}
function createRuntimeError(message, code, path) {
const error = new RuntimeError(code, message);
error[NG_RUNTIME_ERROR_CODE] = code;
error[NG_RUNTIME_ERROR_MESSAGE] = message;
if (path) {
error[NG_TOKEN_PATH] = path;
}
return error;
}
function getRuntimeErrorCode(error) {
return error[NG_RUNTIME_ERROR_CODE];
}
function formatErrorMessage(text, code, path = [], source = null) {
let pathDetails = "";
if (path && path.length > 1) {
pathDetails = ` Path: ${path.join(" -> ")}.`;
}
const sourceDetails = source ? ` Source: ${source}.` : "";
return formatRuntimeError(code, `${text}${sourceDetails}${pathDetails}`);
}
var _injectImplementation;
function getInjectImplementation() {
return _injectImplementation;
}
function setInjectImplementation(impl) {
const previous = _injectImplementation;
_injectImplementation = impl;
return previous;
}
function injectRootLimpMode(token, notFoundValue, flags) {
const injectableDef = getInjectableDef(token);
if (injectableDef && injectableDef.providedIn == "root") {
return injectableDef.value === void 0 ? injectableDef.value = injectableDef.factory() : injectableDef.value;
}
if (flags & 8)
return null;
if (notFoundValue !== void 0)
return notFoundValue;
throwProviderNotFoundError(token, "Injector");
}
function assertInjectImplementationNotEqual(fn) {
ngDevMode && assertNotEqual(_injectImplementation, fn, "Calling \u0275\u0275inject would cause infinite recursion");
}
var _THROW_IF_NOT_FOUND = {};
var THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
var DI_DECORATOR_FLAG = "__NG_DI_FLAG__";
var RetrievingInjector = class {
injector;
constructor(injector) {
this.injector = injector;
}
retrieve(token, options) {
const flags = convertToBitFlags(options) || 0;
try {
return this.injector.get(
token,
// When a dependency is requested with an optional flag, DI returns null as the default value.
flags & 8 ? null : THROW_IF_NOT_FOUND,
flags
);
} catch (e) {
if (isNotFound(e)) {
return e;
}
throw e;
}
}
};
function injectInjectorOnly(token, flags = 0) {
const currentInjector = getCurrentInjector();
if (currentInjector === void 0) {
throw new RuntimeError(-203, ngDevMode && `The \`${stringify(token)}\` token injection failed. \`inject()\` function must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \`runInInjectionContext\`.`);
} else if (currentInjector === null) {
return injectRootLimpMode(token, void 0, flags);
} else {
const options = convertToInjectOptions(flags);
const value = currentInjector.retrieve(token, options);
ngDevMode && emitInjectEvent(token, value, flags);
if (isNotFound(value)) {
if (options.optional) {
return null;
}
throw value;
}
return value;
}
}
function \u0275\u0275inject(token, flags = 0) {
return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags);
}
function \u0275\u0275invalidFactoryDep(index) {
throw new RuntimeError(202, ngDevMode && `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.
This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.
Please check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`);
}
function inject2(token, options) {
return \u0275\u0275inject(token, convertToBitFlags(options));
}
function convertToBitFlags(flags) {
if (typeof flags === "undefined" || typeof flags === "number") {
return flags;
}
return 0 | // comment to force a line break in the formatter
(flags.optional && 8) | (flags.host && 1) | (flags.self && 2) | (flags.skipSelf && 4);
}
function convertToInjectOptions(flags) {
return {
optional: !!(flags & 8),
host: !!(flags & 1),
self: !!(flags & 2),
skipSelf: !!(flags & 4)
};
}
function injectArgs(types) {
const args = [];
for (let i = 0; i < types.length; i++) {
const arg = resolveForwardRef(types[i]);
if (Array.isArray(arg)) {
if (arg.length === 0) {
throw new RuntimeError(900, ngDevMode && "Arguments array must have arguments.");
}
let type = void 0;
let flags = 0;
for (let j = 0; j < arg.length; j++) {
const meta = arg[j];
const flag = getInjectFlag(meta);
if (typeof flag === "number") {
if (flag === -1) {
type = meta.token;
} else {
flags |= flag;
}
} else {
type = meta;
}
}
args.push(\u0275\u0275inject(type, flags));
} else {
args.push(\u0275\u0275inject(arg));
}
}
return args;
}
function attachInjectFlag(decorator, flag) {
decorator[DI_DECORATOR_FLAG] = flag;
decorator.prototype[DI_DECORATOR_FLAG] = flag;
return decorator;
}
function getInjectFlag(token) {
return token[DI_DECORATOR_FLAG];
}
function getFactoryDef(type, throwNotFound) {
const hasFactoryDef = type.hasOwnProperty(NG_FACTORY_DEF);
if (!hasFactoryDef && throwNotFound === true && ngDevMode) {
throw new Error(`Type ${stringify(type)} does not have '\u0275fac' property.`);
}
return hasFactoryDef ? type[NG_FACTORY_DEF] : null;
}
function arrayEquals(a, b, identityAccessor) {
if (a.length !== b.length)
return false;
for (let i = 0; i < a.length; i++) {
let valueA = a[i];
let valueB = b[i];
if (identityAccessor) {
valueA = identityAccessor(valueA);
valueB = identityAccessor(valueB);
}
if (valueB !== valueA) {
return false;
}
}
return true;
}
function flatten(list) {
return list.flat(Number.POSITIVE_INFINITY);
}
function deepForEach(input2, fn) {
input2.forEach((value) => Array.isArray(value) ? deepForEach(value, fn) : fn(value));
}
function addToArray(arr, index, value) {
if (index >= arr.length) {
arr.push(value);
} else {
arr.splice(index, 0, value);
}
}
function removeFromArray(arr, index) {
if (index >= arr.length - 1) {
return arr.pop();
} else {
return arr.splice(index, 1)[0];
}
}
function newArray(size, value) {
const list = [];
for (let i = 0; i < size; i++) {
list.push(value);
}
return list;
}
function arraySplice(array, index, count) {
const length = array.length - count;
while (index < length) {
array[index] = array[index + count];
index++;
}
while (count--) {
array.pop();
}
}
function arrayInsert2(array, index, value1, value2) {
ngDevMode && assertLessThanOrEqual(index, array.length, "Can't insert past array end.");
let end = array.length;
if (end == index) {
array.push(value1, value2);
} else if (end === 1) {
array.push(value2, array[0]);
array[0] = value1;
} else {
end--;
array.push(array[end - 1], array[end]);
while (end > index) {
const previousEnd = end - 2;
array[end] = array[previousEnd];
end--;
}
array[index] = value1;
array[index + 1] = value2;
}
}
function keyValueArraySet(keyValueArray, key, value) {
let index = keyValueArrayIndexOf(keyValueArray, key);
if (index >= 0) {
keyValueArray[index | 1] = value;
} else {
index = ~index;
arrayInsert2(keyValueArray, index, key, value);
}
return index;
}
function keyValueArrayGet(keyValueArray, key) {
const index = keyValueArrayIndexOf(keyValueArray, key);
if (index >= 0) {
return keyValueArray[index | 1];
}
return void 0;
}
function keyValueArrayIndexOf(keyValueArray, key) {
return _arrayIndexOfSorted(keyValueArray, key, 1);
}
function _arrayIndexOfSorted(array, value, shift) {
ngDevMode && assertEqual(Array.isArray(array), true, "Expecting an array");
let start = 0;
let end = array.length >> shift;
while (end !== start) {
const middle = start + (end - start >> 1);
const current = array[middle << shift];
if (value === current) {
return middle << shift;
} else if (current > value) {
end = middle;
} else {
start = middle + 1;
}
}
return ~(end << shift);
}
var EMPTY_OBJ = {};
var EMPTY_ARRAY = [];
if ((typeof ngDevMode === "undefined" || ngDevMode) && initNgDevMode()) {
Object.freeze(EMPTY_OBJ);
Object.freeze(EMPTY_ARRAY);
}
var ENVIRONMENT_INITIALIZER = new InjectionToken(ngDevMode ? "ENVIRONMENT_INITIALIZER" : "");
var INJECTOR$1 = new InjectionToken(
ngDevMode ? "INJECTOR" : "",
// Disable tslint because this is const enum which gets inlined not top level prop access.
// tslint:disable-next-line: no-toplevel-property-access
-1
/* InjectorMarkers.Injector */
);
var INJECTOR_DEF_TYPES = new InjectionToken(ngDevMode ? "INJECTOR_DEF_TYPES" : "");
var NullInjector = class {
get(token, notFoundValue = THROW_IF_NOT_FOUND) {
if (notFoundValue === THROW_IF_NOT_FOUND) {
const message = ngDevMode ? `No provider found for \`${stringify(token)}\`.` : "";
const error = createRuntimeError(
message,
-201
/* RuntimeErrorCode.PROVIDER_NOT_FOUND */
);
error.name = "\u0275NotFound";
throw error;
}
return notFoundValue;
}
};
function getNgModuleDef(type) {
return type[NG_MOD_DEF] || null;
}
function getNgModuleDefOrThrow(type) {
const ngModuleDef = getNgModuleDef(type);
if (!ngModuleDef) {
throw new RuntimeError(915, (typeof ngDevMode === "undefined" || ngDevMode) && `Type ${stringify(type)} does not have '\u0275mod' property.`);
}
return ngModuleDef;
}
function getComponentDef(type) {
return type[NG_COMP_DEF] || null;
}
function getDirectiveDefOrThrow(type) {
const def = getDirectiveDef(type);
if (!def) {
throw new RuntimeError(916, (typeof ngDevMode === "undefined" || ngDevMode) && `Type ${stringify(type)} does not have '\u0275dir' property.`);
}
return def;
}
function getDirectiveDef(type) {
return type[NG_DIR_DEF] || null;
}
function getPipeDef(type) {
return type[NG_PIPE_DEF] || null;
}
function isStandalone(type) {
const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef(type);
return def !== null && def.standalone;
}
function makeEnvironmentProviders(providers) {
return {
\u0275providers: providers
};
}
function provideEnvironmentInitializer(initializerFn) {
return makeEnvironmentProviders([
{
provide: ENVIRONMENT_INITIALIZER,
multi: true,
useValue: initializerFn
}
]);
}
function importProvidersFrom(...sources) {
return {
\u0275providers: internalImportProvidersFrom(true, sources),
\u0275fromNgModule: true
};
}
function internalImportProvidersFrom(checkForStandaloneCmp, ...sources) {
const providersOut = [];
const dedup = /* @__PURE__ */ new Set();
let injectorTypesWithProviders;
const collectProviders = (provider) => {
providersOut.push(provider);
};
deepForEach(sources, (source) => {
if ((typeof ngDevMode === "undefined" || ngDevMode) && checkForStandaloneCmp) {
const cmpDef = getComponentDef(source);
if (cmpDef?.standalone) {
throw new RuntimeError(800, `Importing providers supports NgModule or ModuleWithProviders but got a standalone component "${stringifyForError(source)}"`);
}
}
const internalSource = source;
if (walkProviderTree(internalSource, collectProviders, [], dedup)) {
injectorTypesWithProviders ||= [];
injectorTypesWithProviders.push(internalSource);
}
});
if (injectorTypesWithProviders !== void 0) {
processInjectorTypesWithProviders(injectorTypesWithProviders, collectProviders);
}
return providersOut;
}
function processInjectorTypesWithProviders(typesWithProviders, visitor) {
for (let i = 0; i < typesWithProviders.length; i++) {
const { ngModule, providers } = typesWithProviders[i];
deepForEachProvider(providers, (provider) => {
ngDevMode && validateProvider(provider, providers || EMPTY_ARRAY, ngModule);
visitor(provider, ngModule);
});
}
}
function walkProviderTree(container, visitor, parents, dedup) {
container = resolveForwardRef(container);
if (!container)
return false;
let defType = null;
let injDef = getInjectorDef(container);
const cmpDef = !injDef && getComponentDef(container);
if (!injDef && !cmpDef) {
const ngModule = container.ngModule;
injDef = getInjectorDef(ngModule);
if (injDef) {
defType = ngModule;
} else {
return false;
}
} else if (cmpDef && !cmpDef.standalone) {
return false;
} else {
defType = container;
}
if (ngDevMode && parents.indexOf(defType) !== -1) {
const defName = stringify(defType);
const path = parents.map(stringify).concat(defName);
throw cyclicDependencyErrorWithDetails(defName, path);
}
const isDuplicate = dedup.has(defType);
if (cmpDef) {
if (isDuplicate) {
return false;
}
dedup.add(defType);
if (cmpDef.dependencies) {
const deps = typeof cmpDef.dependencies === "function" ? cmpDef.dependencies() : cmpDef.dependencies;
for (const dep of deps) {
walkProviderTree(dep, visitor, parents, dedup);
}
}
} else if (injDef) {
if (injDef.imports != null && !isDuplicate) {
ngDevMode && parents.push(defType);
dedup.add(defType);
let importTypesWithProviders;
try {
deepForEach(injDef.imports, (imported) => {
if (walkProviderTree(imported, visitor, parents, dedup)) {
importTypesWithProviders ||= [];
importTypesWithProviders.push(imported);
}
});
} finally {
ngDevMode && parents.pop();
}
if (importTypesWithProviders !== void 0) {
processInjectorTypesWithProviders(importTypesWithProviders, visitor);
}
}
if (!isDuplicate) {
const factory = getFactoryDef(defType) || (() => new defType());
visitor({ provide: defType, useFactory: factory, deps: EMPTY_ARRAY }, defType);
visitor({ provide: INJECTOR_DEF_TYPES, useValue: defType, multi: true }, defType);
visitor({ provide: ENVIRONMENT_INITIALIZER, useValue: () => \u0275\u0275inject(defType), multi: true }, defType);
}
const defProviders = injDef.providers;
if (defProviders != null && !isDuplicate) {
const injectorType = container;
deepForEachProvider(defProviders, (provider) => {
ngDevMode && validateProvider(provider, defProviders, injectorType);
visitor(provider, injectorType);
});
}
} else {
return false;
}
return defType !== container && container.providers !== void 0;
}
function validateProvider(provider, providers, containerType) {
if (isTypeProvider(provider) || isValueProvider(provider) || isFactoryProvider(provider) || isExistingProvider(provider)) {
return;
}
const classRef = resolveForwardRef(provider && (provider.useClass || provider.provide));
if (!classRef) {
throwInvalidProviderError(containerType, providers, provider);
}
}
function deepForEachProvider(providers, fn) {
for (let provider of providers) {
if (isEnvironmentProviders(provider)) {
provider = provider.\u0275providers;
}
if (Array.isArray(provider)) {
deepForEachProvider(provider, fn);
} else {
fn(provider);
}
}
}
var USE_VALUE = getClosureSafeProperty({
provide: String,
useValue: getClosureSafeProperty
});
function isValueProvider(value) {
return value !== null && typeof value == "object" && USE_VALUE in value;
}
function isExistingProvider(value) {
return !!(value && value.useExisting);
}
function isFactoryProvider(value) {
return !!(value && value.useFactory);
}
function isTypeProvider(value) {
return typeof value === "function";
}
function isClassProvider(value) {
return !!value.useClass;
}
var INJECTOR_SCOPE = new InjectionToken(ngDevMode ? "Set Injector scope." : "");
var NOT_YET = {};
var CIRCULAR = {};
var NULL_INJECTOR = void 0;
function getNullInjector() {
if (NULL_INJECTOR === void 0) {
NULL_INJECTOR = new NullInjector();
}
return NULL_INJECTOR;
}
var EnvironmentInjector = class {
};
var R3Injector = class extends EnvironmentInjector {
parent;
source;
scopes;
/**
* Map of tokens to records which contain the instances of those tokens.
* - `null` value implies that we don't have the record. Used by tree-shakable injectors
* to prevent further searches.
*/
records = /* @__PURE__ */ new Map();
/**
* Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.
*/
_ngOnDestroyHooks = /* @__PURE__ */ new Set();
_onDestroyHooks = [];
/**
* Flag indicating that this injector was previously destroyed.
*/
get destroyed() {
return this._destroyed;
}
_destroyed = false;
injectorDefTypes;
constructor(providers, parent, source, scopes) {
super();
this.parent = parent;
this.source = source;
this.scopes = scopes;
forEachSingleProvider(providers, (provider) => this.processProvider(provider));
this.records.set(INJECTOR$1, makeRecord(void 0, this));
if (scopes.has("environment")) {
this.records.set(EnvironmentInjector, makeRecord(void 0, this));
}
const record = this.records.get(INJECTOR_SCOPE);
if (record != null && typeof record.value === "string") {
this.scopes.add(record.value);
}
this.injectorDefTypes = new Set(this.get(INJECTOR_DEF_TYPES, EMPTY_ARRAY, { self: true }));
}
retrieve(token, options) {
const flags = convertToBitFlags(options) || 0;
try {
return this.get(
token,
// When a dependency is requested with an optional flag, DI returns null as the default value.
THROW_IF_NOT_FOUND,
flags
);
} catch (e) {
if (isNotFound(e)) {
return e;
}
throw e;
}
}
/**
* Destroy the injector and release references to every instance or provider associated with it.
*
* Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a
* hook was found.
*/
destroy() {
assertNotDestroyed(this);
this._destroyed = true;
const prevConsumer = setActiveConsumer(null);
try {
for (const service of this._ngOnDestroyHooks) {
service.ngOnDestroy();
}
const onDestroyHooks = this._onDestroyHooks;
this._onDestroyHooks = [];
for (const hook of onDestroyHooks) {
hook();
}
} finally {
this.records.clear();
this._ngOnDestroyHooks.clear();
this.injectorDefTypes.clear();
setActiveConsumer(prevConsumer);
}
}
onDestroy(callback) {
assertNotDestroyed(this);
this._onDestroyHooks.push(callback);
return () => this.removeOnDestroy(callback);
}
runInContext(fn) {
assertNotDestroyed(this);
const previousInjector = setCurrentInjector(this);
const previousInjectImplementation = setInjectImplementation(void 0);
let prevInjectContext;
if (ngDevMode) {
prevInjectContext = setInjectorProfilerContext({ injector: this, token: null });
}
try {
return fn();
} finally {
setCurrentInjector(previousInjector);
setInjectImplementation(previousInjectImplementation);
ngDevMode && setInjectorProfilerContext(prevInjectContext);
}
}
get(token, notFoundValue = THROW_IF_NOT_FOUND, options) {
assertNotDestroyed(this);
if (token.hasOwnProperty(NG_ENV_ID)) {
return token[NG_ENV_ID](this);
}
const flags = convertToBitFlags(options);
let prevInjectContext;
if (ngDevMode) {
prevInjectContext = setInjectorProfilerContext({ injector: this, token });
}
const previousInjector = setCurrentInjector(this);
const previousInjectImplementation = setInjectImplementation(void 0);
try {
if (!(flags & 4)) {
let record = this.records.get(token);
if (record === void 0) {
const def = couldBeInjectableType(token) && getInjectableDef(token);
if (def && this.injectableDefInScope(def)) {
if (ngDevMode) {
runInInjectorProfilerContext(this, token, () => {
emitProviderConfiguredEvent(token);
});
}
record = makeRecord(injectableDefOrInjectorDefFactory(token), NOT_YET);
} else {
record = null;
}
this.records.set(token, record);
}
if (record != null) {
return this.hydrate(token, record, flags);
}
}
const nextInjector = !(flags & 2) ? this.parent : getNullInjector();
notFoundValue = flags & 8 && notFoundValue === THROW_IF_NOT_FOUND ? null : notFoundValue;
return nextInjector.get(token, notFoundValue);
} catch (error) {
const errorCode = getRuntimeErrorCode(error);
if (errorCode === -200 || errorCode === -201) {
if (!ngDevMode) {
throw new RuntimeError(errorCode, null);
}
prependTokenToDependencyPath(error, token);
if (previousInjector) {
throw error;
} else {
throw augmentRuntimeError(error, this.source);
}
} else {
throw error;
}
} finally {
setInjectImplementation(previousInjectImplementation);
setCurrentInjector(previousInjector);
ngDevMode && setInjectorProfilerContext(prevInjectContext);
}
}
/** @internal */
resolveInjectorInitializers() {
const prevConsumer = setActiveConsumer(null);
const previousInjector = setCurrentInjector(this);
const previousInjectImplementation = setInjectImplementation(void 0);
let prevInjectContext;
if (ngDevMode) {
prevInjectContext = setInjectorProfilerContext({ injector: this, token: null });
}
try {
const initializers = this.get(ENVIRONMENT_INITIALIZER, EMPTY_ARRAY, { self: true });
if (ngDevMode && !Array.isArray(initializers)) {
throw new RuntimeError(-209, `Unexpected type of the \`ENVIRONMENT_INITIALIZER\` token value (expected an array, but got ${typeof initializers}). Please check that the \`ENVIRONMENT_INITIALIZER\` token is configured as a \`multi: true\` provider.`);
}
for (const initializer of initializers) {
initializer();
}
} finally {
setCurrentInjector(previousInjector);
setInjectImplementation(previousInjectImplementation);
ngDevMode && setInjectorProfilerContext(prevInjectContext);
setActiveConsumer(prevConsumer);
}
}
toString() {
const tokens = [];
const records = this.records;
for (const token of records.keys()) {
tokens.push(stringify(token));
}
return `R3Injector[${tokens.join(", ")}]`;
}
/**
* Process a `SingleProvider` and add it.
*/
processProvider(provider) {
provider = resolveForwardRef(provider);
let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);
const record = providerToRecord(provider);
if (ngDevMode) {
runInInjectorProfilerContext(this, token, () => {
if (isValueProvider(provider)) {
emitInjectorToCreateInstanceEvent(token);
emitInstanceCreatedByInjectorEvent(provider.useValue);
}
emitProviderConfiguredEvent(provider);
});
}
if (!isTypeProvider(provider) && provider.multi === true) {
let multiRecord = this.records.get(token);
if (multiRecord) {
if (ngDevMode && multiRecord.multi === void 0) {
throwMixedMultiProviderError();
}
} else {
multiRecord = makeRecord(void 0, NOT_YET, true);
multiRecord.factory = () => injectArgs(multiRecord.multi);
this.records.set(token, multiRecord);
}
token = provider;
multiRecord.multi.push(provider);
} else {
if (ngDevMode) {
const existing = this.records.get(token);
if (existing && existing.multi !== void 0) {
throwMixedMultiProviderError();
}
}
}
this.records.set(token, record);
}
hydrate(token, record, flags) {
const prevConsumer = setActiveConsumer(null);
try {
if (record.value === CIRCULAR) {
throw cyclicDependencyError(stringify(token));
} else if (record.value === NOT_YET) {
record.value = CIRCULAR;
if (ngDevMode) {
runInInjectorProfilerContext(this, token, () => {
emitInjectorToCreateInstanceEvent(token);
record.value = record.factory(void 0, flags);
emitInstanceCreatedByInjectorEvent(record.value);
});
} else {
record.value = record.factory(void 0, flags);
}
}
if (typeof record.value === "object" && record.value && hasOnDestroy(record.value)) {
this._ngOnDestroyHooks.add(record.value);
}
return record.value;
} finally {
setActiveConsumer(prevConsumer);
}
}
injectableDefInScope(def) {
if (!def.providedIn) {
return false;
}
const providedIn = resolveForwardRef(def.providedIn);
if (typeof providedIn === "string") {
return providedIn === "any" || this.scopes.has(providedIn);
} else {
return this.injectorDefTypes.has(providedIn);
}
}
removeOnDestroy(callback) {
const destroyCBIdx = this._onDestroyHooks.indexOf(callback);
if (destroyCBIdx !== -1) {
this._onDestroyHooks.splice(destroyCBIdx, 1);
}
}
};
function injectableDefOrInjectorDefFactory(token) {
const injectableDef = getInjectableDef(token);
const factory = injectableDef !== null ? injectableDef.factory : getFactoryDef(token);
if (factory !== null) {
return factory;
}
if (token instanceof InjectionToken) {
throw new RuntimeError(204, ngDevMode && `Token ${stringify(token)} is missing a \u0275prov definition.`);
}
if (token instanceof Function) {
return getUndecoratedInjectableFactory(token);
}
throw new RuntimeError(204, ngDevMode && "unreachable");
}
function getUndecoratedInjectableFactory(token) {
const paramLength = token.length;
if (paramLength > 0) {
throw new RuntimeError(204, ngDevMode && `Can't resolve all parameters for ${stringify(token)}: (${newArray(paramLength, "?").join(", ")}).`);
}
const inheritedInjectableDef = getInheritedInjectableDef(token);
if (inheritedInjectableDef !== null) {
return () => inheritedInjectableDef.factory(token);
} else {
return () => new token();
}
}
function providerToRecord(provider) {
if (isValueProvider(provider)) {
return makeRecord(void 0, provider.useValue);
} else {
const factory = providerToFactory(provider);
return makeRecord(factory, NOT_YET);
}
}
function providerToFactory(provider, ngModuleType, providers) {
let factory = void 0;
if (ngDevMode && isEnvironmentProviders(provider)) {
throwInvalidProviderError(void 0, providers, provider);
}
if (isTypeProvider(provider)) {
const unwrappedProvider = resolveForwardRef(provider);
return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);
} else {
if (isValueProvider(provider)) {
factory = () => resolveForwardRef(provider.useValue);
} else if (isFactoryProvider(provider)) {
factory = () => provider.useFactory(...injectArgs(provider.deps || []));
} else if (isExistingProvider(provider)) {
factory = (_, flags) => \u0275\u0275inject(resolveForwardRef(provider.useExisting), flags !== void 0 && flags & 8 ? 8 : void 0);
} else {
const classRef = resolveForwardRef(provider && (provider.useClass || provider.provide));
if (ngDevMode && !classRef) {
throwInvalidProviderError(ngModuleType, providers, provider);
}
if (hasDeps(provider)) {
factory = () => new classRef(...injectArgs(provider.deps));
} else {
return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef);
}
}
}
return factory;
}
function assertNotDestroyed(injector) {
if (injector.destroyed) {
throw new RuntimeError(205, ngDevMode && "Injector has already been destroyed.");
}
}
function makeRecord(factory, value, multi = false) {
return {
factory,
value,
multi: multi ? [] : void 0
};
}
function hasDeps(value) {
return !!value.deps;
}
function hasOnDestroy(value) {
return value !== null && typeof value === "object" && typeof value.ngOnDestroy === "function";
}
function couldBeInjectableType(value) {
return typeof value === "function" || typeof value === "object" && value.ngMetadataName === "InjectionToken";
}
function forEachSingleProvider(providers, fn) {
for (const provider of providers) {
if (Array.isArray(provider)) {
forEachSingleProvider(provider, fn);
} else if (provider && isEnvironmentProviders(provider)) {
forEachSingleProvider(provider.\u0275providers, fn);
} else {
fn(provider);
}
}
}
function runInInjectionContext(injector, fn) {
let internalInjector;
if (injector instanceof R3Injector) {
assertNotDestroyed(injector);
internalInjector = injector;
} else {
internalInjector = new RetrievingInjector(injector);
}
let prevInjectorProfilerContext;
if (ngDevMode) {
prevInjectorProfilerContext = setInjectorProfilerContext({ injector, token: null });
}
const prevInjector = setCurrentInjector(internalInjector);
const previousInjectImplementation = setInjectImplementation(void 0);
try {
return fn();
} finally {
setCurrentInjector(prevInjector);
ngDevMode && setInjectorProfilerContext(prevInjectorProfilerContext);
setInjectImplementation(previousInjectImplementation);
}
}
function isInInjectionContext() {
return getInjectImplementation() !== void 0 || getCurrentInjector() != null;
}
function assertInInjectionContext(debugFn) {
if (!isInInjectionContext()) {
throw new RuntimeError(-203, ngDevMode && debugFn.name + "() can only be used within an injection context such as a constructor, a factory function, a field initializer, or a function used with `runInInjectionContext`");
}
}
var HOST = 0;
var TVIEW = 1;
var FLAGS = 2;
var PARENT = 3;
var NEXT = 4;
var T_HOST = 5;
var HYDRATION = 6;
var CLEANUP = 7;
var CONTEXT = 8;
var INJECTOR = 9;
var ENVIRONMENT = 10;
var RENDERER = 11;
var CHILD_HEAD = 12;
var CHILD_TAIL = 13;
var DECLARATION_VIEW = 14;
var DECLARATION_COMPONENT_VIEW = 15;
var DECLARATION_LCONTAINER = 16;
var PREORDER_HOOK_FLAGS = 17;
var QUERIES = 18;
var ID = 19;
var EMBEDDED_VIEW_INJECTOR = 20;
var ON_DESTROY_HOOKS = 21;
var EFFECTS_TO_SCHEDULE = 22;
var EFFECTS = 23;
var REACTIVE_TEMPLATE_CONSUMER = 24;
var AFTER_RENDER_SEQUENCES_TO_ADD = 25;
var HEADER_OFFSET = 26;
var TYPE = 1;
var DEHYDRATED_VIEWS = 6;
var NATIVE = 7;
var VIEW_REFS = 8;
var MOVED_VIEWS = 9;
var CONTAINER_HEADER_OFFSET = 10;
function isLView(value) {
return Array.isArray(value) && typeof value[TYPE] === "object";
}
function isLContainer(value) {
return Array.isArray(value) && value[TYPE] === true;
}
function isContentQueryHost(tNode) {
return (tNode.flags & 4) !== 0;
}
function isComponentHost(tNode) {
return tNode.componentOffset > -1;
}
function isDirectiveHost(tNode) {
return (tNode.flags & 1) === 1;
}
function isComponentDef(def) {
return !!def.template;
}
function isRootView(target) {
return (target[FLAGS] & 512) !== 0;
}
function isDestroyed(lView) {
return (lView[FLAGS] & 256) === 256;
}
function assertTNodeForLView(tNode, lView) {
assertTNodeForTView(tNode, lView[TVIEW]);
}
function assertTNodeCreationIndex(lView, index) {
const adjustedIndex = index + HEADER_OFFSET;
assertIndexInRange(lView, adjustedIndex);
assertLessThan(adjustedIndex, lView[TVIEW].bindingStartIndex, "TNodes should be created before any bindings");
}
function assertTNodeForTView(tNode, tView) {
assertTNode(tNode);
const tData = tView.data;
for (let i = HEADER_OFFSET; i < tData.length; i++) {
if (tData[i] === tNode) {
return;
}
}
throwError2("This TNode does not belong to this TView.");
}
function assertTNode(tNode) {
assertDefined(tNode, "TNode must be defined");
if (!(tNode && typeof tNode === "object" && tNode.hasOwnProperty("directiveStylingLast"))) {
throwError2("Not of type TNode, got: " + tNode);
}
}
function assertTIcu(tIcu) {
assertDefined(tIcu, "Expected TIcu to be defined");
if (!(typeof tIcu.currentCaseLViewIndex === "number")) {
throwError2("Object is not of TIcu type.");
}
}
function assertComponentType(actual, msg = "Type passed in is not ComponentType, it does not have '\u0275cmp' property.") {
if (!getComponentDef(actual)) {
throwError2(msg);
}
}
function assertNgModuleType(actual, msg = "Type passed in is not NgModuleType, it does not have '\u0275mod' property.") {
if (!getNgModuleDef(actual)) {
throwError2(msg);
}
}
function assertHasParent(tNode) {
assertDefined(tNode, "currentTNode should exist!");
assertDefined(tNode.parent, "currentTNode should have a parent");
}
function assertLContainer(value) {
assertDefined(value, "LContainer must be defined");
assertEqual(isLContainer(value), true, "Expecting LContainer");
}
function assertLViewOrUndefined(value) {
value && assertEqual(isLView(value), true, "Expecting LView or undefined or null");
}
function assertLView(value) {
assertDefined(value, "LView must be defined");
assertEqual(isLView(value), true, "Expecting LView");
}
function assertFirstCreatePass(tView, errMessage) {
assertEqual(tView.firstCreatePass, true, errMessage || "Should only be called in first create pass.");
}
function assertFirstUpdatePass(tView, errMessage) {
assertEqual(tView.firstUpdatePass, true, "Should only be called in first update pass.");
}
function assertDirectiveDef(obj) {
if (obj.type === void 0 || obj.selectors == void 0 || obj.inputs === void 0) {
throwError2(`Expected a DirectiveDef/ComponentDef and this object does not seem to have the expected shape.`);
}
}
function assertIndexInDeclRange(tView, index) {
assertBetween(HEADER_OFFSET, tView.bindingStartIndex, index);
}
function assertIndexInExpandoRange(lView, index) {
const tView = lView[1];
assertBetween(tView.expandoStartIndex, lView.length, index);
}
function assertBetween(lower, upper, index) {
if (!(lower <= index && index < upper)) {
throwError2(`Index out of range (expecting ${lower} <= ${index} < ${upper})`);
}
}
function assertProjectionSlots(lView, errMessage) {
assertDefined(lView[DECLARATION_COMPONENT_VIEW], "Component views should exist.");
assertDefined(lView[DECLARATION_COMPONENT_VIEW][T_HOST].projection, "Components with projection nodes (<ng-content>) must have projection slots defined.");
}
function assertParentView(lView, errMessage) {
assertDefined(lView, "Component views should always have a parent view (component's host view)");
}
function assertNodeInjector(lView, injectorIndex) {
assertIndexInExpandoRange(lView, injectorIndex);
assertIndexInExpandoRange(
lView,
injectorIndex + 8
/* NodeInjectorOffset.PARENT */
);
assertNumber(lView[injectorIndex + 0], "injectorIndex should point to a bloom filter");
assertNumber(lView[injectorIndex + 1], "injectorIndex should point to a bloom filter");
assertNumber(lView[injectorIndex + 2], "injectorIndex should point to a bloom filter");
assertNumber(lView[injectorIndex + 3], "injectorIndex should point to a bloom filter");
assertNumber(lView[injectorIndex + 4], "injectorIndex should point to a bloom filter");
assertNumber(lView[injectorIndex + 5], "injectorIndex should point to a bloom filter");
assertNumber(lView[injectorIndex + 6], "injectorIndex should point to a bloom filter");
assertNumber(lView[injectorIndex + 7], "injectorIndex should point to a bloom filter");
assertNumber(lView[
injectorIndex + 8
/* NodeInjectorOffset.PARENT */
], "injectorIndex should point to parent injector");
}
var SVG_NAMESPACE = "svg";
var MATH_ML_NAMESPACE = "math";
function unwrapRNode(value) {
while (Array.isArray(value)) {
value = value[HOST];
}
return value;
}
function unwrapLView(value) {
while (Array.isArray(value)) {
if (typeof value[TYPE] === "object")
return value;
value = value[HOST];
}
return null;
}
function getNativeByIndex(index, lView) {
ngDevMode && assertIndexInRange(lView, index);
ngDevMode && assertGreaterThanOrEqual(index, HEADER_OFFSET, "Expected to be past HEADER_OFFSET");
return unwrapRNode(lView[index]);
}
function getNativeByTNode(tNode, lView) {
ngDevMode && assertTNodeForLView(tNode, lView);
ngDevMode && assertIndexInRange(lView, tNode.index);
const node = unwrapRNode(lView[tNode.index]);
return node;
}
function getTNode(tView, index) {
ngDevMode && assertGreaterThan(index, -1, "wrong index for TNode");
ngDevMode && assertLessThan(index, tView.data.length, "wrong index for TNode");
const tNode = tView.data[index];
ngDevMode && tNode !== null && assertTNode(tNode);
return tNode;
}
function load(view, index) {
ngDevMode && assertIndexInRange(view, index);
return view[index];
}
function store(tView, lView, index, value) {
if (index >= tView.data.length) {
tView.data[index] = null;
tView.blueprint[index] = null;
}
lView[index] = value;
}
function getComponentLViewByIndex(nodeIndex, hostView) {
ngDevMode && assertIndexInRange(hostView, nodeIndex);
const slotValue = hostView[nodeIndex];
const lView = isLView(slotValue) ? slotValue : slotValue[HOST];
return lView;
}
function isCreationMode(view) {
return (view[FLAGS] & 4) === 4;
}
function viewAttachedToChangeDetector(view) {
return (view[FLAGS] & 128) === 128;
}
function viewAttachedToContainer(view) {
return isLContainer(view[PARENT]);
}
function getConstant(consts, index) {
if (index === null || index === void 0)
return null;
ngDevMode && assertIndexInRange(consts, index);
return consts[index];
}
function resetPreOrderHookFlags(lView) {
lView[PREORDER_HOOK_FLAGS] = 0;
}
function markViewForRefresh(lView) {
if (lView[FLAGS] & 1024) {
return;
}
lView[FLAGS] |= 1024;
if (viewAttachedToChangeDetector(lView)) {
markAncestorsForTraversal(lView);
}
}
function walkUpViews(nestingLevel, currentView) {
while (nestingLevel > 0) {
ngDevMode && assertDefined(currentView[DECLARATION_VIEW], "Declaration view should be defined if nesting level is greater than 0.");
currentView = currentView[DECLARATION_VIEW];
nestingLevel--;
}
return currentView;
}
function requiresRefreshOrTraversal(lView) {
return !!(lView[FLAGS] & (1024 | 8192) || lView[REACTIVE_TEMPLATE_CONSUMER]?.dirty);
}
function updateAncestorTraversalFlagsOnAttach(lView) {
lView[ENVIRONMENT].changeDetectionScheduler?.notify(
8
/* NotificationSource.ViewAttached */
);
if (lView[FLAGS] & 64) {
lView[FLAGS] |= 1024;
}
if (requiresRefreshOrTraversal(lView)) {
markAncestorsForTraversal(lView);
}
}
function markAncestorsForTraversal(lView) {
lView[ENVIRONMENT].changeDetectionScheduler?.notify(
0
/* NotificationSource.MarkAncestorsForTraversal */
);
let parent = getLViewParent(lView);
while (parent !== null) {
if (parent[FLAGS] & 8192) {
break;
}
parent[FLAGS] |= 8192;
if (!viewAttachedToChangeDetector(parent)) {
break;
}
parent = getLViewParent(parent);
}
}
function storeLViewOnDestroy(lView, onDestroyCallback) {
if (isDestroyed(lView)) {
throw new RuntimeError(911, ngDevMode && "View has already been destroyed.");
}
if (lView[ON_DESTROY_HOOKS] === null) {
lView[ON_DESTROY_HOOKS] = [];
}
lView[ON_DESTROY_HOOKS].push(onDestroyCallback);
}
function removeLViewOnDestroy(lView, onDestroyCallback) {
if (lView[ON_DESTROY_HOOKS] === null)
return;
const destroyCBIdx = lView[ON_DESTROY_HOOKS].indexOf(onDestroyCallback);
if (destroyCBIdx !== -1) {
lView[ON_DESTROY_HOOKS].splice(destroyCBIdx, 1);
}
}
function getLViewParent(lView) {
ngDevMode && assertLView(lView);
const parent = lView[PARENT];
return isLContainer(parent) ? parent[PARENT] : parent;
}
function getOrCreateLViewCleanup(view) {
return view[CLEANUP] ??= [];
}
function getOrCreateTViewCleanup(tView) {
return tView.cleanup ??= [];
}
function storeCleanupWithContext(tView, lView, context2, cleanupFn) {
const lCleanup = getOrCreateLViewCleanup(lView);
ngDevMode && assertDefined(context2, "Cleanup context is mandatory when registering framework-level destroy hooks");
lCleanup.push(context2);
if (tView.firstCreatePass) {
getOrCreateTViewCleanup(tView).push(cleanupFn, lCleanup.length - 1);
} else {
if (ngDevMode) {
Object.freeze(getOrCreateTViewCleanup(tView));
}
}
}
var instructionState = {
lFrame: createLFrame(null),
bindingsEnabled: true,
skipHydrationRootTNode: null
};
var CheckNoChangesMode;
(function(CheckNoChangesMode2) {
CheckNoChangesMode2[CheckNoChangesMode2["Off"] = 0] = "Off";
CheckNoChangesMode2[CheckNoChangesMode2["Exhaustive"] = 1] = "Exhaustive";
CheckNoChangesMode2[CheckNoChangesMode2["OnlyDirtyViews"] = 2] = "OnlyDirtyViews";
})(CheckNoChangesMode || (CheckNoChangesMode = {}));
var _checkNoChangesMode = 0;
var _isRefreshingViews = false;
function getElementDepthCount() {
return instructionState.lFrame.elementDepthCount;
}
function increaseElementDepthCount() {
instructionState.lFrame.elementDepthCount++;
}
function decreaseElementDepthCount() {
instructionState.lFrame.elementDepthCount--;
}
function getBindingsEnabled() {
return instructionState.bindingsEnabled;
}
function isInSkipHydrationBlock() {
return instructionState.skipHydrationRootTNode !== null;
}
function isSkipHydrationRootTNode(tNode) {
return instructionState.skipHydrationRootTNode === tNode;
}
function \u0275\u0275enableBindings() {
instructionState.bindingsEnabled = true;
}
function \u0275\u0275disableBindings() {
instructionState.bindingsEnabled = false;
}
function leaveSkipHydrationBlock() {
instructionState.skipHydrationRootTNode = null;
}
function getLView() {
return instructionState.lFrame.lView;
}
function getTView() {
return instructionState.lFrame.tView;
}
function \u0275\u0275restoreView(viewToRestore) {
instructionState.lFrame.contextLView = viewToRestore;
return viewToRestore[CONTEXT];
}
function \u0275\u0275resetView(value) {
instructionState.lFrame.contextLView = null;
return value;
}
function getCurrentTNode() {
let currentTNode = getCurrentTNodePlaceholderOk();
while (currentTNode !== null && currentTNode.type === 64) {
currentTNode = currentTNode.parent;
}
return currentTNode;
}
function getCurrentTNodePlaceholderOk() {
return instructionState.lFrame.currentTNode;
}
function getCurrentParentTNode() {
const lFrame = instructionState.lFrame;
const currentTNode = lFrame.currentTNode;
return lFrame.isParent ? currentTNode : currentTNode.parent;
}
function setCurrentTNode(tNode, isParent) {
ngDevMode && tNode && assertTNodeForTView(tNode, instructionState.lFrame.tView);
const lFrame = instructionState.lFrame;
lFrame.currentTNode = tNode;
lFrame.isParent = isParent;
}
function isCurrentTNodeParent() {
return instructionState.lFrame.isParent;
}
function setCurrentTNodeAsNotParent() {
instructionState.lFrame.isParent = false;
}
function getContextLView() {
const contextLView = instructionState.lFrame.contextLView;
ngDevMode && assertDefined(contextLView, "contextLView must be defined.");
return contextLView;
}
function isInCheckNoChangesMode() {
!ngDevMode && throwError2("Must never be called in production mode");
return _checkNoChangesMode !== CheckNoChangesMode.Off;
}
function isExhaustiveCheckNoChanges() {
!ngDevMode && throwError2("Must never be called in production mode");
return _checkNoChangesMode === CheckNoChangesMode.Exhaustive;
}
function setIsInCheckNoChangesMode(mode) {
!ngDevMode && throwError2("Must never be called in production mode");
_checkNoChangesMode = mode;
}
function isRefreshingViews() {
return _isRefreshingViews;
}
function setIsRefreshingViews(mode) {
const prev = _isRefreshingViews;
_isRefreshingViews = mode;
return prev;
}
function getBindingRoot() {
const lFrame = instructionState.lFrame;
let index = lFrame.bindingRootIndex;
if (index === -1) {
index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;
}
return index;
}
function getBindingIndex() {
return instructionState.lFrame.bindingIndex;
}
function setBindingIndex(value) {
return instructionState.lFrame.bindingIndex = value;
}
function nextBindingIndex() {
return instructionState.lFrame.bindingIndex++;
}
function incrementBindingIndex(count) {
const lFrame = instructionState.lFrame;
const index = lFrame.bindingIndex;
lFrame.bindingIndex = lFrame.bindingIndex + count;
return index;
}
function isInI18nBlock() {
return instructionState.lFrame.inI18n;
}
function setInI18nBlock(isInI18nBlock2) {
instructionState.lFrame.inI18n = isInI18nBlock2;
}
function setBindingRootForHostBindings(bindingRootIndex, currentDirectiveIndex) {
const lFrame = instructionState.lFrame;
lFrame.bindingIndex = lFrame.bindingRootIndex = bindingRootIndex;
setCurrentDirectiveIndex(currentDirectiveIndex);
}
function getCurrentDirectiveIndex() {
return instructionState.lFrame.currentDirectiveIndex;
}
function setCurrentDirectiveIndex(currentDirectiveIndex) {
instructionState.lFrame.currentDirectiveIndex = currentDirectiveIndex;
}
function getCurrentDirectiveDef(tData) {
const currentDirectiveIndex = instructionState.lFrame.currentDirectiveIndex;
return currentDirectiveIndex === -1 ? null : tData[currentDirectiveIndex];
}
function getCurrentQueryIndex() {
return instructionState.lFrame.currentQueryIndex;
}
function setCurrentQueryIndex(value) {
instructionState.lFrame.currentQueryIndex = value;
}
function getDeclarationTNode(lView) {
const tView = lView[TVIEW];
if (tView.type === 2) {
ngDevMode && assertDefined(tView.declTNode, "Embedded TNodes should have declaration parents.");
return tView.declTNode;
}
if (tView.type === 1) {
return lView[T_HOST];
}
return null;
}
function enterDI(lView, tNode, flags) {
ngDevMode && assertLViewOrUndefined(lView);
if (flags & 4) {
ngDevMode && assertTNodeForTView(tNode, lView[TVIEW]);
let parentTNode = tNode;
let parentLView = lView;
while (true) {
ngDevMode && assertDefined(parentTNode, "Parent TNode should be defined");
parentTNode = parentTNode.parent;
if (parentTNode === null && !(flags & 1)) {
parentTNode = getDeclarationTNode(parentLView);
if (parentTNode === null)
break;
ngDevMode && assertDefined(parentLView, "Parent LView should be defined");
parentLView = parentLView[DECLARATION_VIEW];
if (parentTNode.type & (2 | 8)) {
break;
}
} else {
break;
}
}
if (parentTNode === null) {
return false;
} else {
tNode = parentTNode;
lView = parentLView;
}
}
ngDevMode && assertTNodeForLView(tNode, lView);
const lFrame = instructionState.lFrame = allocLFrame();
lFrame.currentTNode = tNode;
lFrame.lView = lView;
return true;
}
function enterView(newView) {
ngDevMode && assertNotEqual(newView[0], newView[1], "????");
ngDevMode && assertLViewOrUndefined(newView);
const newLFrame = allocLFrame();
if (ngDevMode) {
assertEqual(newLFrame.isParent, true, "Expected clean LFrame");
assertEqual(newLFrame.lView, null, "Expected clean LFrame");
assertEqual(newLFrame.tView, null, "Expected clean LFrame");
assertEqual(newLFrame.selectedIndex, -1, "Expected clean LFrame");
assertEqual(newLFrame.elementDepthCount, 0, "Expected clean LFrame");
assertEqual(newLFrame.currentDirectiveIndex, -1, "Expected clean LFrame");
assertEqual(newLFrame.currentNamespace, null, "Expected clean LFrame");
assertEqual(newLFrame.bindingRootIndex, -1, "Expected clean LFrame");
assertEqual(newLFrame.currentQueryIndex, 0, "Expected clean LFrame");
}
const tView = newView[TVIEW];
instructionState.lFrame = newLFrame;
ngDevMode && tView.firstChild && assertTNodeForTView(tView.firstChild, tView);
newLFrame.currentTNode = tView.firstChild;
newLFrame.lView = newView;
newLFrame.tView = tView;
newLFrame.contextLView = newView;
newLFrame.bindingIndex = tView.bindingStartIndex;
newLFrame.inI18n = false;
}
function allocLFrame() {
const currentLFrame = instructionState.lFrame;
const childLFrame = currentLFrame === null ? null : currentLFrame.child;
const newLFrame = childLFrame === null ? createLFrame(currentLFrame) : childLFrame;
return newLFrame;
}
function createLFrame(parent) {
const lFrame = {
currentTNode: null,
isParent: true,
lView: null,
tView: null,
selectedIndex: -1,
contextLView: null,
elementDepthCount: 0,
currentNamespace: null,
currentDirectiveIndex: -1,
bindingRootIndex: -1,
bindingIndex: -1,
currentQueryIndex: 0,
parent,
child: null,
inI18n: false
};
parent !== null && (parent.child = lFrame);
return lFrame;
}
function leaveViewLight() {
const oldLFrame = instructionState.lFrame;
instructionState.lFrame = oldLFrame.parent;
oldLFrame.currentTNode = null;
oldLFrame.lView = null;
return oldLFrame;
}
var leaveDI = leaveViewLight;
function leaveView() {
const oldLFrame = leaveViewLight();
oldLFrame.isParent = true;
oldLFrame.tView = null;
oldLFrame.selectedIndex = -1;
oldLFrame.contextLView = null;
oldLFrame.elementDepthCount = 0;
oldLFrame.currentDirectiveIndex = -1;
oldLFrame.currentNamespace = null;
oldLFrame.bindingRootIndex = -1;
oldLFrame.bindingIndex = -1;
oldLFrame.currentQueryIndex = 0;
}
function nextContextImpl(level) {
const contextLView = instructionState.lFrame.contextLView = walkUpViews(level, instructionState.lFrame.contextLView);
return contextLView[CONTEXT];
}
function getSelectedIndex() {
return instructionState.lFrame.selectedIndex;
}
function setSelectedIndex(index) {
ngDevMode && index !== -1 && assertGreaterThanOrEqual(index, HEADER_OFFSET, "Index must be past HEADER_OFFSET (or -1).");
ngDevMode && assertLessThan(index, instructionState.lFrame.lView.length, "Can't set index passed end of LView");
instructionState.lFrame.selectedIndex = index;
}
function getSelectedTNode() {
const lFrame = instructionState.lFrame;
return getTNode(lFrame.tView, lFrame.selectedIndex);
}
function \u0275\u0275namespaceSVG() {
instructionState.lFrame.currentNamespace = SVG_NAMESPACE;
}
function \u0275\u0275namespaceMathML() {
instructionState.lFrame.currentNamespace = MATH_ML_NAMESPACE;
}
function \u0275\u0275namespaceHTML() {
namespaceHTMLInternal();
}
function namespaceHTMLInternal() {
instructionState.lFrame.currentNamespace = null;
}
function getNamespace() {
return instructionState.lFrame.currentNamespace;
}
var _wasLastNodeCreated = true;
function wasLastNodeCreated() {
return _wasLastNodeCreated;
}
function lastNodeWasCreated(flag) {
_wasLastNodeCreated = flag;
}
var registry = { elements: void 0 };
function setAnimationElementRemovalRegistry(value) {
if (registry.elements === void 0) {
registry.elements = value;
}
}
function getAnimationElementRemovalRegistry() {
return registry;
}
function createInjector(defType, parent = null, additionalProviders = null, name) {
const injector = createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name);
injector.resolveInjectorInitializers();
return injector;
}
function createInjectorWithoutInjectorInstances(defType, parent = null, additionalProviders = null, name, scopes = /* @__PURE__ */ new Set()) {
const providers = [additionalProviders || EMPTY_ARRAY, importProvidersFrom(defType)];
name = name || (typeof defType === "object" ? void 0 : stringify(defType));
return new R3Injector(providers, parent || getNullInjector(), name || null, scopes);
}
var Injector = class _Injector {
static THROW_IF_NOT_FOUND = THROW_IF_NOT_FOUND;
static NULL = new NullInjector();
static create(options, parent) {
if (Array.isArray(options)) {
return createInjector({ name: "" }, parent, options, "");
} else {
const name = options.name ?? "";
return createInjector({ name }, options.parent, options.providers, name);
}
}
/** @nocollapse */
static \u0275prov = (
/** @pureOrBreakMyCode */
/* @__PURE__ */ \u0275\u0275defineInjectable({
token: _Injector,
providedIn: "any",
factory: () => \u0275\u0275inject(INJECTOR$1)
})
);
/**
* @internal
* @nocollapse
*/
static __NG_ELEMENT_ID__ = -1;
};
var DOCUMENT = new InjectionToken(ngDevMode ? "DocumentToken" : "");
var DestroyRef = class {
/**
* @internal
* @nocollapse
*/
static __NG_ELEMENT_ID__ = injectDestroyRef;
/**
* @internal
* @nocollapse
*/
static __NG_ENV_ID__ = (injector) => injector;
};
var NodeInjectorDestroyRef = class extends DestroyRef {
_lView;
constructor(_lView) {
super();
this._lView = _lView;
}
get destroyed() {
return isDestroyed(this._lView);
}
onDestroy(callback) {
const lView = this._lView;
storeLViewOnDestroy(lView, callback);
return () => removeLViewOnDestroy(lView, callback);
}
};
function injectDestroyRef() {
return new NodeInjectorDestroyRef(getLView());
}
var ErrorHandler = class {
/**
* @internal
*/
_console = console;
handleError(error) {
this._console.error("ERROR", error);
}
};
var INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "internal error handler" : "", {
providedIn: "root",
factory: () => {
const injector = inject2(EnvironmentInjector);
let userErrorHandler;
return (e) => {
if (injector.destroyed && !userErrorHandler) {
setTimeout(() => {
throw e;
});
} else {
userErrorHandler ??= injector.get(ErrorHandler);
userErrorHandler.handleError(e);
}
};
}
});
var errorHandlerEnvironmentInitializer = {
provide: ENVIRONMENT_INITIALIZER,
useValue: () => void inject2(ErrorHandler),
multi: true
};
var globalErrorListeners = new InjectionToken(ngDevMode ? "GlobalErrorListeners" : "", {
providedIn: "root",
factory: () => {
if (false) {
return;
}
const window2 = inject2(DOCUMENT).defaultView;
if (!window2) {
return;
}
const errorHandler2 = inject2(INTERNAL_APPLICATION_ERROR_HANDLER);
const rejectionListener = (e) => {
errorHandler2(e.reason);
e.preventDefault();
};
const errorListener = (e) => {
if (e.error) {
errorHandler2(e.error);
} else {
errorHandler2(new Error(ngDevMode ? `An ErrorEvent with no error occurred. See Error.cause for details: ${e.message}` : e.message, { cause: e }));
}
e.preventDefault();
};
const setupEventListeners = () => {
window2.addEventListener("unhandledrejection", rejectionListener);
window2.addEventListener("error", errorListener);
};
if (typeof Zone !== "undefined") {
Zone.root.run(setupEventListeners);
} else {
setupEventListeners();
}
inject2(DestroyRef).onDestroy(() => {
window2.removeEventListener("error", errorListener);
window2.removeEventListener("unhandledrejection", rejectionListener);
});
}
});
function provideBrowserGlobalErrorListeners() {
return makeEnvironmentProviders([
provideEnvironmentInitializer(() => void inject2(globalErrorListeners))
]);
}
function isSignal(value) {
return typeof value === "function" && value[SIGNAL] !== void 0;
}
function signal(initialValue, options) {
const [get, set, update] = createSignal(initialValue, options?.equal);
const signalFn = get;
const node = signalFn[SIGNAL];
signalFn.set = set;
signalFn.update = update;
signalFn.asReadonly = signalAsReadonlyFn.bind(signalFn);
if (ngDevMode) {
signalFn.toString = () => `[Signal: ${signalFn()}]`;
node.debugName = options?.debugName;
}
return signalFn;
}
function signalAsReadonlyFn() {
const node = this[SIGNAL];
if (node.readonlyFn === void 0) {
const readonlyFn = () => this();
readonlyFn[SIGNAL] = node;
node.readonlyFn = readonlyFn;
}
return node.readonlyFn;
}
function isWritableSignal(value) {
return isSignal(value) && typeof value.set === "function";
}
var ChangeDetectionScheduler = class {
};
var ZONELESS_ENABLED = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "Zoneless enabled" : "", { providedIn: "root", factory: () => false });
var PROVIDED_ZONELESS = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "Zoneless provided" : "", { providedIn: "root", factory: () => false });
var ZONELESS_SCHEDULER_DISABLED = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "scheduler disabled" : "");
var SCHEDULE_IN_ROOT_ZONE = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "run changes outside zone in root" : "");
function assertNotInReactiveContext(debugFn, extraContext) {
if (getActiveConsumer() !== null) {
throw new RuntimeError(-602, ngDevMode && `${debugFn.name}() cannot be called from within a reactive context.${extraContext ? ` ${extraContext}` : ""}`);
}
}
var ViewContext = class {
view;
node;
constructor(view, node) {
this.view = view;
this.node = node;
}
/**
* @internal
* @nocollapse
*/
static __NG_ELEMENT_ID__ = injectViewContext;
};
function injectViewContext() {
return new ViewContext(getLView(), getCurrentTNode());
}
var PendingTasksInternal = class _PendingTasksInternal {
taskId = 0;
pendingTasks = /* @__PURE__ */ new Set();
destroyed = false;
pendingTask = new BehaviorSubject(false);
get hasPendingTasks() {
return this.destroyed ? false : this.pendingTask.value;
}
/**
* In case the service is about to be destroyed, return a self-completing observable.
* Otherwise, return the observable that emits the current state of pending tasks.
*/
get hasPendingTasksObservable() {
if (this.destroyed) {
return new Observable((subscriber) => {
subscriber.next(false);
subscriber.complete();
});
}
return this.pendingTask;
}
add() {
if (!this.hasPendingTasks && !this.destroyed) {
this.pendingTask.next(true);
}
const taskId = this.taskId++;
this.pendingTasks.add(taskId);
return taskId;
}
has(taskId) {
return this.pendingTasks.has(taskId);
}
remove(taskId) {
this.pendingTasks.delete(taskId);
if (this.pendingTasks.size === 0 && this.hasPendingTasks) {
this.pendingTask.next(false);
}
}
ngOnDestroy() {
this.pendingTasks.clear();
if (this.hasPendingTasks) {
this.pendingTask.next(false);
}
this.destroyed = true;
this.pendingTask.unsubscribe();
}
/** @nocollapse */
static \u0275prov = (
/** @pureOrBreakMyCode */
/* @__PURE__ */ \u0275\u0275defineInjectable({
token: _PendingTasksInternal,
providedIn: "root",
factory: () => new _PendingTasksInternal()
})
);
};
var PendingTasks = class _PendingTasks {
internalPendingTasks = inject2(PendingTasksInternal);
scheduler = inject2(ChangeDetectionScheduler);
errorHandler = inject2(INTERNAL_APPLICATION_ERROR_HANDLER);
/**
* Adds a new task that should block application's stability.
* @returns A cleanup function that removes a task when called.
*/
add() {
const taskId = this.internalPendingTasks.add();
return () => {
if (!this.internalPendingTasks.has(taskId)) {
return;
}
this.scheduler.notify(
11
/* NotificationSource.PendingTaskRemoved */
);
this.internalPendingTasks.remove(taskId);
};
}
/**
* Runs an asynchronous function and blocks the application's stability until the function completes.
*
* ```ts
* pendingTasks.run(async () => {
* const userData = await fetch('/api/user');
* this.userData.set(userData);
* });
* ```
*
* @param fn The asynchronous function to execute
* @developerPreview 19.0
*/
run(fn) {
const removeTask = this.add();
fn().catch(this.errorHandler).finally(removeTask);
}
/** @nocollapse */
static \u0275prov = (
/** @pureOrBreakMyCode */
/* @__PURE__ */ \u0275\u0275defineInjectable({
token: _PendingTasks,
providedIn: "root",
factory: () => new _PendingTasks()
})
);
};
function noop2(...args) {
}
var EffectScheduler = class _EffectScheduler {
/** @nocollapse */
static \u0275prov = (
/** @pureOrBreakMyCode */
/* @__PURE__ */ \u0275\u0275defineInjectable({
token: _EffectScheduler,
providedIn: "root",
factory: () => new ZoneAwareEffectScheduler()
})
);
};
var ZoneAwareEffectScheduler = class {
dirtyEffectCount = 0;
queues = /* @__PURE__ */ new Map();
add(handle) {
this.enqueue(handle);
this.schedule(handle);
}
schedule(handle) {
if (!handle.dirty) {
return;
}
this.dirtyEffectCount++;
}
remove(handle) {
const zone = handle.zone;
const queue = this.queues.get(zone);
if (!queue.has(handle)) {
return;
}
queue.delete(handle);
if (handle.dirty) {
this.dirtyEffectCount--;
}
}
enqueue(handle) {
const zone = handle.zone;
if (!this.queues.has(zone)) {
this.queues.set(zone, /* @__PURE__ */ new Set());
}
const queue = this.queues.get(zone);
if (queue.has(handle)) {
return;
}
queue.add(handle);
}
/**
* Run all scheduled effects.
*
* Execution order of effects within the same zone is guaranteed to be FIFO, but there is no
* ordering guarantee between effects scheduled in different zones.
*/
flush() {
while (this.dirtyEffectCount > 0) {
let ranOneEffect = false;
for (const [zone, queue] of this.queues) {
if (zone === null) {
ranOneEffect ||= this.flushQueue(queue);
} else {
ranOneEffect ||= zone.run(() => this.flushQueue(queue));
}
}
if (!ranOneEffect) {
this.dirtyEffectCount = 0;
}
}
}
flushQueue(queue) {
let ranOneEffect = false;
for (const handle of queue) {
if (!handle.dirty) {
continue;
}
this.dirtyEffectCount--;
ranOneEffect = true;
handle.run();
}
return ranOneEffect;
}
};
// node_modules/.pnpm/@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs@7.8.2/node_modules/@angular/core/fesm2022/debug_node.mjs
function noSideEffects(fn) {
return { toString: fn }.toString();
}
var ANNOTATIONS = "__annotations__";
var PARAMETERS = "__parameters__";
var PROP_METADATA = "__prop__metadata__";
function makeDecorator(name, props, parentClass, additionalProcessing, typeFn) {
return noSideEffects(() => {
const metaCtor = makeMetadataCtor(props);
function DecoratorFactory(...args) {
if (this instanceof DecoratorFactory) {
metaCtor.call(this, ...args);
return this;
}
const annotationInstance = new DecoratorFactory(...args);
return function TypeDecorator(cls) {
if (typeFn)
typeFn(cls, ...args);
const annotations = cls.hasOwnProperty(ANNOTATIONS) ? cls[ANNOTATIONS] : Object.defineProperty(cls, ANNOTATIONS, { value: [] })[ANNOTATIONS];
annotations.push(annotationInstance);
return cls;
};
}
if (parentClass) {
DecoratorFactory.prototype = Object.create(parentClass.prototype);
}
DecoratorFactory.prototype.ngMetadataName = name;
DecoratorFactory.annotationCls = DecoratorFactory;
return DecoratorFactory;
});
}
function makeMetadataCtor(props) {
return function ctor(...args) {
if (props) {
const values = props(...args);
for (const propName in values) {
this[propName] = values[propName];
}
}
};
}
function makeParamDecorator(name, props, parentClass) {
return noSideEffects(() => {
const metaCtor = makeMetadataCtor(props);
function ParamDecoratorFactory(...args) {
if (this instanceof ParamDecoratorFactory) {
metaCtor.apply(this, args);
return this;
}
const annotationInstance = new ParamDecoratorFactory(...args);
ParamDecorator.annotation = annotationInstance;
return ParamDecorator;
function ParamDecorator(cls, unusedKey, index) {
const parameters = cls.hasOwnProperty(PARAMETERS) ? cls[PARAMETERS] : Object.defineProperty(cls, PARAMETERS, { value: [] })[PARAMETERS];
while (parameters.length <= index) {
parameters.push(null);
}
(parameters[index] = parameters[index] || []).push(annotationInstance);
return cls;
}
}
ParamDecoratorFactory.prototype.ngMetadataName = name;
ParamDecoratorFactory.annotationCls = ParamDecoratorFactory;
return ParamDecoratorFactory;
});
}
function makePropDecorator(name, props, parentClass, additionalProcessing) {
return noSideEffects(() => {
const metaCtor = makeMetadataCtor(props);
function PropDecoratorFactory(...args) {
if (this instanceof PropDecoratorFactory) {
metaCtor.apply(this, args);
return this;
}
const decoratorInstance = new PropDecoratorFactory(...args);
function PropDecorator(target, name2) {
if (target === void 0) {
throw new Error("Standard Angular field decorators are not supported in JIT mode.");
}
const constructor = target.constructor;
const meta = constructor.hasOwnProperty(PROP_METADATA) ? constructor[PROP_METADATA] : Object.defineProperty(constructor, PROP_METADATA, { value: {} })[PROP_METADATA];
meta[name2] = meta.hasOwnProperty(name2) && meta[name2] || [];
meta[name2].unshift(decoratorInstance);
}
return PropDecorator;
}
if (parentClass) {
PropDecoratorFactory.prototype = Object.create(parentClass.prototype);
}
PropDecoratorFactory.prototype.ngMetadataName = name;
PropDecoratorFactory.annotationCls = PropDecoratorFactory;
return PropDecoratorFactory;
});
}
var Inject = attachInjectFlag(
// Disable tslint because `DecoratorFlags` is a const enum which gets inlined.
makeParamDecorator("Inject", (token) => ({ token })),
-1
/* DecoratorFlags.Inject */
);
var Optional = (
// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
// tslint:disable-next-line: no-toplevel-property-access
attachInjectFlag(
makeParamDecorator("Optional"),
8
/* InternalInjectFlags.Optional */
)
);
var Self = (
// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
// tslint:disable-next-line: no-toplevel-property-access
attachInjectFlag(
makeParamDecorator("Self"),
2
/* InternalInjectFlags.Self */
)
);
var SkipSelf = (
// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
// tslint:disable-next-line: no-toplevel-property-access
attachInjectFlag(
makeParamDecorator("SkipSelf"),
4
/* InternalInjectFlags.SkipSelf */
)
);
var Host = (
// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
// tslint:disable-next-line: no-toplevel-property-access
attachInjectFlag(
makeParamDecorator("Host"),
1
/* InternalInjectFlags.Host */
)
);
function getCompilerFacade(request) {
const globalNg = _global["ng"];
if (globalNg && globalNg.\u0275compilerFacade) {
return globalNg.\u0275compilerFacade;
}
if (typeof ngDevMode === "undefined" || ngDevMode) {
console.error(`JIT compilation failed for ${request.kind}`, request.type);
let message = `The ${request.kind} '${request.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.
`;
if (request.usage === 1) {
message += `The ${request.kind} is part of a library that has been partially compiled.
`;
message += `However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.
`;
message += "\n";
message += `Ideally, the library is processed using the Angular Linker to become fully AOT compiled.
`;
} else {
message += `JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.
`;
}
message += `Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',
`;
message += `or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping.`;
throw new Error(message);
} else {
throw new Error("JIT compiler unavailable");
}
}
var angularCoreDiEnv = {
"\u0275\u0275defineInjectable": \u0275\u0275defineInjectable,
"\u0275\u0275defineInjector": \u0275\u0275defineInjector,
"\u0275\u0275inject": \u0275\u0275inject,
"\u0275\u0275invalidFactoryDep": \u0275\u0275invalidFactoryDep,
"resolveForwardRef": resolveForwardRef
};
var Type = Function;
function isType(v) {
return typeof v === "function";
}
var ES5_DELEGATE_CTOR = /^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*(arguments|(?:[^()]+\(\[\],)?[^()]+\(arguments\).*)\)/;
var ES2015_INHERITED_CLASS = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{/;
var ES2015_INHERITED_CLASS_WITH_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(/;
var ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{[^}]*super\(\.\.\.arguments\)/;
function isDelegateCtor(typeStr) {
return ES5_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr);
}
var ReflectionCapabilities = class {
_reflect;
constructor(reflect) {
this._reflect = reflect || _global["Reflect"];
}
factory(t) {
return (...args) => new t(...args);
}
/** @internal */
_zipTypesAndAnnotations(paramTypes, paramAnnotations) {
let result;
if (typeof paramTypes === "undefined") {
result = newArray(paramAnnotations.length);
} else {
result = newArray(paramTypes.length);
}
for (let i = 0; i < result.length; i++) {
if (typeof paramTypes === "undefined") {
result[i] = [];
} else if (paramTypes[i] && paramTypes[i] != Object) {
result[i] = [paramTypes[i]];
} else {
result[i] = [];
}
if (paramAnnotations && paramAnnotations[i] != null) {
result[i] = result[i].concat(paramAnnotations[i]);
}
}
return result;
}
_ownParameters(type, parentCtor) {
const typeStr = type.toString();
if (isDelegateCtor(typeStr)) {
return null;
}
if (type.parameters && type.parameters !== parentCtor.parameters) {
return type.parameters;
}
const tsickleCtorParams = type.ctorParameters;
if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {
const ctorParameters = typeof tsickleCtorParams === "function" ? tsickleCtorParams() : tsickleCtorParams;
const paramTypes2 = ctorParameters.map((ctorParam) => ctorParam && ctorParam.type);
const paramAnnotations2 = ctorParameters.map((ctorParam) => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));
return this._zipTypesAndAnnotations(paramTypes2, paramAnnotations2);
}
const paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS];
const paramTypes = this._reflect && this._reflect.getOwnMetadata && this._reflect.getOwnMetadata("design:paramtypes", type);
if (paramTypes || paramAnnotations) {
return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);
}
return newArray(type.length);
}
parameters(type) {
if (!isType(type)) {
return [];
}
const parentCtor = getParentCtor(type);
let parameters = this._ownParameters(type, parentCtor);
if (!parameters && parentCtor !== Object) {
parameters = this.parameters(parentCtor);
}
return parameters || [];
}
_ownAnnotations(typeOrFunc, parentCtor) {
if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) {
let annotations = typeOrFunc.annotations;
if (typeof annotations === "function" && annotations.annotations) {
annotations = annotations.annotations;
}
return annotations;
}
if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) {
return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators);
}
if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {
return typeOrFunc[ANNOTATIONS];
}
return null;
}
annotations(typeOrFunc) {
if (!isType(typeOrFunc)) {
return [];
}
const parentCtor = getParentCtor(typeOrFunc);
const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];
const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];
return parentAnnotations.concat(ownAnnotations);
}
_ownPropMetadata(typeOrFunc, parentCtor) {
if (typeOrFunc.propMetadata && typeOrFunc.propMetadata !== parentCtor.propMetadata) {
let propMetadata = typeOrFunc.propMetadata;
if (typeof propMetadata === "function" && propMetadata.propMetadata) {
propMetadata = propMetadata.propMetadata;
}
return propMetadata;
}
if (typeOrFunc.propDecorators && typeOrFunc.propDecorators !== parentCtor.propDecorators) {
const propDecorators = typeOrFunc.propDecorators;
const propMetadata = {};
Object.keys(propDecorators).forEach((prop) => {
propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);
});
return propMetadata;
}
if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {
return typeOrFunc[PROP_METADATA];
}
return null;
}
propMetadata(typeOrFunc) {
if (!isType(typeOrFunc)) {
return {};
}
const parentCtor = getParentCtor(typeOrFunc);
const propMetadata = {};
if (parentCtor !== Object) {
const parentPropMetadata = this.propMetadata(parentCtor);
Object.keys(parentPropMetadata).forEach((propName) => {
propMetadata[propName] = parentPropMetadata[propName];
});
}
const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);
if (ownPropMetadata) {
Object.keys(ownPropMetadata).forEach((propName) => {
const decorators = [];
if (propMetadata.hasOwnProperty(propName)) {
decorators.push(...propMetadata[propName]);
}
decorators.push(...ownPropMetadata[propName]);
propMetadata[propName] = decorators;
});
}
return propMetadata;
}
ownPropMetadata(typeOrFunc) {
if (!isType(typeOrFunc)) {
return {};
}
return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};
}
hasLifecycleHook(type, lcProperty) {
return type instanceof Type && lcProperty in type.prototype;
}
};
function convertTsickleDecoratorIntoMetadata(decoratorInvocations) {
if (!decoratorInvocations) {
return [];
}
return decoratorInvocations.map((decoratorInvocation) => {
const decoratorType = decoratorInvocation.type;
const annotationCls = decoratorType.annotationCls;
const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];
return new annotationCls(...annotationArgs);
});
}
function getParentCtor(ctor) {
const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;
const parentCtor = parentProto ? parentProto.constructor : null;
return parentCtor || Object;
}
var SimpleChange = class {
previousValue;
currentValue;
firstChange;
constructor(previousValue, currentValue, firstChange) {
this.previousValue = previousValue;
this.currentValue = currentValue;
this.firstChange = firstChange;
}
/**
* Check whether the new value is the first value assigned.
*/
isFirstChange() {
return this.firstChange;
}
};
function applyValueToInputField(instance, inputSignalNode, privateName, value) {
if (inputSignalNode !== null) {
inputSignalNode.applyValueToInputSignal(inputSignalNode, value);
} else {
instance[privateName] = value;
}
}
var \u0275\u0275NgOnChangesFeature = /* @__PURE__ */ (() => {
const \u0275\u0275NgOnChangesFeatureImpl = () => NgOnChangesFeatureImpl;
\u0275\u0275NgOnChangesFeatureImpl.ngInherit = true;
return \u0275\u0275NgOnChangesFeatureImpl;
})();
function NgOnChangesFeatureImpl(definition) {
if (definition.type.prototype.ngOnChanges) {
definition.setInput = ngOnChangesSetInput;
}
return rememberChangeHistoryAndInvokeOnChangesHook;
}
function rememberChangeHistoryAndInvokeOnChangesHook() {
const simpleChangesStore = getSimpleChangesStore(this);
const current = simpleChangesStore?.current;
if (current) {
const previous = simpleChangesStore.previous;
if (previous === EMPTY_OBJ) {
simpleChangesStore.previous = current;
} else {
for (let key in current) {
previous[key] = current[key];
}
}
simpleChangesStore.current = null;
this.ngOnChanges(current);
}
}
function ngOnChangesSetInput(instance, inputSignalNode, value, publicName, privateName) {
const declaredName = this.declaredInputs[publicName];
ngDevMode && assertString(declaredName, "Name of input in ngOnChanges has to be a string");
const simpleChangesStore = getSimpleChangesStore(instance) || setSimpleChangesStore(instance, { previous: EMPTY_OBJ, current: null });
const current = simpleChangesStore.current || (simpleChangesStore.current = {});
const previous = simpleChangesStore.previous;
const previousChange = previous[declaredName];
current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ);
applyValueToInputField(instance, inputSignalNode, privateName, value);
}
var SIMPLE_CHANGES_STORE = "__ngSimpleChanges__";
function getSimpleChangesStore(instance) {
return instance[SIMPLE_CHANGES_STORE] || null;
}
function setSimpleChangesStore(instance, store2) {
return instance[SIMPLE_CHANGES_STORE] = store2;
}
var profilerCallbacks = [];
var NOOP_PROFILER_REMOVAL2 = () => {
};
function removeProfiler2(profiler2) {
const profilerIdx = profilerCallbacks.indexOf(profiler2);
if (profilerIdx !== -1) {
profilerCallbacks.splice(profilerIdx, 1);
}
}
function setProfiler(profiler2) {
if (profiler2 !== null) {
if (!profilerCallbacks.includes(profiler2)) {
profilerCallbacks.push(profiler2);
}
return () => removeProfiler2(profiler2);
} else {
profilerCallbacks.length = 0;
return NOOP_PROFILER_REMOVAL2;
}
}
var profiler = function(event, instance = null, eventFn) {
for (let i = 0; i < profilerCallbacks.length; i++) {
const profilerCallback = profilerCallbacks[i];
profilerCallback(event, instance, eventFn);
}
};
function registerPreOrderHooks(directiveIndex, directiveDef, tView) {
ngDevMode && assertFirstCreatePass(tView);
const { ngOnChanges, ngOnInit, ngDoCheck } = directiveDef.type.prototype;
if (ngOnChanges) {
const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);
(tView.preOrderHooks ??= []).push(directiveIndex, wrappedOnChanges);
(tView.preOrderCheckHooks ??= []).push(directiveIndex, wrappedOnChanges);
}
if (ngOnInit) {
(tView.preOrderHooks ??= []).push(0 - directiveIndex, ngOnInit);
}
if (ngDoCheck) {
(tView.preOrderHooks ??= []).push(directiveIndex, ngDoCheck);
(tView.preOrderCheckHooks ??= []).push(directiveIndex, ngDoCheck);
}
}
function registerPostOrderHooks(tView, tNode) {
ngDevMode && assertFirstCreatePass(tView);
for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) {
const directiveDef = tView.data[i];
ngDevMode && assertDefined(directiveDef, "Expecting DirectiveDef");
const lifecycleHooks = directiveDef.type.prototype;
const { ngAfterContentInit, ngAfterContentChecked, ngAfterViewInit, ngAfterViewChecked, ngOnDestroy } = lifecycleHooks;
if (ngAfterContentInit) {
(tView.contentHooks ??= []).push(-i, ngAfterContentInit);
}
if (ngAfterContentChecked) {
(tView.contentHooks ??= []).push(i, ngAfterContentChecked);
(tView.contentCheckHooks ??= []).push(i, ngAfterContentChecked);
}
if (ngAfterViewInit) {
(tView.viewHooks ??= []).push(-i, ngAfterViewInit);
}
if (ngAfterViewChecked) {
(tView.viewHooks ??= []).push(i, ngAfterViewChecked);
(tView.viewCheckHooks ??= []).push(i, ngAfterViewChecked);
}
if (ngOnDestroy != null) {
(tView.destroyHooks ??= []).push(i, ngOnDestroy);
}
}
}
function executeCheckHooks(lView, hooks, nodeIndex) {
callHooks(lView, hooks, 3, nodeIndex);
}
function executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) {
ngDevMode && assertNotEqual(initPhase, 3, "Init pre-order hooks should not be called more than once");
if ((lView[FLAGS] & 3) === initPhase) {
callHooks(lView, hooks, initPhase, nodeIndex);
}
}
function incrementInitPhaseFlags(lView, initPhase) {
ngDevMode && assertNotEqual(initPhase, 3, "Init hooks phase should not be incremented after all init hooks have been run.");
let flags = lView[FLAGS];
if ((flags & 3) === initPhase) {
flags &= 16383;
flags += 1;
lView[FLAGS] = flags;
}
}
function callHooks(currentView, arr, initPhase, currentNodeIndex) {
ngDevMode && assertEqual(isInCheckNoChangesMode(), false, "Hooks should never be run when in check no changes mode.");
const startIndex = currentNodeIndex !== void 0 ? currentView[PREORDER_HOOK_FLAGS] & 65535 : 0;
const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1;
const max = arr.length - 1;
let lastNodeIndexFound = 0;
for (let i = startIndex; i < max; i++) {
const hook = arr[i + 1];
if (typeof hook === "number") {
lastNodeIndexFound = arr[i];
if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) {
break;
}
} else {
const isInitHook = arr[i] < 0;
if (isInitHook) {
currentView[PREORDER_HOOK_FLAGS] += 65536;
}
if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {
callHook(currentView, initPhase, arr, i);
currentView[PREORDER_HOOK_FLAGS] = (currentView[PREORDER_HOOK_FLAGS] & 4294901760) + i + 2;
}
i++;
}
}
}
function callHookInternal(directive, hook) {
profiler(4, directive, hook);
const prevConsumer = setActiveConsumer(null);
try {
hook.call(directive);
} finally {
setActiveConsumer(prevConsumer);
profiler(5, directive, hook);
}
}
function callHook(currentView, initPhase, arr, i) {
const isInitHook = arr[i] < 0;
const hook = arr[i + 1];
const directiveIndex = isInitHook ? -arr[i] : arr[i];
const directive = currentView[directiveIndex];
if (isInitHook) {
const indexWithintInitPhase = currentView[FLAGS] >> 14;
if (indexWithintInitPhase < currentView[PREORDER_HOOK_FLAGS] >> 16 && (currentView[FLAGS] & 3) === initPhase) {
currentView[FLAGS] += 16384;
callHookInternal(directive, hook);
}
} else {
callHookInternal(directive, hook);
}
}
var NO_PARENT_INJECTOR = -1;
var NodeInjectorFactory = class {
factory;
name;
/**
* The inject implementation to be activated when using the factory.
*/
injectImpl;
/**
* Marker set to true during factory invocation to see if we get into recursive loop.
* Recursive loop causes an error to be displayed.
*/
resolving = false;
/**
* Marks that the token can see other Tokens declared in `viewProviders` on the same node.
*/
canSeeViewProviders;
/**
* An array of factories to use in case of `multi` provider.
*/
multi;
/**
* Number of `multi`-providers which belong to the component.
*
* This is needed because when multiple components and directives declare the `multi` provider
* they have to be concatenated in the correct order.
*
* Example:
*
* If we have a component and directive active an a single element as declared here
* ```ts
* component:
* providers: [ {provide: String, useValue: 'component', multi: true} ],
* viewProviders: [ {provide: String, useValue: 'componentView', multi: true} ],
*
* directive:
* providers: [ {provide: String, useValue: 'directive', multi: true} ],
* ```
*
* Then the expected results are:
*
* ```ts
* providers: ['component', 'directive']
* viewProviders: ['component', 'componentView', 'directive']
* ```
*
* The way to think about it is that the `viewProviders` have been inserted after the component
* but before the directives, which is why we need to know how many `multi`s have been declared by
* the component.
*/
componentProviders;
/**
* Current index of the Factory in the `data`. Needed for `viewProviders` and `providers` merging.
* See `providerFactory`.
*/
index;
/**
* Because the same `multi` provider can be declared in `providers` and `viewProviders` it is
* possible for `viewProviders` to shadow the `providers`. For this reason we store the
* `provideFactory` of the `providers` so that `providers` can be extended with `viewProviders`.
*
* Example:
*
* Given:
* ```ts
* providers: [ {provide: String, useValue: 'all', multi: true} ],
* viewProviders: [ {provide: String, useValue: 'viewOnly', multi: true} ],
* ```
*
* We have to return `['all']` in case of content injection, but `['all', 'viewOnly']` in case
* of view injection. We further have to make sure that the shared instances (in our case
* `all`) are the exact same instance in both the content as well as the view injection. (We
* have to make sure that we don't double instantiate.) For this reason the `viewProviders`
* `Factory` has a pointer to the shadowed `providers` factory so that it can instantiate the
* `providers` (`['all']`) and then extend it with `viewProviders` (`['all'] + ['viewOnly'] =
* ['all', 'viewOnly']`).
*/
providerFactory;
constructor(factory, isViewProvider, injectImplementation, name) {
this.factory = factory;
this.name = name;
ngDevMode && assertDefined(factory, "Factory not specified");
ngDevMode && assertEqual(typeof factory, "function", "Expected factory function.");
this.canSeeViewProviders = isViewProvider;
this.injectImpl = injectImplementation;
}
};
function toTNodeTypeAsString(tNodeType) {
let text = "";
tNodeType & 1 && (text += "|Text");
tNodeType & 2 && (text += "|Element");
tNodeType & 4 && (text += "|Container");
tNodeType & 8 && (text += "|ElementContainer");
tNodeType & 16 && (text += "|Projection");
tNodeType & 32 && (text += "|IcuContainer");
tNodeType & 64 && (text += "|Placeholder");
tNodeType & 128 && (text += "|LetDeclaration");
return text.length > 0 ? text.substring(1) : text;
}
function isTNodeShape(value) {
return value != null && typeof value === "object" && (value.insertBeforeIndex === null || typeof value.insertBeforeIndex === "number" || Array.isArray(value.insertBeforeIndex));
}
function hasClassInput(tNode) {
return (tNode.flags & 8) !== 0;
}
function hasStyleInput(tNode) {
return (tNode.flags & 16) !== 0;
}
function assertTNodeType(tNode, expectedTypes, message) {
assertDefined(tNode, "should be called with a TNode");
if ((tNode.type & expectedTypes) === 0) {
throwError2(message || `Expected [${toTNodeTypeAsString(expectedTypes)}] but got ${toTNodeTypeAsString(tNode.type)}.`);
}
}
function assertPureTNodeType(type) {
if (!(type === 2 || type === 1 || type === 4 || type === 8 || type === 32 || type === 16 || type === 64 || type === 128)) {
throwError2(`Expected TNodeType to have only a single type selected, but got ${toTNodeTypeAsString(type)}.`);
}
}
function setUpAttributes(renderer, native, attrs) {
let i = 0;
while (i < attrs.length) {
const value = attrs[i];
if (typeof value === "number") {
if (value !== 0) {
break;
}
i++;
const namespaceURI = attrs[i++];
const attrName = attrs[i++];
const attrVal = attrs[i++];
renderer.setAttribute(native, attrName, attrVal, namespaceURI);
} else {
const attrName = value;
const attrVal = attrs[++i];
if (isAnimationProp(attrName)) {
renderer.setProperty(native, attrName, attrVal);
} else {
renderer.setAttribute(native, attrName, attrVal);
}
i++;
}
}
return i;
}
function isNameOnlyAttributeMarker(marker) {
return marker === 3 || marker === 4 || marker === 6;
}
function isAnimationProp(name) {
return name.charCodeAt(0) === 64;
}
function mergeHostAttrs(dst, src) {
if (src === null || src.length === 0) ;
else if (dst === null || dst.length === 0) {
dst = src.slice();
} else {
let srcMarker = -1;
for (let i = 0; i < src.length; i++) {
const item = src[i];
if (typeof item === "number") {
srcMarker = item;
} else {
if (srcMarker === 0) ;
else if (srcMarker === -1 || srcMarker === 2) {
mergeHostAttribute(dst, srcMarker, item, null, src[++i]);
} else {
mergeHostAttribute(dst, srcMarker, item, null, null);
}
}
}
}
return dst;
}
function mergeHostAttribute(dst, marker, key1, key2, value) {
let i = 0;
let markerInsertPosition = dst.length;
if (marker === -1) {
markerInsertPosition = -1;
} else {
while (i < dst.length) {
const dstValue = dst[i++];
if (typeof dstValue === "number") {
if (dstValue === marker) {
markerInsertPosition = -1;
break;
} else if (dstValue > marker) {
markerInsertPosition = i - 1;
break;
}
}
}
}
while (i < dst.length) {
const item = dst[i];
if (typeof item === "number") {
break;
} else if (item === key1) {
{
if (value !== null) {
dst[i + 1] = value;
}
return;
}
}
i++;
if (value !== null)
i++;
}
if (markerInsertPosition !== -1) {
dst.splice(markerInsertPosition, 0, marker);
i = markerInsertPosition + 1;
}
dst.splice(i++, 0, key1);
if (value !== null) {
dst.splice(i++, 0, value);
}
}
function hasParentInjector(parentLocation) {
return parentLocation !== NO_PARENT_INJECTOR;
}
function getParentInjectorIndex(parentLocation) {
if (ngDevMode) {
assertNumber(parentLocation, "Number expected");
assertNotEqual(parentLocation, -1, "Not a valid state.");
const parentInjectorIndex = parentLocation & 32767;
assertGreaterThan(parentInjectorIndex, HEADER_OFFSET, "Parent injector must be pointing past HEADER_OFFSET.");
}
return parentLocation & 32767;
}
function getParentInjectorViewOffset(parentLocation) {
return parentLocation >> 16;
}
function getParentInjectorView(location2, startView) {
let viewOffset = getParentInjectorViewOffset(location2);
let parentView = startView;
while (viewOffset > 0) {
parentView = parentView[DECLARATION_VIEW];
viewOffset--;
}
return parentView;
}
var includeViewProviders = true;
function setIncludeViewProviders(v) {
const oldValue = includeViewProviders;
includeViewProviders = v;
return oldValue;
}
var BLOOM_SIZE = 256;
var BLOOM_MASK = BLOOM_SIZE - 1;
var BLOOM_BUCKET_BITS = 5;
var nextNgElementId = 0;
var NOT_FOUND2 = {};
function bloomAdd(injectorIndex, tView, type) {
ngDevMode && assertEqual(tView.firstCreatePass, true, "expected firstCreatePass to be true");
let id;
if (typeof type === "string") {
id = type.charCodeAt(0) || 0;
} else if (type.hasOwnProperty(NG_ELEMENT_ID)) {
id = type[NG_ELEMENT_ID];
}
if (id == null) {
id = type[NG_ELEMENT_ID] = nextNgElementId++;
}
const bloomHash = id & BLOOM_MASK;
const mask = 1 << bloomHash;
tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;
}
function getOrCreateNodeInjectorForNode(tNode, lView) {
const existingInjectorIndex = getInjectorIndex(tNode, lView);
if (existingInjectorIndex !== -1) {
return existingInjectorIndex;
}
const tView = lView[TVIEW];
if (tView.firstCreatePass) {
tNode.injectorIndex = lView.length;
insertBloom(tView.data, tNode);
insertBloom(lView, null);
insertBloom(tView.blueprint, null);
}
const parentLoc = getParentInjectorLocation(tNode, lView);
const injectorIndex = tNode.injectorIndex;
if (hasParentInjector(parentLoc)) {
const parentIndex = getParentInjectorIndex(parentLoc);
const parentLView = getParentInjectorView(parentLoc, lView);
const parentData = parentLView[TVIEW].data;
for (let i = 0; i < 8; i++) {
lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];
}
}
lView[
injectorIndex + 8
/* NodeInjectorOffset.PARENT */
] = parentLoc;
return injectorIndex;
}
function insertBloom(arr, footer) {
arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);
}
function getInjectorIndex(tNode, lView) {
if (tNode.injectorIndex === -1 || // If the injector index is the same as its parent's injector index, then the index has been
// copied down from the parent node. No injector has been created yet on this node.
tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex || // After the first template pass, the injector index might exist but the parent values
// might not have been calculated yet for this instance
lView[
tNode.injectorIndex + 8
/* NodeInjectorOffset.PARENT */
] === null) {
return -1;
} else {
ngDevMode && assertIndexInRange(lView, tNode.injectorIndex);
return tNode.injectorIndex;
}
}
function getParentInjectorLocation(tNode, lView) {
if (tNode.parent && tNode.parent.injectorIndex !== -1) {
return tNode.parent.injectorIndex;
}
let declarationViewOffset = 0;
let parentTNode = null;
let lViewCursor = lView;
while (lViewCursor !== null) {
parentTNode = getTNodeFromLView(lViewCursor);
if (parentTNode === null) {
return NO_PARENT_INJECTOR;
}
ngDevMode && parentTNode && assertTNodeForLView(parentTNode, lViewCursor[DECLARATION_VIEW]);
declarationViewOffset++;
lViewCursor = lViewCursor[DECLARATION_VIEW];
if (parentTNode.injectorIndex !== -1) {
return parentTNode.injectorIndex | declarationViewOffset << 16;
}
}
return NO_PARENT_INJECTOR;
}
function diPublicInInjector(injectorIndex, tView, token) {
bloomAdd(injectorIndex, tView, token);
}
function injectAttributeImpl(tNode, attrNameToInject) {
ngDevMode && assertTNodeType(
tNode,
12 | 3
/* TNodeType.AnyRNode */
);
ngDevMode && assertDefined(tNode, "expecting tNode");
if (attrNameToInject === "class") {
return tNode.classes;
}
if (attrNameToInject === "style") {
return tNode.styles;
}
const attrs = tNode.attrs;
if (attrs) {
const attrsLength = attrs.length;
let i = 0;
while (i < attrsLength) {
const value = attrs[i];
if (isNameOnlyAttributeMarker(value))
break;
if (value === 0) {
i = i + 2;
} else if (typeof value === "number") {
i++;
while (i < attrsLength && typeof attrs[i] === "string") {
i++;
}
} else if (value === attrNameToInject) {
return attrs[i + 1];
} else {
i = i + 2;
}
}
}
return null;
}
function notFoundValueOrThrow(notFoundValue, token, flags) {
if (flags & 8 || notFoundValue !== void 0) {
return notFoundValue;
} else {
throwProviderNotFoundError(token, "NodeInjector");
}
}
function lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) {
if (flags & 8 && notFoundValue === void 0) {
notFoundValue = null;
}
if ((flags & (2 | 1)) === 0) {
const moduleInjector = lView[INJECTOR];
const previousInjectImplementation = setInjectImplementation(void 0);
try {
if (moduleInjector) {
return moduleInjector.get(
token,
notFoundValue,
flags & 8
/* InternalInjectFlags.Optional */
);
} else {
return injectRootLimpMode(
token,
notFoundValue,
flags & 8
/* InternalInjectFlags.Optional */
);
}
} finally {
setInjectImplementation(previousInjectImplementation);
}
}
return notFoundValueOrThrow(notFoundValue, token, flags);
}
function getOrCreateInjectable(tNode, lView, token, flags = 0, notFoundValue) {
if (tNode !== null) {
if (lView[FLAGS] & 2048 && // The token must be present on the current node injector when the `Self`
// flag is set, so the lookup on embedded view injector(s) can be skipped.
!(flags & 2)) {
const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND2);
if (embeddedInjectorValue !== NOT_FOUND2) {
return embeddedInjectorValue;
}
}
const value = lookupTokenUsingNodeInjector(tNode, lView, token, flags, NOT_FOUND2);
if (value !== NOT_FOUND2) {
return value;
}
}
return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);
}
function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) {
const bloomHash = bloomHashBitOrFactory(token);
if (typeof bloomHash === "function") {
if (!enterDI(lView, tNode, flags)) {
return flags & 1 ? notFoundValueOrThrow(notFoundValue, token, flags) : lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);
}
try {
let value;
if (ngDevMode) {
runInInjectorProfilerContext(new NodeInjector(getCurrentTNode(), getLView()), token, () => {
emitInjectorToCreateInstanceEvent(token);
value = bloomHash(flags);
emitInstanceCreatedByInjectorEvent(value);
});
} else {
value = bloomHash(flags);
}
if (value == null && !(flags & 8)) {
throwProviderNotFoundError(token);
} else {
return value;
}
} finally {
leaveDI();
}
} else if (typeof bloomHash === "number") {
let previousTView = null;
let injectorIndex = getInjectorIndex(tNode, lView);
let parentLocation = NO_PARENT_INJECTOR;
let hostTElementNode = flags & 1 ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;
if (injectorIndex === -1 || flags & 4) {
parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) : lView[
injectorIndex + 8
/* NodeInjectorOffset.PARENT */
];
if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {
injectorIndex = -1;
} else {
previousTView = lView[TVIEW];
injectorIndex = getParentInjectorIndex(parentLocation);
lView = getParentInjectorView(parentLocation, lView);
}
}
while (injectorIndex !== -1) {
ngDevMode && assertNodeInjector(lView, injectorIndex);
const tView = lView[TVIEW];
ngDevMode && assertTNodeForLView(tView.data[
injectorIndex + 8
/* NodeInjectorOffset.TNODE */
], lView);
if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {
const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode);
if (instance !== NOT_FOUND2) {
return instance;
}
}
parentLocation = lView[
injectorIndex + 8
/* NodeInjectorOffset.PARENT */
];
if (parentLocation !== NO_PARENT_INJECTOR && shouldSearchParent(flags, lView[TVIEW].data[
injectorIndex + 8
/* NodeInjectorOffset.TNODE */
] === hostTElementNode) && bloomHasToken(bloomHash, injectorIndex, lView)) {
previousTView = tView;
injectorIndex = getParentInjectorIndex(parentLocation);
lView = getParentInjectorView(parentLocation, lView);
} else {
injectorIndex = -1;
}
}
}
return notFoundValue;
}
function searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {
const currentTView = lView[TVIEW];
const tNode = currentTView.data[
injectorIndex + 8
/* NodeInjectorOffset.TNODE */
];
const canAccessViewProviders = previousTView == null ? (
// 1) This is the first invocation `previousTView == null` which means that we are at the
// `TNode` of where injector is starting to look. In such a case the only time we are allowed
// to look into the ViewProviders is if:
// - we are on a component
// - AND the injector set `includeViewProviders` to true (implying that the token can see
// ViewProviders because it is the Component or a Service which itself was declared in
// ViewProviders)
isComponentHost(tNode) && includeViewProviders
) : (
// 2) `previousTView != null` which means that we are now walking across the parent nodes.
// In such a case we are only allowed to look into the ViewProviders if:
// - We just crossed from child View to Parent View `previousTView != currentTView`
// - AND the parent TNode is an Element.
// This means that we just came from the Component's View and therefore are allowed to see
// into the ViewProviders.
previousTView != currentTView && (tNode.type & 3) !== 0
);
const isHostSpecialCase = flags & 1 && hostTElementNode === tNode;
const injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase);
if (injectableIdx !== null) {
return getNodeInjectable(lView, currentTView, injectableIdx, tNode, flags);
} else {
return NOT_FOUND2;
}
}
function locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {
const nodeProviderIndexes = tNode.providerIndexes;
const tInjectables = tView.data;
const injectablesStart = nodeProviderIndexes & 1048575;
const directivesStart = tNode.directiveStart;
const directiveEnd = tNode.directiveEnd;
const cptViewProvidersCount = nodeProviderIndexes >> 20;
const startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;
const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;
for (let i = startingIndex; i < endIndex; i++) {
const providerTokenOrDef = tInjectables[i];
if (i < directivesStart && token === providerTokenOrDef || i >= directivesStart && providerTokenOrDef.type === token) {
return i;
}
}
if (isHostSpecialCase) {
const dirDef = tInjectables[directivesStart];
if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {
return directivesStart;
}
}
return null;
}
var injectionPath = [];
function getNodeInjectable(lView, tView, index, tNode, flags) {
let value = lView[index];
const tData = tView.data;
if (value instanceof NodeInjectorFactory) {
const factory = value;
ngDevMode && injectionPath.push(factory.name ?? "unknown");
if (factory.resolving) {
const token2 = stringifyForError(tData[index]);
if (ngDevMode) {
throw cyclicDependencyErrorWithDetails(token2, injectionPath);
} else {
throw cyclicDependencyError(token2);
}
}
const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);
factory.resolving = true;
const token = tData[index].type || tData[index];
let prevInjectContext;
if (ngDevMode) {
const injector = new NodeInjector(tNode, lView);
prevInjectContext = setInjectorProfilerContext({ injector, token });
}
const previousInjectImplementation = factory.injectImpl ? setInjectImplementation(factory.injectImpl) : null;
const success = enterDI(
lView,
tNode,
0
/* InternalInjectFlags.Default */
);
ngDevMode && assertEqual(success, true, "Because flags do not contain `SkipSelf' we expect this to always succeed.");
try {
ngDevMode && emitInjectorToCreateInstanceEvent(token);
value = lView[index] = factory.factory(void 0, flags, tData, lView, tNode);
ngDevMode && emitInstanceCreatedByInjectorEvent(value);
if (tView.firstCreatePass && index >= tNode.directiveStart) {
ngDevMode && assertDirectiveDef(tData[index]);
registerPreOrderHooks(index, tData[index], tView);
}
} finally {
ngDevMode && setInjectorProfilerContext(prevInjectContext);
previousInjectImplementation !== null && setInjectImplementation(previousInjectImplementation);
setIncludeViewProviders(previousIncludeViewProviders);
factory.resolving = false;
leaveDI();
ngDevMode && (injectionPath = []);
}
}
return value;
}
function bloomHashBitOrFactory(token) {
ngDevMode && assertDefined(token, "token must be defined");
if (typeof token === "string") {
return token.charCodeAt(0) || 0;
}
const tokenId = (
// First check with `hasOwnProperty` so we don't get an inherited ID.
token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : void 0
);
if (typeof tokenId === "number") {
if (tokenId >= 0) {
return tokenId & BLOOM_MASK;
} else {
ngDevMode && assertEqual(tokenId, -1, "Expecting to get Special Injector Id");
return createNodeInjector;
}
} else {
return tokenId;
}
}
function bloomHasToken(bloomHash, injectorIndex, injectorView) {
const mask = 1 << bloomHash;
const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];
return !!(value & mask);
}
function shouldSearchParent(flags, isFirstHostTNode) {
return !(flags & 2) && !(flags & 1 && isFirstHostTNode);
}
function getNodeInjectorLView(nodeInjector) {
return nodeInjector._lView;
}
function getNodeInjectorTNode(nodeInjector) {
return nodeInjector._tNode;
}
var NodeInjector = class {
_tNode;
_lView;
constructor(_tNode, _lView) {
this._tNode = _tNode;
this._lView = _lView;
}
get(token, notFoundValue, flags) {
return getOrCreateInjectable(this._tNode, this._lView, token, convertToBitFlags(flags), notFoundValue);
}
};
function createNodeInjector() {
return new NodeInjector(getCurrentTNode(), getLView());
}
function \u0275\u0275getInheritedFactory(type) {
return noSideEffects(() => {
const ownConstructor = type.prototype.constructor;
const ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor);
const objectPrototype = Object.prototype;
let parent = Object.getPrototypeOf(type.prototype).constructor;
while (parent && parent !== objectPrototype) {
const factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent);
if (factory && factory !== ownFactory) {
return factory;
}
parent = Object.getPrototypeOf(parent);
}
return (t) => new t();
});
}
function getFactoryOf(type) {
if (isForwardRef(type)) {
return () => {
const factory = getFactoryOf(resolveForwardRef(type));
return factory && factory();
};
}
return getFactoryDef(type);
}
function lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundValue) {
let currentTNode = tNode;
let currentLView = lView;
while (currentTNode !== null && currentLView !== null && currentLView[FLAGS] & 2048 && !isRootView(currentLView)) {
ngDevMode && assertTNodeForLView(currentTNode, currentLView);
const nodeInjectorValue = lookupTokenUsingNodeInjector(currentTNode, currentLView, token, flags | 2, NOT_FOUND2);
if (nodeInjectorValue !== NOT_FOUND2) {
return nodeInjectorValue;
}
let parentTNode = currentTNode.parent;
if (!parentTNode) {
const embeddedViewInjector = currentLView[EMBEDDED_VIEW_INJECTOR];
if (embeddedViewInjector) {
const embeddedViewInjectorValue = embeddedViewInjector.get(token, NOT_FOUND2, flags);
if (embeddedViewInjectorValue !== NOT_FOUND2) {
return embeddedViewInjectorValue;
}
}
parentTNode = getTNodeFromLView(currentLView);
currentLView = currentLView[DECLARATION_VIEW];
}
currentTNode = parentTNode;
}
return notFoundValue;
}
function getTNodeFromLView(lView) {
const tView = lView[TVIEW];
const tViewType = tView.type;
if (tViewType === 2) {
ngDevMode && assertDefined(tView.declTNode, "Embedded TNodes should have declaration parents.");
return tView.declTNode;
} else if (tViewType === 1) {
return lView[T_HOST];
}
return null;
}
function \u0275\u0275injectAttribute(attrNameToInject) {
return injectAttributeImpl(getCurrentTNode(), attrNameToInject);
}
var Attribute = makeParamDecorator("Attribute", (attributeName) => ({
attributeName,
__NG_ELEMENT_ID__: () => \u0275\u0275injectAttribute(attributeName)
}));
var _reflect = null;
function getReflect() {
return _reflect = _reflect || new ReflectionCapabilities();
}
function reflectDependencies(type) {
return convertDependencies(getReflect().parameters(type));
}
function convertDependencies(deps) {
return deps.map((dep) => reflectDependency(dep));
}
function reflectDependency(dep) {
const meta = {
token: null,
attribute: null,
host: false,
optional: false,
self: false,
skipSelf: false
};
if (Array.isArray(dep) && dep.length > 0) {
for (let j = 0; j < dep.length; j++) {
const param = dep[j];
if (param === void 0) {
continue;
}
const proto = Object.getPrototypeOf(param);
if (param instanceof Optional || proto.ngMetadataName === "Optional") {
meta.optional = true;
} else if (param instanceof SkipSelf || proto.ngMetadataName === "SkipSelf") {
meta.skipSelf = true;
} else if (param instanceof Self || proto.ngMetadataName === "Self") {
meta.self = true;
} else if (param instanceof Host || proto.ngMetadataName === "Host") {
meta.host = true;
} else if (param instanceof Inject) {
meta.token = param.token;
} else if (param instanceof Attribute) {
if (param.attributeName === void 0) {
throw new RuntimeError(204, ngDevMode && `Attribute name must be defined.`);
}
meta.attribute = param.attributeName;
} else {
meta.token = param;
}
}
} else if (dep === void 0 || Array.isArray(dep) && dep.length === 0) {
meta.token = null;
} else {
meta.token = dep;
}
return meta;
}
function compileInjectable(type, meta) {
let ngInjectableDef = null;
let ngFactoryDef = null;
if (!type.hasOwnProperty(NG_PROV_DEF)) {
Object.defineProperty(type, NG_PROV_DEF, {
get: () => {
if (ngInjectableDef === null) {
const compiler = getCompilerFacade({
usage: 0,
kind: "injectable",
type
});
ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, `ng:///${type.name}/\u0275prov.js`, getInjectableMetadata(type, meta));
}
return ngInjectableDef;
}
});
}
if (!type.hasOwnProperty(NG_FACTORY_DEF)) {
Object.defineProperty(type, NG_FACTORY_DEF, {
get: () => {
if (ngFactoryDef === null) {
const compiler = getCompilerFacade({
usage: 0,
kind: "injectable",
type
});
ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/\u0275fac.js`, {
name: type.name,
type,
typeArgumentCount: 0,
// In JIT mode types are not available nor used.
deps: reflectDependencies(type),
target: compiler.FactoryTarget.Injectable
});
}
return ngFactoryDef;
},
// Leave this configurable so that the factories from directives or pipes can take precedence.
configurable: true
});
}
}
var USE_VALUE2 = getClosureSafeProperty({
provide: String,
useValue: getClosureSafeProperty
});
function isUseClassProvider(meta) {
return meta.useClass !== void 0;
}
function isUseValueProvider(meta) {
return USE_VALUE2 in meta;
}
function isUseFactoryProvider(meta) {
return meta.useFactory !== void 0;
}
function isUseExistingProvider(meta) {
return meta.useExisting !== void 0;
}
function getInjectableMetadata(type, srcMeta) {
const meta = srcMeta || { providedIn: null };
const compilerMeta = {
name: type.name,
type,
typeArgumentCount: 0,
providedIn: meta.providedIn
};
if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== void 0) {
compilerMeta.deps = convertDependencies(meta.deps);
}
if (isUseClassProvider(meta)) {
compilerMeta.useClass = meta.useClass;
} else if (isUseValueProvider(meta)) {
compilerMeta.useValue = meta.useValue;
} else if (isUseFactoryProvider(meta)) {
compilerMeta.useFactory = meta.useFactory;
} else if (isUseExistingProvider(meta)) {
compilerMeta.useExisting = meta.useExisting;
}
return compilerMeta;
}
var Injectable = makeDecorator("Injectable", void 0, void 0, void 0, (type, meta) => compileInjectable(type, meta));
function injectElementRef() {
return createElementRef(getCurrentTNode(), getLView());
}
function createElementRef(tNode, lView) {
return new ElementRef(getNativeByTNode(tNode, lView));
}
var ElementRef = class {
/**
* <div class="docs-alert docs-alert-important">
* <header>Use with caution</header>
* <p>
* Use this API as the last resort when direct access to DOM is needed. Use templating and
* data-binding provided by Angular instead. If used, it is recommended in combination with
* {@link /best-practices/security#direct-use-of-the-dom-apis-and-explicit-sanitization-calls DomSanitizer}
* for maxiumum security;
* </p>
* </div>
*/
nativeElement;
constructor(nativeElement) {
this.nativeElement = nativeElement;
}
/**
* @internal
* @nocollapse
*/
static __NG_ELEMENT_ID__ = injectElementRef;
};
function unwrapElementRef(value) {
return value instanceof ElementRef ? value.nativeElement : value;
}
function symbolIterator() {
return this._results[Symbol.iterator]();
}
var QueryList = class {
_emitDistinctChangesOnly;
dirty = true;
_onDirty = void 0;
_results = [];
_changesDetected = false;
_changes = void 0;
length = 0;
first = void 0;
last = void 0;
/**
* Returns `Observable` of `QueryList` notifying the subscriber of changes.
*/
get changes() {
return this._changes ??= new Subject();
}
/**
* @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change
* has occurred. Or if it should fire when query is recomputed. (recomputing could resolve in
* the same result)
*/
constructor(_emitDistinctChangesOnly = false) {
this._emitDistinctChangesOnly = _emitDistinctChangesOnly;
}
/**
* Returns the QueryList entry at `index`.
*/
get(index) {
return this._results[index];
}
/**
* See
* [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
*/
map(fn) {
return this._results.map(fn);
}
filter(fn) {
return this._results.filter(fn);
}
/**
* See
* [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
*/
find(fn) {
return this._results.find(fn);
}
/**
* See
* [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
*/
reduce(fn, init) {
return this._results.reduce(fn, init);
}
/**
* See
* [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
*/
forEach(fn) {
this._results.forEach(fn);
}
/**
* See
* [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
*/
some(fn) {
return this._results.some(fn);
}
/**
* Returns a copy of the internal results list as an Array.
*/
toArray() {
return this._results.slice();
}
toString() {
return this._results.toString();
}
/**
* Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that
* on change detection, it will not notify of changes to the queries, unless a new change
* occurs.
*
* @param resultsTree The query results to store
* @param identityAccessor Optional function for extracting stable object identity from a value
* in the array. This function is executed for each element of the query result list while
* comparing current query list with the new one (provided as a first argument of the `reset`
* function) to detect if the lists are different. If the function is not provided, elements
* are compared as is (without any pre-processing).
*/
reset(resultsTree, identityAccessor) {
this.dirty = false;
const newResultFlat = flatten(resultsTree);
if (this._changesDetected = !arrayEquals(this._results, newResultFlat, identityAccessor)) {
this._results = newResultFlat;
this.length = newResultFlat.length;
this.last = newResultFlat[this.length - 1];
this.first = newResultFlat[0];
}
}
/**
* Triggers a change event by emitting on the `changes` {@link EventEmitter}.
*/
notifyOnChanges() {
if (this._changes !== void 0 && (this._changesDetected || !this._emitDistinctChangesOnly))
this._changes.next(this);
}
/** @internal */
onDirty(cb) {
this._onDirty = cb;
}
/** internal */
setDirty() {
this.dirty = true;
this._onDirty?.();
}
/** internal */
destroy() {
if (this._changes !== void 0) {
this._changes.complete();
this._changes.unsubscribe();
}
}
[Symbol.iterator] = /* @__PURE__ */ (() => symbolIterator)();
};
function hasInSkipHydrationBlockFlag(tNode) {
return (tNode.flags & 128) === 128;
}
var ChangeDetectionStrategy;
(function(ChangeDetectionStrategy2) {
ChangeDetectionStrategy2[ChangeDetectionStrategy2["OnPush"] = 0] = "OnPush";
ChangeDetectionStrategy2[ChangeDetectionStrategy2["Default"] = 1] = "Default";
})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
var TRACKED_LVIEWS = /* @__PURE__ */ new Map();
var uniqueIdCounter = 0;
function getUniqueLViewId() {
return uniqueIdCounter++;
}
function registerLView(lView) {
ngDevMode && assertNumber(lView[ID], "LView must have an ID in order to be registered");
TRACKED_LVIEWS.set(lView[ID], lView);
}
function getLViewById(id) {
ngDevMode && assertNumber(id, "ID used for LView lookup must be a number");
return TRACKED_LVIEWS.get(id) || null;
}
function unregisterLView(lView) {
ngDevMode && assertNumber(lView[ID], "Cannot stop tracking an LView that does not have an ID");
TRACKED_LVIEWS.delete(lView[ID]);
}
function getTrackedLViews() {
return TRACKED_LVIEWS;
}
var LContext = class {
lViewId;
nodeIndex;
native;
/**
* The instance of the Component node.
*/
component;
/**
* The list of active directives that exist on this element.
*/
directives;
/**
* The map of local references (local reference name => element or directive instance) that
* exist on this element.
*/
localRefs;
/** Component's parent view data. */
get lView() {
return getLViewById(this.lViewId);
}
constructor(lViewId, nodeIndex, native) {
this.lViewId = lViewId;
this.nodeIndex = nodeIndex;
this.native = native;
}
};
function getLContext(target) {
let mpValue = readPatchedData(target);
if (mpValue) {
if (isLView(mpValue)) {
const lView = mpValue;
let nodeIndex;
let component = void 0;
let directives = void 0;
if (isComponentInstance(target)) {
nodeIndex = findViaComponent(lView, target);
if (nodeIndex == -1) {
throw new Error("The provided component was not found in the application");
}
component = target;
} else if (isDirectiveInstance(target)) {
nodeIndex = findViaDirective(lView, target);
if (nodeIndex == -1) {
throw new Error("The provided directive was not found in the application");
}
directives = getDirectivesAtNodeIndex(nodeIndex, lView);
} else {
nodeIndex = findViaNativeElement(lView, target);
if (nodeIndex == -1) {
return null;
}
}
const native = unwrapRNode(lView[nodeIndex]);
const existingCtx = readPatchedData(native);
const context2 = existingCtx && !Array.isArray(existingCtx) ? existingCtx : createLContext(lView, nodeIndex, native);
if (component && context2.component === void 0) {
context2.component = component;
attachPatchData(context2.component, context2);
}
if (directives && context2.directives === void 0) {
context2.directives = directives;
for (let i = 0; i < directives.length; i++) {
attachPatchData(directives[i], context2);
}
}
attachPatchData(context2.native, context2);
mpValue = context2;
}
} else {
const rElement = target;
ngDevMode && assertDomNode(rElement);
let parent = rElement;
while (parent = parent.parentNode) {
const parentContext = readPatchedData(parent);
if (parentContext) {
const lView = Array.isArray(parentContext) ? parentContext : parentContext.lView;
if (!lView) {
return null;
}
const index = findViaNativeElement(lView, rElement);
if (index >= 0) {
const native = unwrapRNode(lView[index]);
const context2 = createLContext(lView, index, native);
attachPatchData(native, context2);
mpValue = context2;
break;
}
}
}
}
return mpValue || null;
}
function createLContext(lView, nodeIndex, native) {
return new LContext(lView[ID], nodeIndex, native);
}
function getComponentViewByInstance(componentInstance) {
let patchedData = readPatchedData(componentInstance);
let lView;
if (isLView(patchedData)) {
const contextLView = patchedData;
const nodeIndex = findViaComponent(contextLView, componentInstance);
lView = getComponentLViewByIndex(nodeIndex, contextLView);
const context2 = createLContext(contextLView, nodeIndex, lView[HOST]);
context2.component = componentInstance;
attachPatchData(componentInstance, context2);
attachPatchData(context2.native, context2);
} else {
const context2 = patchedData;
const contextLView = context2.lView;
ngDevMode && assertLView(contextLView);
lView = getComponentLViewByIndex(context2.nodeIndex, contextLView);
}
return lView;
}
var MONKEY_PATCH_KEY_NAME = "__ngContext__";
function attachPatchData(target, data) {
ngDevMode && assertDefined(target, "Target expected");
if (isLView(data)) {
target[MONKEY_PATCH_KEY_NAME] = data[ID];
registerLView(data);
} else {
target[MONKEY_PATCH_KEY_NAME] = data;
}
}
function readPatchedData(target) {
ngDevMode && assertDefined(target, "Target expected");
const data = target[MONKEY_PATCH_KEY_NAME];
return typeof data === "number" ? getLViewById(data) : data || null;
}
function readPatchedLView(target) {
const value = readPatchedData(target);
if (value) {
return isLView(value) ? value : value.lView;
}
return null;
}
function isComponentInstance(instance) {
return instance && instance.constructor && instance.constructor.\u0275cmp;
}
function isDirectiveInstance(instance) {
return instance && instance.constructor && instance.constructor.\u0275dir;
}
function findViaNativeElement(lView, target) {
const tView = lView[TVIEW];
for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {
if (unwrapRNode(lView[i]) === target) {
return i;
}
}
return -1;
}
function traverseNextElement(tNode) {
if (tNode.child) {
return tNode.child;
} else if (tNode.next) {
return tNode.next;
} else {
while (tNode.parent && !tNode.parent.next) {
tNode = tNode.parent;
}
return tNode.parent && tNode.parent.next;
}
}
function findViaComponent(lView, componentInstance) {
const componentIndices = lView[TVIEW].components;
if (componentIndices) {
for (let i = 0; i < componentIndices.length; i++) {
const elementComponentIndex = componentIndices[i];
const componentView = getComponentLViewByIndex(elementComponentIndex, lView);
if (componentView[CONTEXT] === componentInstance) {
return elementComponentIndex;
}
}
} else {
const rootComponentView = getComponentLViewByIndex(HEADER_OFFSET, lView);
const rootComponent = rootComponentView[CONTEXT];
if (rootComponent === componentInstance) {
return HEADER_OFFSET;
}
}
return -1;
}
function findViaDirective(lView, directiveInstance) {
let tNode = lView[TVIEW].firstChild;
while (tNode) {
const directiveIndexStart = tNode.directiveStart;
const directiveIndexEnd = tNode.directiveEnd;
for (let i = directiveIndexStart; i < directiveIndexEnd; i++) {
if (lView[i] === directiveInstance) {
return tNode.index;
}
}
tNode = traverseNextElement(tNode);
}
return -1;
}
function getDirectivesAtNodeIndex(nodeIndex, lView) {
const tNode = lView[TVIEW].data[nodeIndex];
if (tNode.directiveStart === 0)
return EMPTY_ARRAY;
const results = [];
for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {
const directiveInstance = lView[i];
if (!isComponentInstance(directiveInstance)) {
results.push(directiveInstance);
}
}
return results;
}
function getComponentAtNodeIndex(nodeIndex, lView) {
const tNode = lView[TVIEW].data[nodeIndex];
return isComponentHost(tNode) ? lView[tNode.directiveStart + tNode.componentOffset] : null;
}
function getRootView(componentOrLView) {
ngDevMode && assertDefined(componentOrLView, "component");
let lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView);
while (lView && !isRootView(lView)) {
lView = getLViewParent(lView);
}
ngDevMode && assertLView(lView);
return lView;
}
function getRootContext(viewOrComponent) {
const rootView = getRootView(viewOrComponent);
ngDevMode && assertDefined(rootView[CONTEXT], "Root view has no context. Perhaps it is disconnected?");
return rootView[CONTEXT];
}
function getFirstLContainer(lView) {
return getNearestLContainer(lView[CHILD_HEAD]);
}
function getNextLContainer(container) {
return getNearestLContainer(container[NEXT]);
}
function getNearestLContainer(viewOrContainer) {
while (viewOrContainer !== null && !isLContainer(viewOrContainer)) {
viewOrContainer = viewOrContainer[NEXT];
}
return viewOrContainer;
}
function getComponent(element) {
ngDevMode && assertDomElement(element);
const context2 = getLContext(element);
if (context2 === null)
return null;
if (context2.component === void 0) {
const lView = context2.lView;
if (lView === null) {
return null;
}
context2.component = getComponentAtNodeIndex(context2.nodeIndex, lView);
}
return context2.component;
}
function getContext(element) {
assertDomElement(element);
const context2 = getLContext(element);
const lView = context2 ? context2.lView : null;
return lView === null ? null : lView[CONTEXT];
}
function getOwningComponent(elementOrDir) {
const context2 = getLContext(elementOrDir);
let lView = context2 ? context2.lView : null;
if (lView === null)
return null;
let parent;
while (lView[TVIEW].type === 2 && (parent = getLViewParent(lView))) {
lView = parent;
}
return isRootView(lView) ? null : lView[CONTEXT];
}
function getRootComponents(elementOrDir) {
const lView = readPatchedLView(elementOrDir);
return lView !== null ? [getRootContext(lView)] : [];
}
function getInjector(elementOrDir) {
const context2 = getLContext(elementOrDir);
const lView = context2 ? context2.lView : null;
if (lView === null)
return Injector.NULL;
const tNode = lView[TVIEW].data[context2.nodeIndex];
return new NodeInjector(tNode, lView);
}
function getDirectives(node) {
if (node instanceof Text) {
return [];
}
const context2 = getLContext(node);
const lView = context2 ? context2.lView : null;
if (lView === null) {
return [];
}
const tView = lView[TVIEW];
const nodeIndex = context2.nodeIndex;
if (!tView?.data[nodeIndex]) {
return [];
}
if (context2.directives === void 0) {
context2.directives = getDirectivesAtNodeIndex(nodeIndex, lView);
}
return context2.directives === null ? [] : [...context2.directives];
}
var Framework;
(function(Framework2) {
Framework2["Angular"] = "angular";
Framework2["ACX"] = "acx";
Framework2["Wiz"] = "wiz";
})(Framework || (Framework = {}));
var AcxChangeDetectionStrategy;
(function(AcxChangeDetectionStrategy2) {
AcxChangeDetectionStrategy2[AcxChangeDetectionStrategy2["Default"] = 0] = "Default";
AcxChangeDetectionStrategy2[AcxChangeDetectionStrategy2["OnPush"] = 1] = "OnPush";
})(AcxChangeDetectionStrategy || (AcxChangeDetectionStrategy = {}));
var AcxViewEncapsulation;
(function(AcxViewEncapsulation2) {
AcxViewEncapsulation2[AcxViewEncapsulation2["Emulated"] = 0] = "Emulated";
AcxViewEncapsulation2[AcxViewEncapsulation2["None"] = 1] = "None";
})(AcxViewEncapsulation || (AcxViewEncapsulation = {}));
function getDirectiveMetadata$1(directiveOrComponentInstance) {
const { constructor } = directiveOrComponentInstance;
if (!constructor) {
throw new Error("Unable to find the instance constructor");
}
const componentDef = getComponentDef(constructor);
if (componentDef) {
const inputs = extractInputDebugMetadata(componentDef.inputs);
return {
inputs,
outputs: componentDef.outputs,
encapsulation: componentDef.encapsulation,
changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush : ChangeDetectionStrategy.Default
};
}
const directiveDef = getDirectiveDef(constructor);
if (directiveDef) {
const inputs = extractInputDebugMetadata(directiveDef.inputs);
return { inputs, outputs: directiveDef.outputs };
}
return null;
}
function getHostElement(componentOrDirective) {
return getLContext(componentOrDirective).native;
}
function getListeners(element) {
ngDevMode && assertDomElement(element);
const lContext = getLContext(element);
const lView = lContext === null ? null : lContext.lView;
if (lView === null)
return [];
const tView = lView[TVIEW];
const lCleanup = lView[CLEANUP];
const tCleanup = tView.cleanup;
const listeners = [];
if (tCleanup && lCleanup) {
for (let i = 0; i < tCleanup.length; ) {
const firstParam = tCleanup[i++];
const secondParam = tCleanup[i++];
if (typeof firstParam === "string") {
const name = firstParam;
const listenerElement = unwrapRNode(lView[secondParam]);
const callback = lCleanup[tCleanup[i++]];
const useCaptureOrIndx = tCleanup[i++];
const type = typeof useCaptureOrIndx === "boolean" || useCaptureOrIndx >= 0 ? "dom" : "output";
const useCapture = typeof useCaptureOrIndx === "boolean" ? useCaptureOrIndx : false;
if (element == listenerElement) {
listeners.push({ element, name, callback, useCapture, type });
}
}
}
}
listeners.sort(sortListeners);
return listeners;
}
function sortListeners(a, b) {
if (a.name == b.name)
return 0;
return a.name < b.name ? -1 : 1;
}
function assertDomElement(value) {
if (typeof Element !== "undefined" && !(value instanceof Element)) {
throw new Error("Expecting instance of DOM Element");
}
}
function extractInputDebugMetadata(inputs) {
const res = {};
for (const key in inputs) {
if (inputs.hasOwnProperty(key)) {
const value = inputs[key];
if (value !== void 0) {
res[key] = value[0];
}
}
}
return res;
}
var DOCUMENT2 = void 0;
function setDocument(document2) {
DOCUMENT2 = document2;
}
function getDocument() {
if (DOCUMENT2 !== void 0) {
return DOCUMENT2;
} else if (typeof document !== "undefined") {
return document;
}
throw new RuntimeError(210, (typeof ngDevMode === "undefined" || ngDevMode) && `The document object is not available in this context. Make sure the DOCUMENT injection token is provided.`);
}
var APP_ID = new InjectionToken(ngDevMode ? "AppId" : "", {
providedIn: "root",
factory: () => DEFAULT_APP_ID
});
var DEFAULT_APP_ID = "ng";
var PLATFORM_INITIALIZER = new InjectionToken(ngDevMode ? "Platform Initializer" : "");
var PLATFORM_ID = new InjectionToken(ngDevMode ? "Platform ID" : "", {
providedIn: "platform",
factory: () => "unknown"
// set a default platform name, when none set explicitly
});
var PACKAGE_ROOT_URL = new InjectionToken(ngDevMode ? "Application Packages Root URL" : "");
var ANIMATION_MODULE_TYPE = new InjectionToken(ngDevMode ? "AnimationModuleType" : "");
var CSP_NONCE = new InjectionToken(ngDevMode ? "CSP nonce" : "", {
providedIn: "root",
factory: () => {
return getDocument().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce") || null;
}
});
var IMAGE_CONFIG_DEFAULTS = {
breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],
placeholderResolution: 30,
disableImageSizeWarning: false,
disableImageLazyLoadWarning: false
};
var IMAGE_CONFIG = new InjectionToken(ngDevMode ? "ImageConfig" : "", {
providedIn: "root",
factory: () => IMAGE_CONFIG_DEFAULTS
});
function makeStateKey(key) {
return key;
}
function initTransferState() {
const transferState = new TransferState();
if (true) {
transferState.store = retrieveTransferredState(getDocument(), inject2(APP_ID));
}
return transferState;
}
var TransferState = class _TransferState {
/** @nocollapse */
static \u0275prov = (
/** @pureOrBreakMyCode */
/* @__PURE__ */ \u0275\u0275defineInjectable({
token: _TransferState,
providedIn: "root",
factory: initTransferState
})
);
/** @internal */
store = {};
onSerializeCallbacks = {};
/**
* Get the value corresponding to a key. Return `defaultValue` if key is not found.
*/
get(key, defaultValue) {
return this.store[key] !== void 0 ? 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() {
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).replace(/</g, "\\u003C");
}
};
function retrieveTransferredState(doc, appId) {
const script = doc.getElementById(appId + "-state");
if (script?.textContent) {
try {
return JSON.parse(script.textContent);
} catch (e) {
console.warn("Exception while restoring TransferState for app " + appId, e);
}
}
return {};
}
var REFERENCE_NODE_HOST = "h";
var REFERENCE_NODE_BODY = "b";
var NUM_ROOT_NODES = "r";
var DEFER_BLOCK_ID = "di";
var DEFER_BLOCK_STATE$1 = "s";
var DEFER_PARENT_BLOCK_ID = "p";
var IS_HYDRATION_DOM_REUSE_ENABLED = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "IS_HYDRATION_DOM_REUSE_ENABLED" : "");
var PRESERVE_HOST_CONTENT_DEFAULT = false;
var PRESERVE_HOST_CONTENT = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "PRESERVE_HOST_CONTENT" : "", {
providedIn: "root",
factory: () => PRESERVE_HOST_CONTENT_DEFAULT
});
var IS_I18N_HYDRATION_ENABLED = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "IS_I18N_HYDRATION_ENABLED" : "");
var IS_EVENT_REPLAY_ENABLED = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "IS_EVENT_REPLAY_ENABLED" : "");
var IS_INCREMENTAL_HYDRATION_ENABLED = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "IS_INCREMENTAL_HYDRATION_ENABLED" : "");
var JSACTION_BLOCK_ELEMENT_MAP = new InjectionToken(ngDevMode ? "JSACTION_BLOCK_ELEMENT_MAP" : "", {
providedIn: "root",
factory: () => /* @__PURE__ */ new Map()
});
var IS_ENABLED_BLOCKING_INITIAL_NAVIGATION = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "IS_ENABLED_BLOCKING_INITIAL_NAVIGATION" : "");
var eventListenerOptions = {
passive: true,
capture: true
};
var hoverTriggers = /* @__PURE__ */ new WeakMap();
var interactionTriggers = /* @__PURE__ */ new WeakMap();
var viewportTriggers = /* @__PURE__ */ new WeakMap();
var interactionEventNames = ["click", "keydown"];
var hoverEventNames = ["mouseenter", "mouseover", "focusin"];
var intersectionObserver = null;
var observedViewportElements = 0;
var DeferEventEntry = class {
callbacks = /* @__PURE__ */ new Set();
listener = () => {
for (const callback of this.callbacks) {
callback();
}
};
};
function onInteraction(trigger, callback) {
let entry = interactionTriggers.get(trigger);
if (!entry) {
entry = new DeferEventEntry();
interactionTriggers.set(trigger, entry);
for (const name of interactionEventNames) {
trigger.addEventListener(name, entry.listener, eventListenerOptions);
}
}
entry.callbacks.add(callback);
return () => {
const { callbacks, listener } = entry;
callbacks.delete(callback);
if (callbacks.size === 0) {
interactionTriggers.delete(trigger);
for (const name of interactionEventNames) {
trigger.removeEventListener(name, listener, eventListenerOptions);
}
}
};
}
function onHover(trigger, callback) {
let entry = hoverTriggers.get(trigger);
if (!entry) {
entry = new DeferEventEntry();
hoverTriggers.set(trigger, entry);
for (const name of hoverEventNames) {
trigger.addEventListener(name, entry.listener, eventListenerOptions);
}
}
entry.callbacks.add(callback);
return () => {
const { callbacks, listener } = entry;
callbacks.delete(callback);
if (callbacks.size === 0) {
for (const name of hoverEventNames) {
trigger.removeEventListener(name, listener, eventListenerOptions);
}
hoverTriggers.delete(trigger);
}
};
}
function createIntersectionObserver() {
return new IntersectionObserver((entries) => {
for (const current of entries) {
if (current.isIntersecting && viewportTriggers.has(current.target)) {
viewportTriggers.get(current.target).listener();
}
}
});
}
function onViewport(trigger, callback, observerFactoryFn) {
let entry = viewportTriggers.get(trigger);
intersectionObserver = intersectionObserver || observerFactoryFn();
if (!entry) {
entry = new DeferEventEntry();
intersectionObserver.observe(trigger);
viewportTriggers.set(trigger, entry);
observedViewportElements++;
}
entry.callbacks.add(callback);
return () => {
if (!viewportTriggers.has(trigger)) {
return;
}
entry.callbacks.delete(callback);
if (entry.callbacks.size === 0) {
intersectionObserver?.unobserve(trigger);
viewportTriggers.delete(trigger);
observedViewportElements--;
}
if (observedViewportElements === 0) {
intersectionObserver?.disconnect();
intersectionObserver = null;
}
};
}
var JSACTION_EVENT_CONTRACT = new InjectionToken(ngDevMode ? "EVENT_CONTRACT_DETAILS" : "", {
providedIn: "root",
factory: () => ({})
});
var _stashEventListenerImpl = (lView, target, eventName, wrappedListener) => {
};
function stashEventListenerImpl(lView, target, eventName, wrappedListener) {
_stashEventListenerImpl(lView, target, eventName, wrappedListener);
}
var DEHYDRATED_BLOCK_REGISTRY = new InjectionToken(ngDevMode ? "DEHYDRATED_BLOCK_REGISTRY" : "");
function isDetachedByI18n(tNode) {
return (tNode.flags & 32) === 32;
}
var TRANSFER_STATE_TOKEN_ID = "__nghData__";
var NGH_DATA_KEY = makeStateKey(TRANSFER_STATE_TOKEN_ID);
var TRANSFER_STATE_DEFER_BLOCKS_INFO = "__nghDeferData__";
var NGH_DEFER_BLOCKS_KEY = makeStateKey(TRANSFER_STATE_DEFER_BLOCKS_INFO);
function isInternalHydrationTransferStateKey(key) {
return key === TRANSFER_STATE_TOKEN_ID || key === TRANSFER_STATE_DEFER_BLOCKS_INFO;
}
var _retrieveHydrationInfoImpl = () => null;
function retrieveHydrationInfo(rNode, injector, isRootView2 = false) {
return _retrieveHydrationInfoImpl(rNode, injector, isRootView2);
}
function getLNodeForHydration(viewRef) {
let lView = viewRef._lView;
const tView = lView[TVIEW];
if (tView.type === 2) {
return null;
}
if (isRootView(lView)) {
lView = lView[HEADER_OFFSET];
}
return lView;
}
var HydrationStatus;
(function(HydrationStatus2) {
HydrationStatus2["Hydrated"] = "hydrated";
HydrationStatus2["Skipped"] = "skipped";
HydrationStatus2["Mismatched"] = "mismatched";
})(HydrationStatus || (HydrationStatus = {}));
var HYDRATION_INFO_KEY = "__ngDebugHydrationInfo__";
function patchHydrationInfo(node, info) {
node[HYDRATION_INFO_KEY] = info;
}
function markRNodeAsHavingHydrationMismatch(node, expectedNodeDetails = null, actualNodeDetails = null) {
if (!ngDevMode) {
throw new Error("Calling `markRNodeAsMismatchedByHydration` in prod mode is not supported and likely a mistake.");
}
while (node && !getComponent(node)) {
node = node?.parentNode;
}
if (node) {
patchHydrationInfo(node, {
status: HydrationStatus.Mismatched,
expectedNodeDetails,
actualNodeDetails
});
}
}
function isIncrementalHydrationEnabled(injector) {
return injector.get(IS_INCREMENTAL_HYDRATION_ENABLED, false, {
optional: true
});
}
function assertIncrementalHydrationIsConfigured(injector) {
if (!isIncrementalHydrationEnabled(injector)) {
throw new RuntimeError(508, "Angular has detected that some `@defer` blocks use `hydrate` triggers, but incremental hydration was not enabled. Please ensure that the `withIncrementalHydration()` call is added as an argument for the `provideClientHydration()` function call in your application config.");
}
}
function assertSsrIdDefined(ssrUniqueId) {
assertDefined(ssrUniqueId, "Internal error: expecting an SSR id for a defer block that should be hydrated, but the id is not present");
}
function getParentBlockHydrationQueue(deferBlockId, injector) {
const dehydratedBlockRegistry = injector.get(DEHYDRATED_BLOCK_REGISTRY);
const transferState = injector.get(TransferState);
const deferBlockParents = transferState.get(NGH_DEFER_BLOCKS_KEY, {});
let isTopMostDeferBlock = false;
let currentBlockId = deferBlockId;
let parentBlockPromise = null;
const hydrationQueue = [];
while (!isTopMostDeferBlock && currentBlockId) {
ngDevMode && assertEqual(hydrationQueue.indexOf(currentBlockId), -1, "Internal error: defer block hierarchy has a cycle.");
isTopMostDeferBlock = dehydratedBlockRegistry.has(currentBlockId);
const hydratingParentBlock = dehydratedBlockRegistry.hydrating.get(currentBlockId);
if (parentBlockPromise === null && hydratingParentBlock != null) {
parentBlockPromise = hydratingParentBlock.promise;
break;
}
hydrationQueue.unshift(currentBlockId);
currentBlockId = deferBlockParents[currentBlockId][DEFER_PARENT_BLOCK_ID];
}
return { parentBlockPromise, hydrationQueue };
}
function refreshContentQueries(tView, lView) {
const contentQueries = tView.contentQueries;
if (contentQueries !== null) {
const prevConsumer = setActiveConsumer(null);
try {
for (let i = 0; i < contentQueries.length; i += 2) {
const queryStartIdx = contentQueries[i];
const directiveDefIdx = contentQueries[i + 1];
if (directiveDefIdx !== -1) {
const directiveDef = tView.data[directiveDefIdx];
ngDevMode && assertDefined(directiveDef, "DirectiveDef not found.");
ngDevMode && assertDefined(directiveDef.contentQueries, "contentQueries function should be defined");
setCurrentQueryIndex(queryStartIdx);
directiveDef.contentQueries(2, lView[directiveDefIdx], directiveDefIdx);
}
}
} finally {
setActiveConsumer(prevConsumer);
}
}
}
function executeViewQueryFn(flags, viewQueryFn, component) {
ngDevMode && assertDefined(viewQueryFn, "View queries function to execute must be defined.");
setCurrentQueryIndex(0);
const prevConsumer = setActiveConsumer(null);
try {
viewQueryFn(flags, component);
} finally {
setActiveConsumer(prevConsumer);
}
}
function executeContentQueries(tView, tNode, lView) {
if (isContentQueryHost(tNode)) {
const prevConsumer = setActiveConsumer(null);
try {
const start = tNode.directiveStart;
const end = tNode.directiveEnd;
for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {
const def = tView.data[directiveIndex];
if (def.contentQueries) {
const directiveInstance = lView[directiveIndex];
ngDevMode && assertDefined(directiveIndex, "Incorrect reference to a directive defining a content query");
def.contentQueries(1, directiveInstance, directiveIndex);
}
}
} finally {
setActiveConsumer(prevConsumer);
}
}
}
var ViewEncapsulation;
(function(ViewEncapsulation3) {
ViewEncapsulation3[ViewEncapsulation3["Emulated"] = 0] = "Emulated";
ViewEncapsulation3[ViewEncapsulation3["None"] = 2] = "None";
ViewEncapsulation3[ViewEncapsulation3["ShadowDom"] = 3] = "ShadowDom";
})(ViewEncapsulation || (ViewEncapsulation = {}));
var policy$1;
function getPolicy$1() {
if (policy$1 === void 0) {
policy$1 = null;
if (_global.trustedTypes) {
try {
policy$1 = _global.trustedTypes.createPolicy("angular", {
createHTML: (s) => s,
createScript: (s) => s,
createScriptURL: (s) => s
});
} catch {
}
}
}
return policy$1;
}
function trustedHTMLFromString(html) {
return getPolicy$1()?.createHTML(html) || html;
}
function trustedScriptURLFromString(url) {
return getPolicy$1()?.createScriptURL(url) || url;
}
var policy;
function getPolicy() {
if (policy === void 0) {
policy = null;
if (_global.trustedTypes) {
try {
policy = _global.trustedTypes.createPolicy("angular#unsafe-bypass", {
createHTML: (s) => s,
createScript: (s) => s,
createScriptURL: (s) => s
});
} catch {
}
}
}
return policy;
}
function trustedHTMLFromStringBypass(html) {
return getPolicy()?.createHTML(html) || html;
}
function trustedScriptFromStringBypass(script) {
return getPolicy()?.createScript(script) || script;
}
function trustedScriptURLFromStringBypass(url) {
return getPolicy()?.createScriptURL(url) || url;
}
var SafeValueImpl = class {
changingThisBreaksApplicationSecurity;
constructor(changingThisBreaksApplicationSecurity) {
this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;
}
toString() {
return `SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${XSS_SECURITY_URL})`;
}
};
var SafeHtmlImpl = class extends SafeValueImpl {
getTypeName() {
return "HTML";
}
};
var SafeStyleImpl = class extends SafeValueImpl {
getTypeName() {
return "Style";
}
};
var SafeScriptImpl = class extends SafeValueImpl {
getTypeName() {
return "Script";
}
};
var SafeUrlImpl = class extends SafeValueImpl {
getTypeName() {
return "URL";
}
};
var SafeResourceUrlImpl = class extends SafeValueImpl {
getTypeName() {
return "ResourceURL";
}
};
function unwrapSafeValue(value) {
return value instanceof SafeValueImpl ? value.changingThisBreaksApplicationSecurity : value;
}
function allowSanitizationBypassAndThrow(value, type) {
const actualType = getSanitizationBypassType(value);
if (actualType != null && actualType !== type) {
if (actualType === "ResourceURL" && type === "URL")
return true;
throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`);
}
return actualType === type;
}
function getSanitizationBypassType(value) {
return value instanceof SafeValueImpl && value.getTypeName() || null;
}
function bypassSanitizationTrustHtml(trustedHtml) {
return new SafeHtmlImpl(trustedHtml);
}
function bypassSanitizationTrustStyle(trustedStyle) {
return new SafeStyleImpl(trustedStyle);
}
function bypassSanitizationTrustScript(trustedScript) {
return new SafeScriptImpl(trustedScript);
}
function bypassSanitizationTrustUrl(trustedUrl) {
return new SafeUrlImpl(trustedUrl);
}
function bypassSanitizationTrustResourceUrl(trustedResourceUrl) {
return new SafeResourceUrlImpl(trustedResourceUrl);
}
function getInertBodyHelper(defaultDoc) {
const inertDocumentHelper = new InertDocumentHelper(defaultDoc);
return isDOMParserAvailable() ? new DOMParserHelper(inertDocumentHelper) : inertDocumentHelper;
}
var DOMParserHelper = class {
inertDocumentHelper;
constructor(inertDocumentHelper) {
this.inertDocumentHelper = inertDocumentHelper;
}
getInertBodyElement(html) {
html = "<body><remove></remove>" + html;
try {
const body = new window.DOMParser().parseFromString(trustedHTMLFromString(html), "text/html").body;
if (body === null) {
return this.inertDocumentHelper.getInertBodyElement(html);
}
body.firstChild?.remove();
return body;
} catch {
return null;
}
}
};
var InertDocumentHelper = class {
defaultDoc;
inertDocument;
constructor(defaultDoc) {
this.defaultDoc = defaultDoc;
this.inertDocument = this.defaultDoc.implementation.createHTMLDocument("sanitization-inert");
}
getInertBodyElement(html) {
const templateEl = this.inertDocument.createElement("template");
templateEl.innerHTML = trustedHTMLFromString(html);
return templateEl;
}
};
function isDOMParserAvailable() {
try {
return !!new window.DOMParser().parseFromString(trustedHTMLFromString(""), "text/html");
} catch {
return false;
}
}
var SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;
function _sanitizeUrl(url) {
url = String(url);
if (url.match(SAFE_URL_PATTERN))
return url;
if (typeof ngDevMode === "undefined" || ngDevMode) {
console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`);
}
return "unsafe:" + url;
}
function tagSet(tags) {
const res = {};
for (const t of tags.split(","))
res[t] = true;
return res;
}
function merge2(...sets) {
const res = {};
for (const s of sets) {
for (const v in s) {
if (s.hasOwnProperty(v))
res[v] = true;
}
}
return res;
}
var VOID_ELEMENTS = tagSet("area,br,col,hr,img,wbr");
var OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr");
var OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet("rp,rt");
var OPTIONAL_END_TAG_ELEMENTS = merge2(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);
var BLOCK_ELEMENTS = merge2(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul"));
var INLINE_ELEMENTS = merge2(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video"));
var VALID_ELEMENTS = merge2(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);
var URI_ATTRS = tagSet("background,cite,href,itemtype,longdesc,poster,src,xlink:href");
var HTML_ATTRS = tagSet("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width");
var ARIA_ATTRS = tagSet("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext");
var VALID_ATTRS = merge2(URI_ATTRS, HTML_ATTRS, ARIA_ATTRS);
var SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet("script,style,template");
var SanitizingHtmlSerializer = class {
// Explicitly track if something was stripped, to avoid accidentally warning of sanitization just
// because characters were re-encoded.
sanitizedSomething = false;
buf = [];
sanitizeChildren(el) {
let current = el.firstChild;
let traverseContent = true;
let parentNodes = [];
while (current) {
if (current.nodeType === Node.ELEMENT_NODE) {
traverseContent = this.startElement(current);
} else if (current.nodeType === Node.TEXT_NODE) {
this.chars(current.nodeValue);
} else {
this.sanitizedSomething = true;
}
if (traverseContent && current.firstChild) {
parentNodes.push(current);
current = getFirstChild(current);
continue;
}
while (current) {
if (current.nodeType === Node.ELEMENT_NODE) {
this.endElement(current);
}
let next = getNextSibling(current);
if (next) {
current = next;
break;
}
current = parentNodes.pop();
}
}
return this.buf.join("");
}
/**
* Sanitizes an opening element tag (if valid) and returns whether the element's contents should
* be traversed. Element content must always be traversed (even if the element itself is not
* valid/safe), unless the element is one of `SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS`.
*
* @param element The element to sanitize.
* @return True if the element's contents should be traversed.
*/
startElement(element) {
const tagName = getNodeName(element).toLowerCase();
if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {
this.sanitizedSomething = true;
return !SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName);
}
this.buf.push("<");
this.buf.push(tagName);
const elAttrs = element.attributes;
for (let i = 0; i < elAttrs.length; i++) {
const elAttr = elAttrs.item(i);
const attrName = elAttr.name;
const lower = attrName.toLowerCase();
if (!VALID_ATTRS.hasOwnProperty(lower)) {
this.sanitizedSomething = true;
continue;
}
let value = elAttr.value;
if (URI_ATTRS[lower])
value = _sanitizeUrl(value);
this.buf.push(" ", attrName, '="', encodeEntities(value), '"');
}
this.buf.push(">");
return true;
}
endElement(current) {
const tagName = getNodeName(current).toLowerCase();
if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {
this.buf.push("</");
this.buf.push(tagName);
this.buf.push(">");
}
}
chars(chars) {
this.buf.push(encodeEntities(chars));
}
};
function isClobberedElement(parentNode, childNode) {
return (parentNode.compareDocumentPosition(childNode) & Node.DOCUMENT_POSITION_CONTAINED_BY) !== Node.DOCUMENT_POSITION_CONTAINED_BY;
}
function getNextSibling(node) {
const nextSibling = node.nextSibling;
if (nextSibling && node !== nextSibling.previousSibling) {
throw clobberedElementError(nextSibling);
}
return nextSibling;
}
function getFirstChild(node) {
const firstChild = node.firstChild;
if (firstChild && isClobberedElement(node, firstChild)) {
throw clobberedElementError(firstChild);
}
return firstChild;
}
function getNodeName(node) {
const nodeName = node.nodeName;
return typeof nodeName === "string" ? nodeName : "FORM";
}
function clobberedElementError(node) {
return new Error(`Failed to sanitize html because the element is clobbered: ${node.outerHTML}`);
}
var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
var NON_ALPHANUMERIC_REGEXP = /([^\#-~ |!])/g;
function encodeEntities(value) {
return value.replace(/&/g, "&").replace(SURROGATE_PAIR_REGEXP, function(match) {
const hi = match.charCodeAt(0);
const low = match.charCodeAt(1);
return "&#" + ((hi - 55296) * 1024 + (low - 56320) + 65536) + ";";
}).replace(NON_ALPHANUMERIC_REGEXP, function(match) {
return "&#" + match.charCodeAt(0) + ";";
}).replace(/</g, "<").replace(/>/g, ">");
}
var inertBodyHelper;
function _sanitizeHtml(defaultDoc, unsafeHtmlInput) {
let inertBodyElement = null;
try {
inertBodyHelper = inertBodyHelper || getInertBodyHelper(defaultDoc);
let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : "";
inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
let mXSSAttempts = 5;
let parsedHtml = unsafeHtml;
do {
if (mXSSAttempts === 0) {
throw new Error("Failed to sanitize html because the input is unstable");
}
mXSSAttempts--;
unsafeHtml = parsedHtml;
parsedHtml = inertBodyElement.innerHTML;
inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
} while (unsafeHtml !== parsedHtml);
const sanitizer = new SanitizingHtmlSerializer();
const safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);
if ((typeof ngDevMode === "undefined" || ngDevMode) && sanitizer.sanitizedSomething) {
console.warn(`WARNING: sanitizing HTML stripped some content, see ${XSS_SECURITY_URL}`);
}
return trustedHTMLFromString(safeHtml);
} finally {
if (inertBodyElement) {
const parent = getTemplateContent(inertBodyElement) || inertBodyElement;
while (parent.firstChild) {
parent.firstChild.remove();
}
}
}
}
function getTemplateContent(el) {
return "content" in el && isTemplateElement(el) ? el.content : null;
}
function isTemplateElement(el) {
return el.nodeType === Node.ELEMENT_NODE && el.nodeName === "TEMPLATE";
}
var SecurityContext;
(function(SecurityContext2) {
SecurityContext2[SecurityContext2["NONE"] = 0] = "NONE";
SecurityContext2[SecurityContext2["HTML"] = 1] = "HTML";
SecurityContext2[SecurityContext2["STYLE"] = 2] = "STYLE";
SecurityContext2[SecurityContext2["SCRIPT"] = 3] = "SCRIPT";
SecurityContext2[SecurityContext2["URL"] = 4] = "URL";
SecurityContext2[SecurityContext2["RESOURCE_URL"] = 5] = "RESOURCE_URL";
})(SecurityContext || (SecurityContext = {}));
function \u0275\u0275sanitizeHtml(unsafeHtml) {
const sanitizer = getSanitizer();
if (sanitizer) {
return trustedHTMLFromStringBypass(sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || "");
}
if (allowSanitizationBypassAndThrow(
unsafeHtml,
"HTML"
/* BypassType.Html */
)) {
return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml));
}
return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml));
}
function \u0275\u0275sanitizeStyle(unsafeStyle) {
const sanitizer = getSanitizer();
if (sanitizer) {
return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || "";
}
if (allowSanitizationBypassAndThrow(
unsafeStyle,
"Style"
/* BypassType.Style */
)) {
return unwrapSafeValue(unsafeStyle);
}
return renderStringify(unsafeStyle);
}
function \u0275\u0275sanitizeUrl(unsafeUrl) {
const sanitizer = getSanitizer();
if (sanitizer) {
return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || "";
}
if (allowSanitizationBypassAndThrow(
unsafeUrl,
"URL"
/* BypassType.Url */
)) {
return unwrapSafeValue(unsafeUrl);
}
return _sanitizeUrl(renderStringify(unsafeUrl));
}
function \u0275\u0275sanitizeResourceUrl(unsafeResourceUrl) {
const sanitizer = getSanitizer();
if (sanitizer) {
return trustedScriptURLFromStringBypass(sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || "");
}
if (allowSanitizationBypassAndThrow(
unsafeResourceUrl,
"ResourceURL"
/* BypassType.ResourceUrl */
)) {
return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
}
throw new RuntimeError(904, ngDevMode && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);
}
function \u0275\u0275sanitizeScript(unsafeScript) {
const sanitizer = getSanitizer();
if (sanitizer) {
return trustedScriptFromStringBypass(sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || "");
}
if (allowSanitizationBypassAndThrow(
unsafeScript,
"Script"
/* BypassType.Script */
)) {
return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
}
throw new RuntimeError(905, ngDevMode && "unsafe value used in a script context");
}
function \u0275\u0275trustConstantHtml(html) {
if (ngDevMode && (!Array.isArray(html) || !Array.isArray(html.raw) || html.length !== 1)) {
throw new Error(`Unexpected interpolation in trusted HTML constant: ${html.join("?")}`);
}
return trustedHTMLFromString(html[0]);
}
function \u0275\u0275trustConstantResourceUrl(url) {
if (ngDevMode && (!Array.isArray(url) || !Array.isArray(url.raw) || url.length !== 1)) {
throw new Error(`Unexpected interpolation in trusted URL constant: ${url.join("?")}`);
}
return trustedScriptURLFromString(url[0]);
}
function getUrlSanitizer(tag, prop) {
if (prop === "src" && (tag === "embed" || tag === "frame" || tag === "iframe" || tag === "media" || tag === "script") || prop === "href" && (tag === "base" || tag === "link")) {
return \u0275\u0275sanitizeResourceUrl;
}
return \u0275\u0275sanitizeUrl;
}
function \u0275\u0275sanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {
return getUrlSanitizer(tag, prop)(unsafeUrl);
}
function validateAgainstEventProperties(name) {
if (name.toLowerCase().startsWith("on")) {
const errorMessage = `Binding to event property '${name}' is disallowed for security reasons, please use (${name.slice(2)})=...
If '${name}' is a directive input, make sure the directive is imported by the current module.`;
throw new RuntimeError(306, errorMessage);
}
}
function validateAgainstEventAttributes(name) {
if (name.toLowerCase().startsWith("on")) {
const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, please use (${name.slice(2)})=...`;
throw new RuntimeError(306, errorMessage);
}
}
function getSanitizer() {
const lView = getLView();
return lView && lView[ENVIRONMENT].sanitizer;
}
var COMMENT_DISALLOWED = /^>|^->|<!--|-->|--!>|<!-$/g;
var COMMENT_DELIMITER = /(<|>)/g;
var COMMENT_DELIMITER_ESCAPED = "\u200B$1\u200B";
function escapeCommentText(value) {
return value.replace(COMMENT_DISALLOWED, (text) => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));
}
var NG_REFLECT_ATTRS_FLAG_DEFAULT = false;
var NG_REFLECT_ATTRS_FLAG = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "NG_REFLECT_FLAG" : "", {
providedIn: "root",
factory: () => NG_REFLECT_ATTRS_FLAG_DEFAULT
});
function normalizeDebugBindingName(name) {
name = camelCaseToDashCase(name.replace(/[$@]/g, "_"));
return `ng-reflect-${name}`;
}
var CAMEL_CASE_REGEXP = /([A-Z])/g;
function camelCaseToDashCase(input2) {
return input2.replace(CAMEL_CASE_REGEXP, (...m) => "-" + m[1].toLowerCase());
}
function normalizeDebugBindingValue(value) {
try {
return value != null ? value.toString().slice(0, 30) : value;
} catch (e) {
return "[ERROR] Exception while trying to serialize the value";
}
}
var CUSTOM_ELEMENTS_SCHEMA = {
name: "custom-elements"
};
var NO_ERRORS_SCHEMA = {
name: "no-errors-schema"
};
var shouldThrowErrorOnUnknownElement = false;
var shouldThrowErrorOnUnknownProperty = false;
function validateElementIsKnown(lView, tNode) {
const tView = lView[TVIEW];
if (tView.schemas === null)
return;
const tagName = tNode.value;
if (!isDirectiveHost(tNode) && tagName !== null) {
const isUnknown = (
// Note that we can't check for `typeof HTMLUnknownElement === 'function'` because
// Domino doesn't expose HTMLUnknownElement globally.
typeof HTMLUnknownElement !== "undefined" && HTMLUnknownElement && getNativeByTNode(tNode, lView) instanceof HTMLUnknownElement || typeof customElements !== "undefined" && tagName.indexOf("-") > -1 && !customElements.get(tagName)
);
if (isUnknown && !matchingSchemas(tView.schemas, tagName)) {
const isHostStandalone = isHostComponentStandalone(lView);
const templateLocation = getTemplateLocationDetails(lView);
const schemas = `'${isHostStandalone ? "@Component" : "@NgModule"}.schemas'`;
let message = `'${tagName}' is not a known element${templateLocation}:
`;
message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone ? "included in the '@Component.imports' of this component" : "a part of an @NgModule where this component is declared"}.
`;
if (tagName && tagName.indexOf("-") > -1) {
message += `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;
} else {
message += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;
}
if (shouldThrowErrorOnUnknownElement) {
throw new RuntimeError(304, message);
} else {
console.error(formatRuntimeError(304, message));
}
}
}
}
function isPropertyValid(element, propName, tagName, schemas) {
if (schemas === null)
return true;
if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {
return true;
}
return typeof Node === "undefined" || Node === null || !(element instanceof Node);
}
function handleUnknownPropertyError(propName, tagName, nodeType, lView) {
if (!tagName && nodeType === 4) {
tagName = "ng-template";
}
const isHostStandalone = isHostComponentStandalone(lView);
const templateLocation = getTemplateLocationDetails(lView);
let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;
const schemas = `'${isHostStandalone ? "@Component" : "@NgModule"}.schemas'`;
const importLocation = isHostStandalone ? "included in the '@Component.imports' of this component" : "a part of an @NgModule where this component is declared";
if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {
const correspondingImport = KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName);
message += `
If the '${propName}' is an Angular control flow directive, please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`;
} else {
message += `
1. If '${tagName}' is an Angular component and it has the '${propName}' input, then verify that it is ${importLocation}.`;
if (tagName && tagName.indexOf("-") > -1) {
message += `
2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;
message += `
3. To allow any property add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;
} else {
message += `
2. To allow any property add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;
}
}
reportUnknownPropertyError(message);
}
function reportUnknownPropertyError(message) {
if (shouldThrowErrorOnUnknownProperty) {
throw new RuntimeError(303, message);
} else {
console.error(formatRuntimeError(303, message));
}
}
function getDeclarationComponentDef(lView) {
!ngDevMode && throwError2("Must never be called in production mode");
const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
const context2 = declarationLView[CONTEXT];
if (!context2)
return null;
return context2.constructor ? getComponentDef(context2.constructor) : null;
}
function isHostComponentStandalone(lView) {
!ngDevMode && throwError2("Must never be called in production mode");
const componentDef = getDeclarationComponentDef(lView);
return !!componentDef?.standalone;
}
function getTemplateLocationDetails(lView) {
!ngDevMode && throwError2("Must never be called in production mode");
const hostComponentDef = getDeclarationComponentDef(lView);
const componentClassName = hostComponentDef?.type?.name;
return componentClassName ? ` (used in the '${componentClassName}' component template)` : "";
}
var KNOWN_CONTROL_FLOW_DIRECTIVES = /* @__PURE__ */ new Map([
["ngIf", "NgIf"],
["ngFor", "NgFor"],
["ngSwitchCase", "NgSwitchCase"],
["ngSwitchDefault", "NgSwitchDefault"]
]);
function matchingSchemas(schemas, tagName) {
if (schemas !== null) {
for (let i = 0; i < schemas.length; i++) {
const schema = schemas[i];
if (schema === NO_ERRORS_SCHEMA || schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf("-") > -1) {
return true;
}
}
}
return false;
}
function \u0275\u0275resolveWindow(element) {
return element.ownerDocument.defaultView;
}
function \u0275\u0275resolveDocument(element) {
return element.ownerDocument;
}
function \u0275\u0275resolveBody(element) {
return element.ownerDocument.body;
}
var INTERPOLATION_DELIMITER = `\uFFFD`;
function maybeUnwrapFn(value) {
if (value instanceof Function) {
return value();
} else {
return value;
}
}
var VALUE_STRING_LENGTH_LIMIT = 200;
function assertStandaloneComponentType(type) {
assertComponentDef(type);
const componentDef = getComponentDef(type);
if (!componentDef.standalone) {
throw new RuntimeError(907, `The ${stringifyForError(type)} component is not marked as standalone, but Angular expects to have a standalone component here. Please make sure the ${stringifyForError(type)} component has the \`standalone: true\` flag in the decorator.`);
}
}
function assertComponentDef(type) {
if (!getComponentDef(type)) {
throw new RuntimeError(906, `The ${stringifyForError(type)} is not an Angular component, make sure it has the \`@Component\` decorator.`);
}
}
function throwMultipleComponentError(tNode, first2, second) {
throw new RuntimeError(-300, `Multiple components match node with tagname ${tNode.value}: ${stringifyForError(first2)} and ${stringifyForError(second)}`);
}
function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName, lView) {
const hostComponentDef = getDeclarationComponentDef(lView);
const componentClassName = hostComponentDef?.type?.name;
const field = propName ? ` for '${propName}'` : "";
let msg = `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value${field}: '${formatValue(oldValue)}'. Current value: '${formatValue(currValue)}'.${componentClassName ? ` Expression location: ${componentClassName} component` : ""}`;
if (creationMode) {
msg += ` It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook?`;
}
throw new RuntimeError(-100, msg);
}
function formatValue(value) {
let strValue = String(value);
try {
if (Array.isArray(value) || strValue === "[object Object]") {
strValue = JSON.stringify(value);
}
} catch (error) {
}
return strValue.length > VALUE_STRING_LENGTH_LIMIT ? strValue.substring(0, VALUE_STRING_LENGTH_LIMIT) + "\u2026" : strValue;
}
function constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {
const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER);
let oldValue = prefix, newValue = prefix;
for (let i = 0; i < chunks.length; i++) {
const slotIdx = rootIndex + i;
oldValue += `${lView[slotIdx]}${chunks[i]}`;
newValue += `${slotIdx === expressionIndex ? changedValue : lView[slotIdx]}${chunks[i]}`;
}
return { propName, oldValue, newValue };
}
function getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValue) {
const tData = lView[TVIEW].data;
const metadata = tData[bindingIndex];
if (typeof metadata === "string") {
if (metadata.indexOf(INTERPOLATION_DELIMITER) > -1) {
return constructDetailsForInterpolation(lView, bindingIndex, bindingIndex, metadata, newValue);
}
return { propName: metadata, oldValue, newValue };
}
if (metadata === null) {
let idx = bindingIndex - 1;
while (typeof tData[idx] !== "string" && tData[idx + 1] === null) {
idx--;
}
const meta = tData[idx];
if (typeof meta === "string") {
const matches = meta.match(new RegExp(INTERPOLATION_DELIMITER, "g"));
if (matches && matches.length - 1 > bindingIndex - idx) {
return constructDetailsForInterpolation(lView, idx, bindingIndex, meta, newValue);
}
}
}
return { propName: void 0, oldValue, newValue };
}
function classIndexOf(className, classToSearch, startingIndex) {
ngDevMode && assertNotEqual(classToSearch, "", 'can not look for "" string.');
let end = className.length;
while (true) {
const foundIndex = className.indexOf(classToSearch, startingIndex);
if (foundIndex === -1)
return foundIndex;
if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= 32) {
const length = classToSearch.length;
if (foundIndex + length === end || className.charCodeAt(foundIndex + length) <= 32) {
return foundIndex;
}
}
startingIndex = foundIndex + 1;
}
}
var NG_TEMPLATE_SELECTOR = "ng-template";
function isCssClassMatching(tNode, attrs, cssClassToMatch, isProjectionMode) {
ngDevMode && assertEqual(cssClassToMatch, cssClassToMatch.toLowerCase(), "Class name expected to be lowercase.");
let i = 0;
if (isProjectionMode) {
for (; i < attrs.length && typeof attrs[i] === "string"; i += 2) {
if (attrs[i] === "class" && classIndexOf(attrs[i + 1].toLowerCase(), cssClassToMatch, 0) !== -1) {
return true;
}
}
} else if (isInlineTemplate(tNode)) {
return false;
}
i = attrs.indexOf(1, i);
if (i > -1) {
let item;
while (++i < attrs.length && typeof (item = attrs[i]) === "string") {
if (item.toLowerCase() === cssClassToMatch) {
return true;
}
}
}
return false;
}
function isInlineTemplate(tNode) {
return tNode.type === 4 && tNode.value !== NG_TEMPLATE_SELECTOR;
}
function hasTagAndTypeMatch(tNode, currentSelector, isProjectionMode) {
const tagNameToCompare = tNode.type === 4 && !isProjectionMode ? NG_TEMPLATE_SELECTOR : tNode.value;
return currentSelector === tagNameToCompare;
}
function isNodeMatchingSelector(tNode, selector, isProjectionMode) {
ngDevMode && assertDefined(selector[0], "Selector should have a tag name");
let mode = 4;
const nodeAttrs = tNode.attrs;
const nameOnlyMarkerIdx = nodeAttrs !== null ? getNameOnlyMarkerIndex(nodeAttrs) : 0;
let skipToNextSelector = false;
for (let i = 0; i < selector.length; i++) {
const current = selector[i];
if (typeof current === "number") {
if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) {
return false;
}
if (skipToNextSelector && isPositive(current))
continue;
skipToNextSelector = false;
mode = current | mode & 1;
continue;
}
if (skipToNextSelector)
continue;
if (mode & 4) {
mode = 2 | mode & 1;
if (current !== "" && !hasTagAndTypeMatch(tNode, current, isProjectionMode) || current === "" && selector.length === 1) {
if (isPositive(mode))
return false;
skipToNextSelector = true;
}
} else if (mode & 8) {
if (nodeAttrs === null || !isCssClassMatching(tNode, nodeAttrs, current, isProjectionMode)) {
if (isPositive(mode))
return false;
skipToNextSelector = true;
}
} else {
const selectorAttrValue = selector[++i];
const attrIndexInNode = findAttrIndexInNode(current, nodeAttrs, isInlineTemplate(tNode), isProjectionMode);
if (attrIndexInNode === -1) {
if (isPositive(mode))
return false;
skipToNextSelector = true;
continue;
}
if (selectorAttrValue !== "") {
let nodeAttrValue;
if (attrIndexInNode > nameOnlyMarkerIdx) {
nodeAttrValue = "";
} else {
ngDevMode && assertNotEqual(nodeAttrs[attrIndexInNode], 0, "We do not match directives on namespaced attributes");
nodeAttrValue = nodeAttrs[attrIndexInNode + 1].toLowerCase();
}
if (mode & 2 && selectorAttrValue !== nodeAttrValue) {
if (isPositive(mode))
return false;
skipToNextSelector = true;
}
}
}
}
return isPositive(mode) || skipToNextSelector;
}
function isPositive(mode) {
return (mode & 1) === 0;
}
function findAttrIndexInNode(name, attrs, isInlineTemplate2, isProjectionMode) {
if (attrs === null)
return -1;
let i = 0;
if (isProjectionMode || !isInlineTemplate2) {
let bindingsMode = false;
while (i < attrs.length) {
const maybeAttrName = attrs[i];
if (maybeAttrName === name) {
return i;
} else if (maybeAttrName === 3 || maybeAttrName === 6) {
bindingsMode = true;
} else if (maybeAttrName === 1 || maybeAttrName === 2) {
let value = attrs[++i];
while (typeof value === "string") {
value = attrs[++i];
}
continue;
} else if (maybeAttrName === 4) {
break;
} else if (maybeAttrName === 0) {
i += 4;
continue;
}
i += bindingsMode ? 1 : 2;
}
return -1;
} else {
return matchTemplateAttribute(attrs, name);
}
}
function isNodeMatchingSelectorList(tNode, selector, isProjectionMode = false) {
for (let i = 0; i < selector.length; i++) {
if (isNodeMatchingSelector(tNode, selector[i], isProjectionMode)) {
return true;
}
}
return false;
}
function getProjectAsAttrValue(tNode) {
const nodeAttrs = tNode.attrs;
if (nodeAttrs != null) {
const ngProjectAsAttrIdx = nodeAttrs.indexOf(
5
/* AttributeMarker.ProjectAs */
);
if ((ngProjectAsAttrIdx & 1) === 0) {
return nodeAttrs[ngProjectAsAttrIdx + 1];
}
}
return null;
}
function getNameOnlyMarkerIndex(nodeAttrs) {
for (let i = 0; i < nodeAttrs.length; i++) {
const nodeAttr = nodeAttrs[i];
if (isNameOnlyAttributeMarker(nodeAttr)) {
return i;
}
}
return nodeAttrs.length;
}
function matchTemplateAttribute(attrs, name) {
let i = attrs.indexOf(
4
/* AttributeMarker.Template */
);
if (i > -1) {
i++;
while (i < attrs.length) {
const attr = attrs[i];
if (typeof attr === "number")
return -1;
if (attr === name)
return i;
i++;
}
}
return -1;
}
function isSelectorInSelectorList(selector, list) {
selectorListLoop: for (let i = 0; i < list.length; i++) {
const currentSelectorInList = list[i];
if (selector.length !== currentSelectorInList.length) {
continue;
}
for (let j = 0; j < selector.length; j++) {
if (selector[j] !== currentSelectorInList[j]) {
continue selectorListLoop;
}
}
return true;
}
return false;
}
function maybeWrapInNotSelector(isNegativeMode, chunk) {
return isNegativeMode ? ":not(" + chunk.trim() + ")" : chunk;
}
function stringifyCSSSelector(selector) {
let result = selector[0];
let i = 1;
let mode = 2;
let currentChunk = "";
let isNegativeMode = false;
while (i < selector.length) {
let valueOrMarker = selector[i];
if (typeof valueOrMarker === "string") {
if (mode & 2) {
const attrValue = selector[++i];
currentChunk += "[" + valueOrMarker + (attrValue.length > 0 ? '="' + attrValue + '"' : "") + "]";
} else if (mode & 8) {
currentChunk += "." + valueOrMarker;
} else if (mode & 4) {
currentChunk += " " + valueOrMarker;
}
} else {
if (currentChunk !== "" && !isPositive(valueOrMarker)) {
result += maybeWrapInNotSelector(isNegativeMode, currentChunk);
currentChunk = "";
}
mode = valueOrMarker;
isNegativeMode = isNegativeMode || !isPositive(mode);
}
i++;
}
if (currentChunk !== "") {
result += maybeWrapInNotSelector(isNegativeMode, currentChunk);
}
return result;
}
function stringifyCSSSelectorList(selectorList) {
return selectorList.map(stringifyCSSSelector).join(",");
}
function extractAttrsAndClassesFromSelector(selector) {
const attrs = [];
const classes = [];
let i = 1;
let mode = 2;
while (i < selector.length) {
let valueOrMarker = selector[i];
if (typeof valueOrMarker === "string") {
if (mode === 2) {
if (valueOrMarker !== "") {
attrs.push(valueOrMarker, selector[++i]);
}
} else if (mode === 8) {
classes.push(valueOrMarker);
}
} else {
if (!isPositive(mode))
break;
mode = valueOrMarker;
}
i++;
}
if (classes.length) {
attrs.push(1, ...classes);
}
return attrs;
}
var NO_CHANGE = typeof ngDevMode === "undefined" || ngDevMode ? { __brand__: "NO_CHANGE" } : {};
function createTextNode(renderer, value) {
return renderer.createText(value);
}
function updateTextNode(renderer, rNode, value) {
renderer.setValue(rNode, value);
}
function createCommentNode(renderer, value) {
return renderer.createComment(escapeCommentText(value));
}
function createElementNode(renderer, name, namespace) {
return renderer.createElement(name, namespace);
}
function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {
renderer.insertBefore(parent, child, beforeNode, isMove);
}
function nativeAppendChild(renderer, parent, child) {
ngDevMode && assertDefined(parent, "parent node must be defined");
renderer.appendChild(parent, child);
}
function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {
if (beforeNode !== null) {
nativeInsertBefore(renderer, parent, child, beforeNode, isMove);
} else {
nativeAppendChild(renderer, parent, child);
}
}
function nativeRemoveNode(renderer, rNode, isHostElement) {
renderer.removeChild(null, rNode, isHostElement);
}
function writeDirectStyle(renderer, element, newValue) {
ngDevMode && assertString(newValue, "'newValue' should be a string");
renderer.setAttribute(element, "style", newValue);
}
function writeDirectClass(renderer, element, newValue) {
ngDevMode && assertString(newValue, "'newValue' should be a string");
if (newValue === "") {
renderer.removeAttribute(element, "class");
} else {
renderer.setAttribute(element, "class", newValue);
}
}
function setupStaticAttributes(renderer, element, tNode) {
const { mergedAttrs, classes, styles } = tNode;
if (mergedAttrs !== null) {
setUpAttributes(renderer, element, mergedAttrs);
}
if (classes !== null) {
writeDirectClass(renderer, element, classes);
}
if (styles !== null) {
writeDirectStyle(renderer, element, styles);
}
}
function createTView(type, declTNode, templateFn, decls, vars, directives, pipes, viewQuery, schemas, constsOrFactory, ssrId) {
const bindingStartIndex = HEADER_OFFSET + decls;
const initialViewLength = bindingStartIndex + vars;
const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);
const consts = typeof constsOrFactory === "function" ? constsOrFactory() : constsOrFactory;
const tView = blueprint[TVIEW] = {
type,
blueprint,
template: templateFn,
queries: null,
viewQuery,
declTNode,
data: blueprint.slice().fill(null, bindingStartIndex),
bindingStartIndex,
expandoStartIndex: initialViewLength,
hostBindingOpCodes: null,
firstCreatePass: true,
firstUpdatePass: true,
staticViewQueries: false,
staticContentQueries: false,
preOrderHooks: null,
preOrderCheckHooks: null,
contentHooks: null,
contentCheckHooks: null,
viewHooks: null,
viewCheckHooks: null,
destroyHooks: null,
cleanup: null,
contentQueries: null,
components: null,
directiveRegistry: typeof directives === "function" ? directives() : directives,
pipeRegistry: typeof pipes === "function" ? pipes() : pipes,
firstChild: null,
schemas,
consts,
incompleteFirstPass: false,
ssrId
};
if (ngDevMode) {
Object.seal(tView);
}
return tView;
}
function createViewBlueprint(bindingStartIndex, initialViewLength) {
const blueprint = [];
for (let i = 0; i < initialViewLength; i++) {
blueprint.push(i < bindingStartIndex ? null : NO_CHANGE);
}
return blueprint;
}
function getOrCreateComponentTView(def) {
const tView = def.tView;
if (tView === null || tView.incompleteFirstPass) {
const declTNode = null;
return def.tView = createTView(1, declTNode, def.template, def.decls, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery, def.schemas, def.consts, def.id);
}
return tView;
}
function createLView(parentLView, tView, context2, flags, host, tHostNode, environment, renderer, injector, embeddedViewInjector, hydrationInfo) {
const lView = tView.blueprint.slice();
lView[HOST] = host;
lView[FLAGS] = flags | 4 | 128 | 8 | 64 | 1024;
if (embeddedViewInjector !== null || parentLView && parentLView[FLAGS] & 2048) {
lView[FLAGS] |= 2048;
}
resetPreOrderHookFlags(lView);
ngDevMode && tView.declTNode && parentLView && assertTNodeForLView(tView.declTNode, parentLView);
lView[PARENT] = lView[DECLARATION_VIEW] = parentLView;
lView[CONTEXT] = context2;
lView[ENVIRONMENT] = environment || parentLView && parentLView[ENVIRONMENT];
ngDevMode && assertDefined(lView[ENVIRONMENT], "LViewEnvironment is required");
lView[RENDERER] = renderer || parentLView && parentLView[RENDERER];
ngDevMode && assertDefined(lView[RENDERER], "Renderer is required");
lView[INJECTOR] = injector || parentLView && parentLView[INJECTOR] || null;
lView[T_HOST] = tHostNode;
lView[ID] = getUniqueLViewId();
lView[HYDRATION] = hydrationInfo;
lView[EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector;
ngDevMode && assertEqual(tView.type == 2 ? parentLView !== null : true, true, "Embedded views must have parentLView");
lView[DECLARATION_COMPONENT_VIEW] = tView.type == 2 ? parentLView[DECLARATION_COMPONENT_VIEW] : lView;
return lView;
}
function createComponentLView(lView, hostTNode, def) {
const native = getNativeByTNode(hostTNode, lView);
const tView = getOrCreateComponentTView(def);
const rendererFactory = lView[ENVIRONMENT].rendererFactory;
const componentView = addToEndOfViewTree(lView, createLView(lView, tView, null, getInitialLViewFlagsFromDef(def), native, hostTNode, null, rendererFactory.createRenderer(native, def), null, null, null));
return lView[hostTNode.index] = componentView;
}
function getInitialLViewFlagsFromDef(def) {
let flags = 16;
if (def.signals) {
flags = 4096;
} else if (def.onPush) {
flags = 64;
}
return flags;
}
function allocExpando(tView, lView, numSlotsToAlloc, initialValue) {
if (numSlotsToAlloc === 0)
return -1;
if (ngDevMode) {
assertFirstCreatePass(tView);
assertSame(tView, lView[TVIEW], "`LView` must be associated with `TView`!");
assertEqual(tView.data.length, lView.length, "Expecting LView to be same size as TView");
assertEqual(tView.data.length, tView.blueprint.length, "Expecting Blueprint to be same size as TView");
assertFirstUpdatePass(tView);
}
const allocIdx = lView.length;
for (let i = 0; i < numSlotsToAlloc; i++) {
lView.push(initialValue);
tView.blueprint.push(initialValue);
tView.data.push(null);
}
return allocIdx;
}
function addToEndOfViewTree(lView, lViewOrLContainer) {
if (lView[CHILD_HEAD]) {
lView[CHILD_TAIL][NEXT] = lViewOrLContainer;
} else {
lView[CHILD_HEAD] = lViewOrLContainer;
}
lView[CHILD_TAIL] = lViewOrLContainer;
return lViewOrLContainer;
}
function \u0275\u0275advance(delta = 1) {
ngDevMode && assertGreaterThan(delta, 0, "Can only advance forward");
selectIndexInternal(getTView(), getLView(), getSelectedIndex() + delta, !!ngDevMode && isInCheckNoChangesMode());
}
function selectIndexInternal(tView, lView, index, checkNoChangesMode) {
ngDevMode && assertIndexInDeclRange(lView[TVIEW], index);
if (!checkNoChangesMode) {
const hooksInitPhaseCompleted = (lView[FLAGS] & 3) === 3;
if (hooksInitPhaseCompleted) {
const preOrderCheckHooks = tView.preOrderCheckHooks;
if (preOrderCheckHooks !== null) {
executeCheckHooks(lView, preOrderCheckHooks, index);
}
} else {
const preOrderHooks = tView.preOrderHooks;
if (preOrderHooks !== null) {
executeInitAndCheckHooks(lView, preOrderHooks, 0, index);
}
}
}
setSelectedIndex(index);
}
var InputFlags;
(function(InputFlags2) {
InputFlags2[InputFlags2["None"] = 0] = "None";
InputFlags2[InputFlags2["SignalBased"] = 1] = "SignalBased";
InputFlags2[InputFlags2["HasDecoratorInputTransform"] = 2] = "HasDecoratorInputTransform";
})(InputFlags || (InputFlags = {}));
function writeToDirectiveInput(def, instance, publicName, value) {
const prevConsumer = setActiveConsumer(null);
try {
if (ngDevMode) {
if (!def.inputs.hasOwnProperty(publicName)) {
throw new Error(`ASSERTION ERROR: Directive ${def.type.name} does not have an input with a public name of "${publicName}"`);
}
if (instance instanceof NodeInjectorFactory) {
throw new Error(`ASSERTION ERROR: Cannot write input to factory for type ${def.type.name}. Directive has not been created yet.`);
}
}
const [privateName, flags, transform] = def.inputs[publicName];
let inputSignalNode = null;
if ((flags & InputFlags.SignalBased) !== 0) {
const field = instance[privateName];
inputSignalNode = field[SIGNAL];
}
if (inputSignalNode !== null && inputSignalNode.transformFn !== void 0) {
value = inputSignalNode.transformFn(value);
} else if (transform !== null) {
value = transform.call(instance, value);
}
if (def.setInput !== null) {
def.setInput(instance, inputSignalNode, value, publicName, privateName);
} else {
applyValueToInputField(instance, inputSignalNode, privateName, value);
}
} finally {
setActiveConsumer(prevConsumer);
}
}
var RendererStyleFlags2;
(function(RendererStyleFlags22) {
RendererStyleFlags22[RendererStyleFlags22["Important"] = 1] = "Important";
RendererStyleFlags22[RendererStyleFlags22["DashCase"] = 2] = "DashCase";
})(RendererStyleFlags2 || (RendererStyleFlags2 = {}));
var _icuContainerIterate;
function icuContainerIterate(tIcuContainerNode, lView) {
return _icuContainerIterate(tIcuContainerNode, lView);
}
function ensureIcuContainerVisitorLoaded(loader) {
if (_icuContainerIterate === void 0) {
_icuContainerIterate = loader();
}
}
function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {
if (lNodeToHandle != null) {
let lContainer;
let isComponent2 = false;
if (isLContainer(lNodeToHandle)) {
lContainer = lNodeToHandle;
} else if (isLView(lNodeToHandle)) {
isComponent2 = true;
ngDevMode && assertDefined(lNodeToHandle[HOST], "HOST must be defined for a component LView");
lNodeToHandle = lNodeToHandle[HOST];
}
const rNode = unwrapRNode(lNodeToHandle);
if (action === 0 && parent !== null) {
if (beforeNode == null) {
nativeAppendChild(renderer, parent, rNode);
} else {
nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);
}
} else if (action === 1 && parent !== null) {
nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);
} else if (action === 2) {
nativeRemoveNode(renderer, rNode, isComponent2);
} else if (action === 3) {
renderer.destroyNode(rNode);
}
if (lContainer != null) {
applyContainer(renderer, action, lContainer, parent, beforeNode);
}
}
}
function removeViewFromDOM(tView, lView) {
detachViewFromDOM(tView, lView);
lView[HOST] = null;
lView[T_HOST] = null;
}
function addViewToDOM(tView, parentTNode, renderer, lView, parentNativeNode, beforeNode) {
lView[HOST] = parentNativeNode;
lView[T_HOST] = parentTNode;
applyView(tView, lView, renderer, 1, parentNativeNode, beforeNode);
}
function detachViewFromDOM(tView, lView) {
lView[ENVIRONMENT].changeDetectionScheduler?.notify(
9
/* NotificationSource.ViewDetachedFromDOM */
);
applyView(tView, lView, lView[RENDERER], 2, null, null);
}
function destroyViewTree(rootView) {
let lViewOrLContainer = rootView[CHILD_HEAD];
if (!lViewOrLContainer) {
return cleanUpView(rootView[TVIEW], rootView);
}
while (lViewOrLContainer) {
let next = null;
if (isLView(lViewOrLContainer)) {
next = lViewOrLContainer[CHILD_HEAD];
} else {
ngDevMode && assertLContainer(lViewOrLContainer);
const firstView = lViewOrLContainer[CONTAINER_HEADER_OFFSET];
if (firstView)
next = firstView;
}
if (!next) {
while (lViewOrLContainer && !lViewOrLContainer[NEXT] && lViewOrLContainer !== rootView) {
if (isLView(lViewOrLContainer)) {
cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);
}
lViewOrLContainer = lViewOrLContainer[PARENT];
}
if (lViewOrLContainer === null)
lViewOrLContainer = rootView;
if (isLView(lViewOrLContainer)) {
cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);
}
next = lViewOrLContainer && lViewOrLContainer[NEXT];
}
lViewOrLContainer = next;
}
}
function detachMovedView(declarationContainer, lView) {
ngDevMode && assertLContainer(declarationContainer);
ngDevMode && assertDefined(declarationContainer[MOVED_VIEWS], "A projected view should belong to a non-empty projected views collection");
const movedViews = declarationContainer[MOVED_VIEWS];
const declarationViewIndex = movedViews.indexOf(lView);
movedViews.splice(declarationViewIndex, 1);
}
function destroyLView(tView, lView) {
if (isDestroyed(lView)) {
return;
}
const renderer = lView[RENDERER];
if (renderer.destroyNode) {
applyView(tView, lView, renderer, 3, null, null);
}
destroyViewTree(lView);
}
function cleanUpView(tView, lView) {
if (isDestroyed(lView)) {
return;
}
const prevConsumer = setActiveConsumer(null);
try {
lView[FLAGS] &= ~128;
lView[FLAGS] |= 256;
lView[REACTIVE_TEMPLATE_CONSUMER] && consumerDestroy(lView[REACTIVE_TEMPLATE_CONSUMER]);
executeOnDestroys(tView, lView);
processCleanups(tView, lView);
if (lView[TVIEW].type === 1) {
lView[RENDERER].destroy();
}
const declarationContainer = lView[DECLARATION_LCONTAINER];
if (declarationContainer !== null && isLContainer(lView[PARENT])) {
if (declarationContainer !== lView[PARENT]) {
detachMovedView(declarationContainer, lView);
}
const lQueries = lView[QUERIES];
if (lQueries !== null) {
lQueries.detachView(tView);
}
}
unregisterLView(lView);
} finally {
setActiveConsumer(prevConsumer);
}
}
function processCleanups(tView, lView) {
ngDevMode && assertNotReactive(processCleanups.name);
const tCleanup = tView.cleanup;
const lCleanup = lView[CLEANUP];
if (tCleanup !== null) {
for (let i = 0; i < tCleanup.length - 1; i += 2) {
if (typeof tCleanup[i] === "string") {
const targetIdx = tCleanup[i + 3];
ngDevMode && assertNumber(targetIdx, "cleanup target must be a number");
if (targetIdx >= 0) {
lCleanup[targetIdx]();
} else {
lCleanup[-targetIdx].unsubscribe();
}
i += 2;
} else {
const context2 = lCleanup[tCleanup[i + 1]];
tCleanup[i].call(context2);
}
}
}
if (lCleanup !== null) {
lView[CLEANUP] = null;
}
const destroyHooks = lView[ON_DESTROY_HOOKS];
if (destroyHooks !== null) {
lView[ON_DESTROY_HOOKS] = null;
for (let i = 0; i < destroyHooks.length; i++) {
const destroyHooksFn = destroyHooks[i];
ngDevMode && assertFunction(destroyHooksFn, "Expecting destroy hook to be a function.");
destroyHooksFn();
}
}
const effects = lView[EFFECTS];
if (effects !== null) {
lView[EFFECTS] = null;
for (const effect2 of effects) {
effect2.destroy();
}
}
}
function executeOnDestroys(tView, lView) {
ngDevMode && assertNotReactive(executeOnDestroys.name);
let destroyHooks;
if (tView != null && (destroyHooks = tView.destroyHooks) != null) {
for (let i = 0; i < destroyHooks.length; i += 2) {
const context2 = lView[destroyHooks[i]];
if (!(context2 instanceof NodeInjectorFactory)) {
const toCall = destroyHooks[i + 1];
if (Array.isArray(toCall)) {
for (let j = 0; j < toCall.length; j += 2) {
const callContext = context2[toCall[j]];
const hook = toCall[j + 1];
profiler(4, callContext, hook);
try {
hook.call(callContext);
} finally {
profiler(5, callContext, hook);
}
}
} else {
profiler(4, context2, toCall);
try {
toCall.call(context2);
} finally {
profiler(5, context2, toCall);
}
}
}
}
}
}
function getParentRElement(tView, tNode, lView) {
return getClosestRElement(tView, tNode.parent, lView);
}
function getClosestRElement(tView, tNode, lView) {
let parentTNode = tNode;
while (parentTNode !== null && parentTNode.type & (8 | 32 | 128)) {
tNode = parentTNode;
parentTNode = tNode.parent;
}
if (parentTNode === null) {
return lView[HOST];
} else {
ngDevMode && assertTNodeType(
parentTNode,
3 | 4
/* TNodeType.Container */
);
if (isComponentHost(parentTNode)) {
ngDevMode && assertTNodeForLView(parentTNode, lView);
const { encapsulation } = tView.data[parentTNode.directiveStart + parentTNode.componentOffset];
if (encapsulation === ViewEncapsulation.None || encapsulation === ViewEncapsulation.Emulated) {
return null;
}
}
return getNativeByTNode(parentTNode, lView);
}
}
function getInsertInFrontOfRNode(parentTNode, currentTNode, lView) {
return _getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView);
}
function getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView) {
if (parentTNode.type & (8 | 32)) {
return getNativeByTNode(parentTNode, lView);
}
return null;
}
var _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithNoI18n;
var _processI18nInsertBefore;
function setI18nHandling(getInsertInFrontOfRNodeWithI18n2, processI18nInsertBefore2) {
_getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithI18n2;
_processI18nInsertBefore = processI18nInsertBefore2;
}
function appendChild(tView, lView, childRNode, childTNode) {
const parentRNode = getParentRElement(tView, childTNode, lView);
const renderer = lView[RENDERER];
const parentTNode = childTNode.parent || lView[T_HOST];
const anchorNode = getInsertInFrontOfRNode(parentTNode, childTNode, lView);
if (parentRNode != null) {
if (Array.isArray(childRNode)) {
for (let i = 0; i < childRNode.length; i++) {
nativeAppendOrInsertBefore(renderer, parentRNode, childRNode[i], anchorNode, false);
}
} else {
nativeAppendOrInsertBefore(renderer, parentRNode, childRNode, anchorNode, false);
}
}
_processI18nInsertBefore !== void 0 && _processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRNode);
}
function getFirstNativeNode(lView, tNode) {
if (tNode !== null) {
ngDevMode && assertTNodeType(
tNode,
3 | 12 | 32 | 16 | 128
/* TNodeType.LetDeclaration */
);
const tNodeType = tNode.type;
if (tNodeType & 3) {
return getNativeByTNode(tNode, lView);
} else if (tNodeType & 4) {
return getBeforeNodeForView(-1, lView[tNode.index]);
} else if (tNodeType & 8) {
const elIcuContainerChild = tNode.child;
if (elIcuContainerChild !== null) {
return getFirstNativeNode(lView, elIcuContainerChild);
} else {
const rNodeOrLContainer = lView[tNode.index];
if (isLContainer(rNodeOrLContainer)) {
return getBeforeNodeForView(-1, rNodeOrLContainer);
} else {
return unwrapRNode(rNodeOrLContainer);
}
}
} else if (tNodeType & 128) {
return getFirstNativeNode(lView, tNode.next);
} else if (tNodeType & 32) {
let nextRNode = icuContainerIterate(tNode, lView);
let rNode = nextRNode();
return rNode || unwrapRNode(lView[tNode.index]);
} else {
const projectionNodes = getProjectionNodes(lView, tNode);
if (projectionNodes !== null) {
if (Array.isArray(projectionNodes)) {
return projectionNodes[0];
}
const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);
ngDevMode && assertParentView(parentView);
return getFirstNativeNode(parentView, projectionNodes);
} else {
return getFirstNativeNode(lView, tNode.next);
}
}
}
return null;
}
function getProjectionNodes(lView, tNode) {
if (tNode !== null) {
const componentView = lView[DECLARATION_COMPONENT_VIEW];
const componentHost = componentView[T_HOST];
const slotIdx = tNode.projection;
ngDevMode && assertProjectionSlots(lView);
return componentHost.projection[slotIdx];
}
return null;
}
function getBeforeNodeForView(viewIndexInContainer, lContainer) {
const nextViewIndex = CONTAINER_HEADER_OFFSET + viewIndexInContainer + 1;
if (nextViewIndex < lContainer.length) {
const lView = lContainer[nextViewIndex];
const firstTNodeOfView = lView[TVIEW].firstChild;
if (firstTNodeOfView !== null) {
return getFirstNativeNode(lView, firstTNodeOfView);
}
}
return lContainer[NATIVE];
}
function applyNodes(renderer, action, tNode, lView, parentRElement, beforeNode, isProjection) {
while (tNode != null) {
ngDevMode && assertTNodeForLView(tNode, lView);
if (tNode.type === 128) {
tNode = tNode.next;
continue;
}
ngDevMode && assertTNodeType(
tNode,
3 | 12 | 16 | 32
/* TNodeType.Icu */
);
const rawSlotValue = lView[tNode.index];
const tNodeType = tNode.type;
if (isProjection) {
if (action === 0) {
rawSlotValue && attachPatchData(unwrapRNode(rawSlotValue), lView);
tNode.flags |= 2;
}
}
if (!isDetachedByI18n(tNode)) {
if (tNodeType & 8) {
applyNodes(renderer, action, tNode.child, lView, parentRElement, beforeNode, false);
applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);
} else if (tNodeType & 32) {
const nextRNode = icuContainerIterate(tNode, lView);
let rNode;
while (rNode = nextRNode()) {
applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);
}
applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);
} else if (tNodeType & 16) {
applyProjectionRecursive(renderer, action, lView, tNode, parentRElement, beforeNode);
} else {
ngDevMode && assertTNodeType(
tNode,
3 | 4
/* TNodeType.Container */
);
applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);
}
}
tNode = isProjection ? tNode.projectionNext : tNode.next;
}
}
function applyView(tView, lView, renderer, action, parentRElement, beforeNode) {
applyNodes(renderer, action, tView.firstChild, lView, parentRElement, beforeNode, false);
}
function applyProjection(tView, lView, tProjectionNode) {
const renderer = lView[RENDERER];
const parentRNode = getParentRElement(tView, tProjectionNode, lView);
const parentTNode = tProjectionNode.parent || lView[T_HOST];
let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);
applyProjectionRecursive(renderer, 0, lView, tProjectionNode, parentRNode, beforeNode);
}
function applyProjectionRecursive(renderer, action, lView, tProjectionNode, parentRElement, beforeNode) {
const componentLView = lView[DECLARATION_COMPONENT_VIEW];
const componentNode = componentLView[T_HOST];
ngDevMode && assertEqual(typeof tProjectionNode.projection, "number", "expecting projection index");
const nodeToProjectOrRNodes = componentNode.projection[tProjectionNode.projection];
if (Array.isArray(nodeToProjectOrRNodes)) {
for (let i = 0; i < nodeToProjectOrRNodes.length; i++) {
const rNode = nodeToProjectOrRNodes[i];
applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);
}
} else {
let nodeToProject = nodeToProjectOrRNodes;
const projectedComponentLView = componentLView[PARENT];
if (hasInSkipHydrationBlockFlag(tProjectionNode)) {
nodeToProject.flags |= 128;
}
applyNodes(renderer, action, nodeToProject, projectedComponentLView, parentRElement, beforeNode, true);
}
}
function applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {
ngDevMode && assertLContainer(lContainer);
const anchor = lContainer[NATIVE];
const native = unwrapRNode(lContainer);
if (anchor !== native) {
applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);
}
for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
const lView = lContainer[i];
applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);
}
}
function applyStyling(renderer, isClassBased, rNode, prop, value) {
if (isClassBased) {
if (!value) {
renderer.removeClass(rNode, prop);
} else {
renderer.addClass(rNode, prop);
}
} else {
let flags = prop.indexOf("-") === -1 ? void 0 : RendererStyleFlags2.DashCase;
if (value == null) {
renderer.removeStyle(rNode, prop, flags);
} else {
const isImportant = typeof value === "string" ? value.endsWith("!important") : false;
if (isImportant) {
value = value.slice(0, -10);
flags |= RendererStyleFlags2.Important;
}
renderer.setStyle(rNode, prop, value, flags);
}
}
}
function executeTemplate(tView, lView, templateFn, rf, context2) {
const prevSelectedIndex = getSelectedIndex();
const isUpdatePhase = rf & 2;
try {
setSelectedIndex(-1);
if (isUpdatePhase && lView.length > HEADER_OFFSET) {
selectIndexInternal(tView, lView, HEADER_OFFSET, !!ngDevMode && isInCheckNoChangesMode());
}
const preHookType = isUpdatePhase ? 2 : 0;
profiler(preHookType, context2, templateFn);
templateFn(rf, context2);
} finally {
setSelectedIndex(prevSelectedIndex);
const postHookType = isUpdatePhase ? 3 : 1;
profiler(postHookType, context2, templateFn);
}
}
function createDirectivesInstances(tView, lView, tNode) {
instantiateAllDirectives(tView, lView, tNode);
if ((tNode.flags & 64) === 64) {
invokeDirectivesHostBindings(tView, lView, tNode);
}
}
function saveResolvedLocalsInData(viewData, tNode, localRefExtractor = getNativeByTNode) {
const localNames = tNode.localNames;
if (localNames !== null) {
let localIndex = tNode.index + 1;
for (let i = 0; i < localNames.length; i += 2) {
const index = localNames[i + 1];
const value = index === -1 ? localRefExtractor(tNode, viewData) : viewData[index];
viewData[localIndex++] = value;
}
}
}
function locateHostElement(renderer, elementOrSelector, encapsulation, injector) {
const preserveHostContent = injector.get(PRESERVE_HOST_CONTENT, PRESERVE_HOST_CONTENT_DEFAULT);
const preserveContent = preserveHostContent || encapsulation === ViewEncapsulation.ShadowDom;
const rootElement = renderer.selectRootElement(elementOrSelector, preserveContent);
applyRootElementTransform(rootElement);
return rootElement;
}
function applyRootElementTransform(rootElement) {
_applyRootElementTransformImpl(rootElement);
}
var _applyRootElementTransformImpl = () => null;
function mapPropName(name) {
if (name === "class")
return "className";
if (name === "for")
return "htmlFor";
if (name === "formaction")
return "formAction";
if (name === "innerHtml")
return "innerHTML";
if (name === "readonly")
return "readOnly";
if (name === "tabindex")
return "tabIndex";
return name;
}
function setPropertyAndInputs(tNode, lView, propName, value, renderer, sanitizer) {
ngDevMode && assertNotSame(value, NO_CHANGE, "Incoming value should never be NO_CHANGE.");
const tView = lView[TVIEW];
const hasSetInput = setAllInputsForProperty(tNode, tView, lView, propName, value);
if (hasSetInput) {
isComponentHost(tNode) && markDirtyIfOnPush(lView, tNode.index);
ngDevMode && setNgReflectProperties(lView, tView, tNode, propName, value);
return;
}
if (tNode.type & 3) {
propName = mapPropName(propName);
}
setDomProperty(tNode, lView, propName, value, renderer, sanitizer);
}
function setDomProperty(tNode, lView, propName, value, renderer, sanitizer) {
if (tNode.type & 3) {
const element = getNativeByTNode(tNode, lView);
if (ngDevMode) {
validateAgainstEventProperties(propName);
if (!isPropertyValid(element, propName, tNode.value, lView[TVIEW].schemas)) {
handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);
}
}
value = sanitizer != null ? sanitizer(value, tNode.value || "", propName) : value;
renderer.setProperty(element, propName, value);
} else if (tNode.type & 12) {
if (ngDevMode && !matchingSchemas(lView[TVIEW].schemas, tNode.value)) {
handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);
}
}
}
function markDirtyIfOnPush(lView, viewIndex) {
ngDevMode && assertLView(lView);
const childComponentLView = getComponentLViewByIndex(viewIndex, lView);
if (!(childComponentLView[FLAGS] & 16)) {
childComponentLView[FLAGS] |= 64;
}
}
function setNgReflectProperty(lView, tNode, attrName, value) {
const environment = lView[ENVIRONMENT];
if (!environment.ngReflect) {
return;
}
const element = getNativeByTNode(tNode, lView);
const renderer = lView[RENDERER];
attrName = normalizeDebugBindingName(attrName);
const debugValue = normalizeDebugBindingValue(value);
if (tNode.type & 3) {
if (value == null) {
renderer.removeAttribute(element, attrName);
} else {
renderer.setAttribute(element, attrName, debugValue);
}
} else {
const textContent = escapeCommentText(`bindings=${JSON.stringify({ [attrName]: debugValue }, null, 2)}`);
renderer.setValue(element, textContent);
}
}
function setNgReflectProperties(lView, tView, tNode, publicName, value) {
const environment = lView[ENVIRONMENT];
if (!environment.ngReflect || !(tNode.type & (3 | 4))) {
return;
}
const inputConfig = tNode.inputs?.[publicName];
const hostInputConfig = tNode.hostDirectiveInputs?.[publicName];
if (hostInputConfig) {
for (let i = 0; i < hostInputConfig.length; i += 2) {
const index = hostInputConfig[i];
const publicName2 = hostInputConfig[i + 1];
const def = tView.data[index];
setNgReflectProperty(lView, tNode, def.inputs[publicName2][0], value);
}
}
if (inputConfig) {
for (const index of inputConfig) {
const def = tView.data[index];
setNgReflectProperty(lView, tNode, def.inputs[publicName][0], value);
}
}
}
function instantiateAllDirectives(tView, lView, tNode) {
const start = tNode.directiveStart;
const end = tNode.directiveEnd;
if (isComponentHost(tNode)) {
ngDevMode && assertTNodeType(
tNode,
3
/* TNodeType.AnyRNode */
);
createComponentLView(lView, tNode, tView.data[start + tNode.componentOffset]);
}
if (!tView.firstCreatePass) {
getOrCreateNodeInjectorForNode(tNode, lView);
}
const initialInputs = tNode.initialInputs;
for (let i = start; i < end; i++) {
const def = tView.data[i];
const directive = getNodeInjectable(lView, tView, i, tNode);
attachPatchData(directive, lView);
if (initialInputs !== null) {
setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs);
}
if (isComponentDef(def)) {
const componentView = getComponentLViewByIndex(tNode.index, lView);
componentView[CONTEXT] = getNodeInjectable(lView, tView, i, tNode);
}
}
}
function invokeDirectivesHostBindings(tView, lView, tNode) {
const start = tNode.directiveStart;
const end = tNode.directiveEnd;
const elementIndex = tNode.index;
const currentDirectiveIndex = getCurrentDirectiveIndex();
try {
setSelectedIndex(elementIndex);
for (let dirIndex = start; dirIndex < end; dirIndex++) {
const def = tView.data[dirIndex];
const directive = lView[dirIndex];
setCurrentDirectiveIndex(dirIndex);
if (def.hostBindings !== null || def.hostVars !== 0 || def.hostAttrs !== null) {
invokeHostBindingsInCreationMode(def, directive);
}
}
} finally {
setSelectedIndex(-1);
setCurrentDirectiveIndex(currentDirectiveIndex);
}
}
function invokeHostBindingsInCreationMode(def, directive) {
if (def.hostBindings !== null) {
def.hostBindings(1, directive);
}
}
function findDirectiveDefMatches(tView, tNode) {
ngDevMode && assertFirstCreatePass(tView);
ngDevMode && assertTNodeType(
tNode,
3 | 12
/* TNodeType.AnyContainer */
);
const registry2 = tView.directiveRegistry;
let matches = null;
if (registry2) {
for (let i = 0; i < registry2.length; i++) {
const def = registry2[i];
if (isNodeMatchingSelectorList(
tNode,
def.selectors,
/* isProjectionMode */
false
)) {
matches ??= [];
if (isComponentDef(def)) {
if (ngDevMode) {
assertTNodeType(tNode, 2, `"${tNode.value}" tags cannot be used as component hosts. Please use a different tag to activate the ${stringify(def.type)} component.`);
if (matches.length && isComponentDef(matches[0])) {
throwMultipleComponentError(tNode, matches.find(isComponentDef).type, def.type);
}
}
matches.unshift(def);
} else {
matches.push(def);
}
}
}
}
return matches;
}
function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace) {
if (ngDevMode) {
assertNotSame(value, NO_CHANGE, "Incoming value should never be NO_CHANGE.");
validateAgainstEventAttributes(name);
assertTNodeType(tNode, 2, `Attempted to set attribute \`${name}\` on a container node. Host bindings are not valid on ng-container or ng-template.`);
}
const element = getNativeByTNode(tNode, lView);
setElementAttribute(lView[RENDERER], element, namespace, tNode.value, name, value, sanitizer);
}
function setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {
if (value == null) {
renderer.removeAttribute(element, name, namespace);
} else {
const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || "", name);
renderer.setAttribute(element, name, strValue, namespace);
}
}
function setInputsFromAttrs(lView, directiveIndex, instance, def, tNode, initialInputData) {
const initialInputs = initialInputData[directiveIndex];
if (initialInputs !== null) {
for (let i = 0; i < initialInputs.length; i += 2) {
const lookupName = initialInputs[i];
const value = initialInputs[i + 1];
writeToDirectiveInput(def, instance, lookupName, value);
if (ngDevMode) {
setNgReflectProperty(lView, tNode, def.inputs[lookupName][0], value);
}
}
}
}
function elementLikeStartShared(tNode, lView, index, name, locateOrCreateNativeNode) {
const adjustedIndex = HEADER_OFFSET + index;
const tView = lView[TVIEW];
const native = locateOrCreateNativeNode(tView, lView, tNode, name, index);
lView[adjustedIndex] = native;
setCurrentTNode(tNode, true);
const isElement = tNode.type === 2;
if (isElement) {
setupStaticAttributes(lView[RENDERER], native, tNode);
if (getElementDepthCount() === 0 || isDirectiveHost(tNode)) {
attachPatchData(native, lView);
}
increaseElementDepthCount();
} else {
attachPatchData(native, lView);
}
if (wasLastNodeCreated() && (!isElement || !isDetachedByI18n(tNode))) {
appendChild(tView, lView, native, tNode);
}
return tNode;
}
function elementLikeEndShared(tNode) {
let currentTNode = tNode;
if (isCurrentTNodeParent()) {
setCurrentTNodeAsNotParent();
} else {
ngDevMode && assertHasParent(getCurrentTNode());
currentTNode = currentTNode.parent;
setCurrentTNode(currentTNode, false);
}
return currentTNode;
}
function storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex, ...interpolationParts) {
if (tData[bindingIndex] === null) {
if (!tNode.inputs?.[propertyName] && !tNode.hostDirectiveInputs?.[propertyName]) {
const propBindingIdxs = tNode.propertyBindings || (tNode.propertyBindings = []);
propBindingIdxs.push(bindingIndex);
let bindingMetadata = propertyName;
if (interpolationParts.length > 0) {
bindingMetadata += INTERPOLATION_DELIMITER + interpolationParts.join(INTERPOLATION_DELIMITER);
}
tData[bindingIndex] = bindingMetadata;
}
}
}
function loadComponentRenderer(currentDef, tNode, lView) {
if (currentDef === null || isComponentDef(currentDef)) {
lView = unwrapLView(lView[tNode.index]);
}
return lView[RENDERER];
}
function handleUncaughtError(lView, error) {
const injector = lView[INJECTOR];
if (!injector) {
return;
}
const errorHandler2 = injector.get(INTERNAL_APPLICATION_ERROR_HANDLER, null);
errorHandler2?.(error);
}
function setAllInputsForProperty(tNode, tView, lView, publicName, value) {
const inputs = tNode.inputs?.[publicName];
const hostDirectiveInputs = tNode.hostDirectiveInputs?.[publicName];
let hasMatch = false;
if (hostDirectiveInputs) {
for (let i = 0; i < hostDirectiveInputs.length; i += 2) {
const index = hostDirectiveInputs[i];
ngDevMode && assertIndexInRange(lView, index);
const publicName2 = hostDirectiveInputs[i + 1];
const def = tView.data[index];
writeToDirectiveInput(def, lView[index], publicName2, value);
hasMatch = true;
}
}
if (inputs) {
for (const index of inputs) {
ngDevMode && assertIndexInRange(lView, index);
const instance = lView[index];
const def = tView.data[index];
writeToDirectiveInput(def, instance, publicName, value);
hasMatch = true;
}
}
return hasMatch;
}
function renderComponent(hostLView, componentHostIdx) {
ngDevMode && assertEqual(isCreationMode(hostLView), true, "Should be run in creation mode");
const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
const componentTView = componentView[TVIEW];
syncViewWithBlueprint(componentTView, componentView);
const hostRNode = componentView[HOST];
if (hostRNode !== null && componentView[HYDRATION] === null) {
componentView[HYDRATION] = retrieveHydrationInfo(hostRNode, componentView[INJECTOR]);
}
profiler(
18
/* ProfilerEvent.ComponentStart */
);
renderView(componentTView, componentView, componentView[CONTEXT]);
profiler(19, componentView[CONTEXT]);
}
function syncViewWithBlueprint(tView, lView) {
for (let i = lView.length; i < tView.blueprint.length; i++) {
lView.push(tView.blueprint[i]);
}
}
function renderView(tView, lView, context2) {
ngDevMode && assertEqual(isCreationMode(lView), true, "Should be run in creation mode");
ngDevMode && assertNotReactive(renderView.name);
enterView(lView);
try {
const viewQuery = tView.viewQuery;
if (viewQuery !== null) {
executeViewQueryFn(1, viewQuery, context2);
}
const templateFn = tView.template;
if (templateFn !== null) {
executeTemplate(tView, lView, templateFn, 1, context2);
}
if (tView.firstCreatePass) {
tView.firstCreatePass = false;
}
lView[QUERIES]?.finishViewCreation(tView);
if (tView.staticContentQueries) {
refreshContentQueries(tView, lView);
}
if (tView.staticViewQueries) {
executeViewQueryFn(2, tView.viewQuery, context2);
}
const components = tView.components;
if (components !== null) {
renderChildComponents(lView, components);
}
} catch (error) {
if (tView.firstCreatePass) {
tView.incompleteFirstPass = true;
tView.firstCreatePass = false;
}
throw error;
} finally {
lView[FLAGS] &= ~4;
leaveView();
}
}
function renderChildComponents(hostLView, components) {
for (let i = 0; i < components.length; i++) {
renderComponent(hostLView, components[i]);
}
}
function createAndRenderEmbeddedLView(declarationLView, templateTNode, context2, options) {
const prevConsumer = setActiveConsumer(null);
try {
const embeddedTView = templateTNode.tView;
ngDevMode && assertDefined(embeddedTView, "TView must be defined for a template node.");
ngDevMode && assertTNodeForLView(templateTNode, declarationLView);
const isSignalView = declarationLView[FLAGS] & 4096;
const viewFlags = isSignalView ? 4096 : 16;
const embeddedLView = createLView(declarationLView, embeddedTView, context2, viewFlags, null, templateTNode, null, null, options?.injector ?? null, options?.embeddedViewInjector ?? null, options?.dehydratedView ?? null);
const declarationLContainer = declarationLView[templateTNode.index];
ngDevMode && assertLContainer(declarationLContainer);
embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;
const declarationViewLQueries = declarationLView[QUERIES];
if (declarationViewLQueries !== null) {
embeddedLView[QUERIES] = declarationViewLQueries.createEmbeddedView(embeddedTView);
}
renderView(embeddedTView, embeddedLView, context2);
return embeddedLView;
} finally {
setActiveConsumer(prevConsumer);
}
}
function shouldAddViewToDom(tNode, dehydratedView) {
return !dehydratedView || dehydratedView.firstChild === null || hasInSkipHydrationBlockFlag(tNode);
}
var USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT = false;
var UseExhaustiveCheckNoChanges = new InjectionToken(ngDevMode ? "exhaustive checkNoChanges" : "");
function collectNativeNodes(tView, lView, tNode, result, isProjection = false) {
while (tNode !== null) {
if (tNode.type === 128) {
tNode = isProjection ? tNode.projectionNext : tNode.next;
continue;
}
ngDevMode && assertTNodeType(
tNode,
3 | 12 | 16 | 32
/* TNodeType.Icu */
);
const lNode = lView[tNode.index];
if (lNode !== null) {
result.push(unwrapRNode(lNode));
}
if (isLContainer(lNode)) {
collectNativeNodesInLContainer(lNode, result);
}
const tNodeType = tNode.type;
if (tNodeType & 8) {
collectNativeNodes(tView, lView, tNode.child, result);
} else if (tNodeType & 32) {
const nextRNode = icuContainerIterate(tNode, lView);
let rNode;
while (rNode = nextRNode()) {
result.push(rNode);
}
} else if (tNodeType & 16) {
const nodesInSlot = getProjectionNodes(lView, tNode);
if (Array.isArray(nodesInSlot)) {
result.push(...nodesInSlot);
} else {
const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);
ngDevMode && assertParentView(parentView);
collectNativeNodes(parentView[TVIEW], parentView, nodesInSlot, result, true);
}
}
tNode = isProjection ? tNode.projectionNext : tNode.next;
}
return result;
}
function collectNativeNodesInLContainer(lContainer, result) {
for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
const lViewInAContainer = lContainer[i];
const lViewFirstChildTNode = lViewInAContainer[TVIEW].firstChild;
if (lViewFirstChildTNode !== null) {
collectNativeNodes(lViewInAContainer[TVIEW], lViewInAContainer, lViewFirstChildTNode, result);
}
}
if (lContainer[NATIVE] !== lContainer[HOST]) {
result.push(lContainer[NATIVE]);
}
}
function addAfterRenderSequencesForView(lView) {
if (lView[AFTER_RENDER_SEQUENCES_TO_ADD] !== null) {
for (const sequence of lView[AFTER_RENDER_SEQUENCES_TO_ADD]) {
sequence.impl.addSequence(sequence);
}
lView[AFTER_RENDER_SEQUENCES_TO_ADD].length = 0;
}
}
var freeConsumers = [];
function getOrBorrowReactiveLViewConsumer(lView) {
return lView[REACTIVE_TEMPLATE_CONSUMER] ?? borrowReactiveLViewConsumer(lView);
}
function borrowReactiveLViewConsumer(lView) {
const consumer = freeConsumers.pop() ?? Object.create(REACTIVE_LVIEW_CONSUMER_NODE);
consumer.lView = lView;
return consumer;
}
function maybeReturnReactiveLViewConsumer(consumer) {
if (consumer.lView[REACTIVE_TEMPLATE_CONSUMER] === consumer) {
return;
}
consumer.lView = null;
freeConsumers.push(consumer);
}
var REACTIVE_LVIEW_CONSUMER_NODE = __spreadProps(__spreadValues({}, REACTIVE_NODE), {
consumerIsAlwaysLive: true,
kind: "template",
consumerMarkedDirty: (node) => {
markAncestorsForTraversal(node.lView);
},
consumerOnSignalRead() {
this.lView[REACTIVE_TEMPLATE_CONSUMER] = this;
}
});
function getOrCreateTemporaryConsumer(lView) {
const consumer = lView[REACTIVE_TEMPLATE_CONSUMER] ?? Object.create(TEMPORARY_CONSUMER_NODE);
consumer.lView = lView;
return consumer;
}
var TEMPORARY_CONSUMER_NODE = __spreadProps(__spreadValues({}, REACTIVE_NODE), {
consumerIsAlwaysLive: true,
kind: "template",
consumerMarkedDirty: (node) => {
let parent = getLViewParent(node.lView);
while (parent && !viewShouldHaveReactiveConsumer(parent[TVIEW])) {
parent = getLViewParent(parent);
}
if (!parent) {
return;
}
markViewForRefresh(parent);
},
consumerOnSignalRead() {
this.lView[REACTIVE_TEMPLATE_CONSUMER] = this;
}
});
function viewShouldHaveReactiveConsumer(tView) {
return tView.type !== 2;
}
function isReactiveLViewConsumer(node) {
return node.kind === "template";
}
function runEffectsInView(view) {
if (view[EFFECTS] === null) {
return;
}
let tryFlushEffects = true;
while (tryFlushEffects) {
let foundDirtyEffect = false;
for (const effect2 of view[EFFECTS]) {
if (!effect2.dirty) {
continue;
}
foundDirtyEffect = true;
if (effect2.zone === null || Zone.current === effect2.zone) {
effect2.run();
} else {
effect2.zone.run(() => effect2.run());
}
}
tryFlushEffects = foundDirtyEffect && !!(view[FLAGS] & 8192);
}
}
var MAXIMUM_REFRESH_RERUNS$1 = 100;
function detectChangesInternal(lView, mode = 0) {
const environment = lView[ENVIRONMENT];
const rendererFactory = environment.rendererFactory;
const checkNoChangesMode = !!ngDevMode && isInCheckNoChangesMode();
if (!checkNoChangesMode) {
rendererFactory.begin?.();
}
try {
detectChangesInViewWhileDirty(lView, mode);
} finally {
if (!checkNoChangesMode) {
rendererFactory.end?.();
}
}
}
function detectChangesInViewWhileDirty(lView, mode) {
const lastIsRefreshingViewsValue = isRefreshingViews();
try {
setIsRefreshingViews(true);
detectChangesInView(lView, mode);
if (ngDevMode && isExhaustiveCheckNoChanges()) {
return;
}
let retries = 0;
while (requiresRefreshOrTraversal(lView)) {
if (retries === MAXIMUM_REFRESH_RERUNS$1) {
throw new RuntimeError(103, ngDevMode && "Infinite change detection while trying to refresh views. There may be components which each cause the other to require a refresh, causing an infinite loop.");
}
retries++;
detectChangesInView(
lView,
1
/* ChangeDetectionMode.Targeted */
);
}
} finally {
setIsRefreshingViews(lastIsRefreshingViewsValue);
}
}
function checkNoChangesInternal(lView, exhaustive) {
setIsInCheckNoChangesMode(exhaustive ? CheckNoChangesMode.Exhaustive : CheckNoChangesMode.OnlyDirtyViews);
try {
detectChangesInternal(lView);
} finally {
setIsInCheckNoChangesMode(CheckNoChangesMode.Off);
}
}
function refreshView(tView, lView, templateFn, context2) {
ngDevMode && assertEqual(isCreationMode(lView), false, "Should be run in update mode");
if (isDestroyed(lView))
return;
const flags = lView[FLAGS];
const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();
const isInExhaustiveCheckNoChangesPass = ngDevMode && isExhaustiveCheckNoChanges();
enterView(lView);
let returnConsumerToPool = true;
let prevConsumer = null;
let currentConsumer = null;
if (!isInCheckNoChangesPass) {
if (viewShouldHaveReactiveConsumer(tView)) {
currentConsumer = getOrBorrowReactiveLViewConsumer(lView);
prevConsumer = consumerBeforeComputation(currentConsumer);
} else if (getActiveConsumer() === null) {
returnConsumerToPool = false;
currentConsumer = getOrCreateTemporaryConsumer(lView);
prevConsumer = consumerBeforeComputation(currentConsumer);
} else if (lView[REACTIVE_TEMPLATE_CONSUMER]) {
consumerDestroy(lView[REACTIVE_TEMPLATE_CONSUMER]);
lView[REACTIVE_TEMPLATE_CONSUMER] = null;
}
}
try {
resetPreOrderHookFlags(lView);
setBindingIndex(tView.bindingStartIndex);
if (templateFn !== null) {
executeTemplate(tView, lView, templateFn, 2, context2);
}
const hooksInitPhaseCompleted = (flags & 3) === 3;
if (!isInCheckNoChangesPass) {
if (hooksInitPhaseCompleted) {
const preOrderCheckHooks = tView.preOrderCheckHooks;
if (preOrderCheckHooks !== null) {
executeCheckHooks(lView, preOrderCheckHooks, null);
}
} else {
const preOrderHooks = tView.preOrderHooks;
if (preOrderHooks !== null) {
executeInitAndCheckHooks(lView, preOrderHooks, 0, null);
}
incrementInitPhaseFlags(
lView,
0
/* InitPhaseState.OnInitHooksToBeRun */
);
}
}
if (!isInExhaustiveCheckNoChangesPass) {
markTransplantedViewsForRefresh(lView);
}
runEffectsInView(lView);
detectChangesInEmbeddedViews(
lView,
0
/* ChangeDetectionMode.Global */
);
if (tView.contentQueries !== null) {
refreshContentQueries(tView, lView);
}
if (!isInCheckNoChangesPass) {
if (hooksInitPhaseCompleted) {
const contentCheckHooks = tView.contentCheckHooks;
if (contentCheckHooks !== null) {
executeCheckHooks(lView, contentCheckHooks);
}
} else {
const contentHooks = tView.contentHooks;
if (contentHooks !== null) {
executeInitAndCheckHooks(
lView,
contentHooks,
1
/* InitPhaseState.AfterContentInitHooksToBeRun */
);
}
incrementInitPhaseFlags(
lView,
1
/* InitPhaseState.AfterContentInitHooksToBeRun */
);
}
}
processHostBindingOpCodes(tView, lView);
const components = tView.components;
if (components !== null) {
detectChangesInChildComponents(
lView,
components,
0
/* ChangeDetectionMode.Global */
);
}
const viewQuery = tView.viewQuery;
if (viewQuery !== null) {
executeViewQueryFn(2, viewQuery, context2);
}
if (!isInCheckNoChangesPass) {
if (hooksInitPhaseCompleted) {
const viewCheckHooks = tView.viewCheckHooks;
if (viewCheckHooks !== null) {
executeCheckHooks(lView, viewCheckHooks);
}
} else {
const viewHooks = tView.viewHooks;
if (viewHooks !== null) {
executeInitAndCheckHooks(
lView,
viewHooks,
2
/* InitPhaseState.AfterViewInitHooksToBeRun */
);
}
incrementInitPhaseFlags(
lView,
2
/* InitPhaseState.AfterViewInitHooksToBeRun */
);
}
}
if (tView.firstUpdatePass === true) {
tView.firstUpdatePass = false;
}
if (lView[EFFECTS_TO_SCHEDULE]) {
for (const notifyEffect of lView[EFFECTS_TO_SCHEDULE]) {
notifyEffect();
}
lView[EFFECTS_TO_SCHEDULE] = null;
}
if (!isInCheckNoChangesPass) {
addAfterRenderSequencesForView(lView);
lView[FLAGS] &= ~(64 | 8);
}
} catch (e) {
if (!isInCheckNoChangesPass) {
markAncestorsForTraversal(lView);
}
throw e;
} finally {
if (currentConsumer !== null) {
consumerAfterComputation(currentConsumer, prevConsumer);
if (returnConsumerToPool) {
maybeReturnReactiveLViewConsumer(currentConsumer);
}
}
leaveView();
}
}
function detectChangesInEmbeddedViews(lView, mode) {
for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
const embeddedLView = lContainer[i];
detectChangesInViewIfAttached(embeddedLView, mode);
}
}
}
function markTransplantedViewsForRefresh(lView) {
for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
if (!(lContainer[FLAGS] & 2))
continue;
const movedViews = lContainer[MOVED_VIEWS];
ngDevMode && assertDefined(movedViews, "Transplanted View flags set but missing MOVED_VIEWS");
for (let i = 0; i < movedViews.length; i++) {
const movedLView = movedViews[i];
markViewForRefresh(movedLView);
}
}
}
function detectChangesInComponent(hostLView, componentHostIdx, mode) {
ngDevMode && assertEqual(isCreationMode(hostLView), false, "Should be run in update mode");
profiler(
18
/* ProfilerEvent.ComponentStart */
);
const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
detectChangesInViewIfAttached(componentView, mode);
profiler(19, componentView[CONTEXT]);
}
function detectChangesInViewIfAttached(lView, mode) {
if (!viewAttachedToChangeDetector(lView)) {
return;
}
detectChangesInView(lView, mode);
}
function detectChangesInView(lView, mode) {
const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();
const tView = lView[TVIEW];
const flags = lView[FLAGS];
const consumer = lView[REACTIVE_TEMPLATE_CONSUMER];
let shouldRefreshView = !!(mode === 0 && flags & 16);
shouldRefreshView ||= !!(flags & 64 && mode === 0 && !isInCheckNoChangesPass);
shouldRefreshView ||= !!(flags & 1024);
shouldRefreshView ||= !!(consumer?.dirty && consumerPollProducersForChange(consumer));
shouldRefreshView ||= !!(ngDevMode && isExhaustiveCheckNoChanges());
if (consumer) {
consumer.dirty = false;
}
lView[FLAGS] &= ~(8192 | 1024);
if (shouldRefreshView) {
refreshView(tView, lView, tView.template, lView[CONTEXT]);
} else if (flags & 8192) {
const prevConsumer = setActiveConsumer(null);
try {
if (!isInCheckNoChangesPass) {
runEffectsInView(lView);
}
detectChangesInEmbeddedViews(
lView,
1
/* ChangeDetectionMode.Targeted */
);
const components = tView.components;
if (components !== null) {
detectChangesInChildComponents(
lView,
components,
1
/* ChangeDetectionMode.Targeted */
);
}
if (!isInCheckNoChangesPass) {
addAfterRenderSequencesForView(lView);
}
} finally {
setActiveConsumer(prevConsumer);
}
}
}
function detectChangesInChildComponents(hostLView, components, mode) {
for (let i = 0; i < components.length; i++) {
detectChangesInComponent(hostLView, components[i], mode);
}
}
function processHostBindingOpCodes(tView, lView) {
const hostBindingOpCodes = tView.hostBindingOpCodes;
if (hostBindingOpCodes === null)
return;
try {
for (let i = 0; i < hostBindingOpCodes.length; i++) {
const opCode = hostBindingOpCodes[i];
if (opCode < 0) {
setSelectedIndex(~opCode);
} else {
const directiveIdx = opCode;
const bindingRootIndx = hostBindingOpCodes[++i];
const hostBindingFn = hostBindingOpCodes[++i];
setBindingRootForHostBindings(bindingRootIndx, directiveIdx);
const context2 = lView[directiveIdx];
profiler(24, context2);
hostBindingFn(2, context2);
profiler(25, context2);
}
}
} finally {
setSelectedIndex(-1);
}
}
function markViewDirty(lView, source) {
const dirtyBitsToUse = isRefreshingViews() ? (
// When we are actively refreshing views, we only use the `Dirty` bit to mark a view
64
) : (
// When we are not actively refreshing a view tree, it is absolutely
// valid to update state and mark views dirty. We use the `RefreshView` flag in this
// case to allow synchronously rerunning change detection. This applies today to
// afterRender hooks as well as animation listeners which execute after detecting
// changes in a view when the render factory flushes.
1024 | 64
);
lView[ENVIRONMENT].changeDetectionScheduler?.notify(source);
while (lView) {
lView[FLAGS] |= dirtyBitsToUse;
const parent = getLViewParent(lView);
if (isRootView(lView) && !parent) {
return lView;
}
lView = parent;
}
return null;
}
function createLContainer(hostNative, currentView, native, tNode) {
ngDevMode && assertLView(currentView);
const lContainer = [
hostNative,
// host native
true,
// Boolean `true` in this position signifies that this is an `LContainer`
0,
// flags
currentView,
// parent
null,
// next
tNode,
// t_host
null,
// dehydrated views
native,
// native,
null,
// view refs
null
// moved views
];
ngDevMode && assertEqual(lContainer.length, CONTAINER_HEADER_OFFSET, "Should allocate correct number of slots for LContainer header.");
return lContainer;
}
function getLViewFromLContainer(lContainer, index) {
const adjustedIndex = CONTAINER_HEADER_OFFSET + index;
if (adjustedIndex < lContainer.length) {
const lView = lContainer[adjustedIndex];
ngDevMode && assertLView(lView);
return lView;
}
return void 0;
}
function addLViewToLContainer(lContainer, lView, index, addToDOM = true) {
const tView = lView[TVIEW];
insertView(tView, lView, lContainer, index);
if (addToDOM) {
const beforeNode = getBeforeNodeForView(index, lContainer);
const renderer = lView[RENDERER];
const parentRNode = renderer.parentNode(lContainer[NATIVE]);
if (parentRNode !== null) {
addViewToDOM(tView, lContainer[T_HOST], renderer, lView, parentRNode, beforeNode);
}
}
const hydrationInfo = lView[HYDRATION];
if (hydrationInfo !== null && hydrationInfo.firstChild !== null) {
hydrationInfo.firstChild = null;
}
}
function removeLViewFromLContainer(lContainer, index) {
const lView = detachView(lContainer, index);
if (lView !== void 0) {
destroyLView(lView[TVIEW], lView);
}
return lView;
}
function detachView(lContainer, removeIndex) {
if (lContainer.length <= CONTAINER_HEADER_OFFSET)
return;
const indexInContainer = CONTAINER_HEADER_OFFSET + removeIndex;
const viewToDetach = lContainer[indexInContainer];
if (viewToDetach) {
const declarationLContainer = viewToDetach[DECLARATION_LCONTAINER];
if (declarationLContainer !== null && declarationLContainer !== lContainer) {
detachMovedView(declarationLContainer, viewToDetach);
}
if (removeIndex > 0) {
lContainer[indexInContainer - 1][NEXT] = viewToDetach[NEXT];
}
const removedLView = removeFromArray(lContainer, CONTAINER_HEADER_OFFSET + removeIndex);
removeViewFromDOM(viewToDetach[TVIEW], viewToDetach);
const lQueries = removedLView[QUERIES];
if (lQueries !== null) {
lQueries.detachView(removedLView[TVIEW]);
}
viewToDetach[PARENT] = null;
viewToDetach[NEXT] = null;
viewToDetach[FLAGS] &= ~128;
}
return viewToDetach;
}
function insertView(tView, lView, lContainer, index) {
ngDevMode && assertLView(lView);
ngDevMode && assertLContainer(lContainer);
const indexInContainer = CONTAINER_HEADER_OFFSET + index;
const containerLength = lContainer.length;
if (index > 0) {
lContainer[indexInContainer - 1][NEXT] = lView;
}
if (index < containerLength - CONTAINER_HEADER_OFFSET) {
lView[NEXT] = lContainer[indexInContainer];
addToArray(lContainer, CONTAINER_HEADER_OFFSET + index, lView);
} else {
lContainer.push(lView);
lView[NEXT] = null;
}
lView[PARENT] = lContainer;
const declarationLContainer = lView[DECLARATION_LCONTAINER];
if (declarationLContainer !== null && lContainer !== declarationLContainer) {
trackMovedView(declarationLContainer, lView);
}
const lQueries = lView[QUERIES];
if (lQueries !== null) {
lQueries.insertView(tView);
}
updateAncestorTraversalFlagsOnAttach(lView);
lView[FLAGS] |= 128;
}
function trackMovedView(declarationContainer, lView) {
ngDevMode && assertDefined(lView, "LView required");
ngDevMode && assertLContainer(declarationContainer);
const movedViews = declarationContainer[MOVED_VIEWS];
const parent = lView[PARENT];
ngDevMode && assertDefined(parent, "missing parent");
if (isLView(parent)) {
declarationContainer[FLAGS] |= 2;
} else {
const insertedComponentLView = parent[PARENT][DECLARATION_COMPONENT_VIEW];
ngDevMode && assertDefined(insertedComponentLView, "Missing insertedComponentLView");
const declaredComponentLView = lView[DECLARATION_COMPONENT_VIEW];
ngDevMode && assertDefined(declaredComponentLView, "Missing declaredComponentLView");
if (declaredComponentLView !== insertedComponentLView) {
declarationContainer[FLAGS] |= 2;
}
}
if (movedViews === null) {
declarationContainer[MOVED_VIEWS] = [lView];
} else {
movedViews.push(lView);
}
}
var ViewRef = class {
_lView;
_cdRefInjectingView;
_appRef = null;
_attachedToViewContainer = false;
exhaustive;
get rootNodes() {
const lView = this._lView;
const tView = lView[TVIEW];
return collectNativeNodes(tView, lView, tView.firstChild, []);
}
constructor(_lView, _cdRefInjectingView) {
this._lView = _lView;
this._cdRefInjectingView = _cdRefInjectingView;
}
get context() {
return this._lView[CONTEXT];
}
/**
* @deprecated Replacing the full context object is not supported. Modify the context
* directly, or consider using a `Proxy` if you need to replace the full object.
* // TODO(devversion): Remove this.
*/
set context(value) {
if (ngDevMode) {
console.warn("Angular: Replacing the `context` object of an `EmbeddedViewRef` is deprecated.");
}
this._lView[CONTEXT] = value;
}
get destroyed() {
return isDestroyed(this._lView);
}
destroy() {
if (this._appRef) {
this._appRef.detachView(this);
} else if (this._attachedToViewContainer) {
const parent = this._lView[PARENT];
if (isLContainer(parent)) {
const viewRefs = parent[VIEW_REFS];
const index = viewRefs ? viewRefs.indexOf(this) : -1;
if (index > -1) {
ngDevMode && assertEqual(index, parent.indexOf(this._lView) - CONTAINER_HEADER_OFFSET, "An attached view should be in the same position within its container as its ViewRef in the VIEW_REFS array.");
detachView(parent, index);
removeFromArray(viewRefs, index);
}
}
this._attachedToViewContainer = false;
}
destroyLView(this._lView[TVIEW], this._lView);
}
onDestroy(callback) {
storeLViewOnDestroy(this._lView, callback);
}
/**
* Marks a view and all of its ancestors dirty.
*
* This can be used to ensure an {@link ChangeDetectionStrategy#OnPush} component is
* checked when it needs to be re-rendered but the two normal triggers haven't marked it
* dirty (i.e. inputs haven't changed and events haven't fired in the view).
*
* <!-- TODO: Add a link to a chapter on OnPush components -->
*
* @usageNotes
* ### Example
*
* ```ts
* @Component({
* selector: 'app-root',
* template: `Number of ticks: {{numberOfTicks}}`
* changeDetection: ChangeDetectionStrategy.OnPush,
* })
* class AppComponent {
* numberOfTicks = 0;
*
* constructor(private ref: ChangeDetectorRef) {
* setInterval(() => {
* this.numberOfTicks++;
* // the following is required, otherwise the view will not be updated
* this.ref.markForCheck();
* }, 1000);
* }
* }
* ```
*/
markForCheck() {
markViewDirty(
this._cdRefInjectingView || this._lView,
4
/* NotificationSource.MarkForCheck */
);
}
/**
* Detaches the view from the change detection tree.
*
* Detached views will not be checked during change detection runs until they are
* re-attached, even if they are dirty. `detach` can be used in combination with
* {@link ChangeDetectorRef#detectChanges} to implement local change
* detection checks.
*
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
* <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
*
* @usageNotes
* ### Example
*
* The following example defines a component with a large list of readonly data.
* Imagine the data changes constantly, many times per second. For performance reasons,
* we want to check and update the list every five seconds. We can do that by detaching
* the component's change detector and doing a local check every five seconds.
*
* ```ts
* class DataProvider {
* // in a real application the returned data will be different every time
* get data() {
* return [1,2,3,4,5];
* }
* }
*
* @Component({
* selector: 'giant-list',
* template: `
* @for(d of dataProvider.data; track $index) {
* <li>Data {{d}}</li>
* }
* `,
* })
* class GiantList {
* constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {
* ref.detach();
* setInterval(() => {
* this.ref.detectChanges();
* }, 5000);
* }
* }
*
* @Component({
* selector: 'app',
* providers: [DataProvider],
* template: `
* <giant-list><giant-list>
* `,
* })
* class App {
* }
* ```
*/
detach() {
this._lView[FLAGS] &= ~128;
}
/**
* Re-attaches a view to the change detection tree.
*
* This can be used to re-attach views that were previously detached from the tree
* using {@link ChangeDetectorRef#detach}. Views are attached to the tree by default.
*
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
*
* @usageNotes
* ### Example
*
* The following example creates a component displaying `live` data. The component will detach
* its change detector from the main change detector tree when the component's live property
* is set to false.
*
* ```ts
* class DataProvider {
* data = 1;
*
* constructor() {
* setInterval(() => {
* this.data = this.data * 2;
* }, 500);
* }
* }
*
* @Component({
* selector: 'live-data',
* inputs: ['live'],
* template: 'Data: {{dataProvider.data}}'
* })
* class LiveData {
* constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}
*
* set live(value) {
* if (value) {
* this.ref.reattach();
* } else {
* this.ref.detach();
* }
* }
* }
*
* @Component({
* selector: 'app-root',
* providers: [DataProvider],
* template: `
* Live Update: <input type="checkbox" [(ngModel)]="live">
* <live-data [live]="live"><live-data>
* `,
* })
* class AppComponent {
* live = true;
* }
* ```
*/
reattach() {
updateAncestorTraversalFlagsOnAttach(this._lView);
this._lView[FLAGS] |= 128;
}
/**
* Checks the view and its children.
*
* This can also be used in combination with {@link ChangeDetectorRef#detach} to implement
* local change detection checks.
*
* <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
* <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
*
* @usageNotes
* ### Example
*
* The following example defines a component with a large list of readonly data.
* Imagine, the data changes constantly, many times per second. For performance reasons,
* we want to check and update the list every five seconds.
*
* We can do that by detaching the component's change detector and doing a local change detection
* check every five seconds.
*
* See {@link ChangeDetectorRef#detach} for more information.
*/
detectChanges() {
this._lView[FLAGS] |= 1024;
detectChangesInternal(this._lView);
}
/**
* Checks the change detector and its children, and throws if any changes are detected.
*
* This is used in development mode to verify that running change detection doesn't
* introduce other changes.
*/
checkNoChanges() {
if (!ngDevMode)
return;
try {
this.exhaustive ??= this._lView[INJECTOR].get(UseExhaustiveCheckNoChanges, USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT);
} catch {
this.exhaustive = USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT;
}
checkNoChangesInternal(this._lView, this.exhaustive);
}
attachToViewContainerRef() {
if (this._appRef) {
throw new RuntimeError(902, ngDevMode && "This view is already attached directly to the ApplicationRef!");
}
this._attachedToViewContainer = true;
}
detachFromAppRef() {
this._appRef = null;
const isRoot = isRootView(this._lView);
const declarationContainer = this._lView[DECLARATION_LCONTAINER];
if (declarationContainer !== null && !isRoot) {
detachMovedView(declarationContainer, this._lView);
}
detachViewFromDOM(this._lView[TVIEW], this._lView);
}
attachToAppRef(appRef) {
if (this._attachedToViewContainer) {
throw new RuntimeError(902, ngDevMode && "This view is already attached to a ViewContainer!");
}
this._appRef = appRef;
const isRoot = isRootView(this._lView);
const declarationContainer = this._lView[DECLARATION_LCONTAINER];
if (declarationContainer !== null && !isRoot) {
trackMovedView(declarationContainer, this._lView);
}
updateAncestorTraversalFlagsOnAttach(this._lView);
}
};
var TemplateRef = class {
_declarationLView;
_declarationTContainer;
/**
* The anchor element in the parent view for this embedded view.
*
* The data-binding and [injection contexts](guide/di/dependency-injection-context) of embedded
* views created from this `TemplateRef` inherit from the contexts of this location.
*
* Typically new embedded views are attached to the view container of this location, but in
* advanced use-cases, the view can be attached to a different container while keeping the
* data-binding and injection context from the original location.
*
*/
elementRef;
/**
* @internal
* @nocollapse
*/
static __NG_ELEMENT_ID__ = injectTemplateRef;
/** @internal */
constructor(_declarationLView, _declarationTContainer, elementRef) {
this._declarationLView = _declarationLView;
this._declarationTContainer = _declarationTContainer;
this.elementRef = elementRef;
}
/**
* Returns an `ssrId` associated with a TView, which was used to
* create this instance of the `TemplateRef`.
*
* @internal
*/
get ssrId() {
return this._declarationTContainer.tView?.ssrId || null;
}
/**
* Instantiates an unattached embedded view based on this template.
* @param context The data-binding context of the embedded view, as declared
* in the `<ng-template>` usage.
* @param injector Injector to be used within the embedded view.
* @returns The new embedded view object.
*/
createEmbeddedView(context2, injector) {
return this.createEmbeddedViewImpl(context2, injector);
}
/**
* Implementation of the `createEmbeddedView` function.
*
* This implementation is internal and allows framework code
* to invoke it with extra parameters (e.g. for hydration) without
* affecting public API.
*
* @internal
*/
createEmbeddedViewImpl(context2, injector, dehydratedView) {
const embeddedLView = createAndRenderEmbeddedLView(this._declarationLView, this._declarationTContainer, context2, { embeddedViewInjector: injector, dehydratedView });
return new ViewRef(embeddedLView);
}
};
function injectTemplateRef() {
return createTemplateRef(getCurrentTNode(), getLView());
}
function createTemplateRef(hostTNode, hostLView) {
if (hostTNode.type & 4) {
ngDevMode && assertDefined(hostTNode.tView, "TView must be allocated");
return new TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView));
}
return null;
}
var AT_THIS_LOCATION = "<-- AT THIS LOCATION";
function getFriendlyStringFromTNodeType(tNodeType) {
switch (tNodeType) {
case 4:
return "view container";
case 2:
return "element";
case 8:
return "ng-container";
case 32:
return "icu";
case 64:
return "i18n";
case 16:
return "projection";
case 1:
return "text";
case 128:
return "@let";
default:
return "<unknown>";
}
}
function validateSiblingNodeExists(node) {
validateNodeExists(node);
if (!node.nextSibling) {
const header = "During hydration Angular expected more sibling nodes to be present.\n\n";
const actual = `Actual DOM is:
${describeDomFromNode(node)}
`;
const footer = getHydrationErrorFooter();
const message = header + actual + footer;
markRNodeAsHavingHydrationMismatch(node, "", actual);
throw new RuntimeError(-501, message);
}
}
function validateNodeExists(node, lView = null, tNode = null) {
if (!node) {
const header = "During hydration, Angular expected an element to be present at this location.\n\n";
let expected = "";
let footer = "";
if (lView !== null && tNode !== null) {
expected = describeExpectedDom(lView, tNode, false);
footer = getHydrationErrorFooter();
markRNodeAsHavingHydrationMismatch(unwrapRNode(lView[HOST]), expected, "");
}
throw new RuntimeError(-502, `${header}${expected}
${footer}`);
}
}
function stringifyTNodeAttrs(tNode) {
const results = [];
if (tNode.attrs) {
for (let i = 0; i < tNode.attrs.length; ) {
const attrName = tNode.attrs[i++];
if (typeof attrName == "number") {
break;
}
const attrValue = tNode.attrs[i++];
results.push(`${attrName}="${shorten(attrValue)}"`);
}
}
return results.join(" ");
}
var internalAttrs = /* @__PURE__ */ new Set(["ngh", "ng-version", "ng-server-context"]);
function stringifyRNodeAttrs(rNode) {
const results = [];
for (let i = 0; i < rNode.attributes.length; i++) {
const attr = rNode.attributes[i];
if (internalAttrs.has(attr.name))
continue;
results.push(`${attr.name}="${shorten(attr.value)}"`);
}
return results.join(" ");
}
function describeTNode(tNode, innerContent = "\u2026") {
switch (tNode.type) {
case 1:
const content = tNode.value ? `(${tNode.value})` : "";
return `#text${content}`;
case 2:
const attrs = stringifyTNodeAttrs(tNode);
const tag = tNode.value.toLowerCase();
return `<${tag}${attrs ? " " + attrs : ""}>${innerContent}</${tag}>`;
case 8:
return "<!-- ng-container -->";
case 4:
return "<!-- container -->";
default:
const typeAsString = getFriendlyStringFromTNodeType(tNode.type);
return `#node(${typeAsString})`;
}
}
function describeRNode(rNode, innerContent = "\u2026") {
const node = rNode;
switch (node.nodeType) {
case Node.ELEMENT_NODE:
const tag = node.tagName.toLowerCase();
const attrs = stringifyRNodeAttrs(node);
return `<${tag}${attrs ? " " + attrs : ""}>${innerContent}</${tag}>`;
case Node.TEXT_NODE:
const content = node.textContent ? shorten(node.textContent) : "";
return `#text${content ? `(${content})` : ""}`;
case Node.COMMENT_NODE:
return `<!-- ${shorten(node.textContent ?? "")} -->`;
default:
return `#node(${node.nodeType})`;
}
}
function describeExpectedDom(lView, tNode, isViewContainerAnchor) {
const spacer = " ";
let content = "";
if (tNode.prev) {
content += spacer + "\u2026\n";
content += spacer + describeTNode(tNode.prev) + "\n";
} else if (tNode.type && tNode.type & 12) {
content += spacer + "\u2026\n";
}
if (isViewContainerAnchor) {
content += spacer + describeTNode(tNode) + "\n";
content += spacer + `<!-- container --> ${AT_THIS_LOCATION}
`;
} else {
content += spacer + describeTNode(tNode) + ` ${AT_THIS_LOCATION}
`;
}
content += spacer + "\u2026\n";
const parentRNode = tNode.type ? getParentRElement(lView[TVIEW], tNode, lView) : null;
if (parentRNode) {
content = describeRNode(parentRNode, "\n" + content);
}
return content;
}
function describeDomFromNode(node) {
const spacer = " ";
let content = "";
const currentNode = node;
if (currentNode.previousSibling) {
content += spacer + "\u2026\n";
content += spacer + describeRNode(currentNode.previousSibling) + "\n";
}
content += spacer + describeRNode(currentNode) + ` ${AT_THIS_LOCATION}
`;
if (node.nextSibling) {
content += spacer + "\u2026\n";
}
if (node.parentNode) {
content = describeRNode(currentNode.parentNode, "\n" + content);
}
return content;
}
function getHydrationErrorFooter(componentClassName) {
const componentInfo = componentClassName ? `the "${componentClassName}"` : "corresponding";
return `To fix this problem:
* check ${componentInfo} component for hydration-related issues
* check to see if your template has valid HTML structure
* or skip hydration by adding the \`ngSkipHydration\` attribute to its host node in a template
`;
}
function stripNewlines(input2) {
return input2.replace(/\s+/gm, "");
}
function shorten(input2, maxLength = 50) {
if (!input2) {
return "";
}
input2 = stripNewlines(input2);
return input2.length > maxLength ? `${input2.substring(0, maxLength - 1)}\u2026` : input2;
}
function getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView) {
const tNodeInsertBeforeIndex = currentTNode.insertBeforeIndex;
const insertBeforeIndex = Array.isArray(tNodeInsertBeforeIndex) ? tNodeInsertBeforeIndex[0] : tNodeInsertBeforeIndex;
if (insertBeforeIndex === null) {
return getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView);
} else {
ngDevMode && assertIndexInRange(lView, insertBeforeIndex);
return unwrapRNode(lView[insertBeforeIndex]);
}
}
function processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRElement) {
const tNodeInsertBeforeIndex = childTNode.insertBeforeIndex;
if (Array.isArray(tNodeInsertBeforeIndex)) {
ngDevMode && assertDomNode(childRNode);
let i18nParent = childRNode;
let anchorRNode = null;
if (!(childTNode.type & 3)) {
anchorRNode = i18nParent;
i18nParent = parentRElement;
}
if (i18nParent !== null && childTNode.componentOffset === -1) {
for (let i = 1; i < tNodeInsertBeforeIndex.length; i++) {
const i18nChild = lView[tNodeInsertBeforeIndex[i]];
nativeInsertBefore(renderer, i18nParent, i18nChild, anchorRNode, false);
}
}
}
}
function getOrCreateTNode(tView, index, type, name, attrs) {
ngDevMode && index !== 0 && // 0 are bogus nodes and they are OK. See `createContainerRef` in
// `view_engine_compatibility` for additional context.
assertGreaterThanOrEqual(index, HEADER_OFFSET, "TNodes can't be in the LView header.");
ngDevMode && assertPureTNodeType(type);
let tNode = tView.data[index];
if (tNode === null) {
tNode = createTNodeAtIndex(tView, index, type, name, attrs);
if (isInI18nBlock()) {
tNode.flags |= 32;
}
} else if (tNode.type & 64) {
tNode.type = type;
tNode.value = name;
tNode.attrs = attrs;
const parent = getCurrentParentTNode();
tNode.injectorIndex = parent === null ? -1 : parent.injectorIndex;
ngDevMode && assertTNodeForTView(tNode, tView);
ngDevMode && assertEqual(index, tNode.index, "Expecting same index");
}
setCurrentTNode(tNode, true);
return tNode;
}
function createTNodeAtIndex(tView, index, type, name, attrs) {
const currentTNode = getCurrentTNodePlaceholderOk();
const isParent = isCurrentTNodeParent();
const parent = isParent ? currentTNode : currentTNode && currentTNode.parent;
const tNode = tView.data[index] = createTNode(tView, parent, type, index, name, attrs);
linkTNodeInTView(tView, tNode, currentTNode, isParent);
return tNode;
}
function linkTNodeInTView(tView, tNode, currentTNode, isParent) {
if (tView.firstChild === null) {
tView.firstChild = tNode;
}
if (currentTNode !== null) {
if (isParent) {
if (currentTNode.child == null && tNode.parent !== null) {
currentTNode.child = tNode;
}
} else {
if (currentTNode.next === null) {
currentTNode.next = tNode;
tNode.prev = currentTNode;
}
}
}
}
function createTNode(tView, tParent, type, index, value, attrs) {
ngDevMode && index !== 0 && // 0 are bogus nodes and they are OK. See `createContainerRef` in
// `view_engine_compatibility` for additional context.
assertGreaterThanOrEqual(index, HEADER_OFFSET, "TNodes can't be in the LView header.");
ngDevMode && assertNotSame(attrs, void 0, "'undefined' is not valid value for 'attrs'");
ngDevMode && tParent && assertTNodeForTView(tParent, tView);
let injectorIndex = tParent ? tParent.injectorIndex : -1;
let flags = 0;
if (isInSkipHydrationBlock()) {
flags |= 128;
}
const tNode = {
type,
index,
insertBeforeIndex: null,
injectorIndex,
directiveStart: -1,
directiveEnd: -1,
directiveStylingLast: -1,
componentOffset: -1,
propertyBindings: null,
flags,
providerIndexes: 0,
value,
attrs,
mergedAttrs: null,
localNames: null,
initialInputs: null,
inputs: null,
hostDirectiveInputs: null,
outputs: null,
hostDirectiveOutputs: null,
directiveToIndex: null,
tView: null,
next: null,
prev: null,
projectionNext: null,
child: null,
parent: tParent,
projection: null,
styles: null,
stylesWithoutHost: null,
residualStyles: void 0,
classes: null,
classesWithoutHost: null,
residualClasses: void 0,
classBindings: 0,
styleBindings: 0
};
if (ngDevMode) {
Object.seal(tNode);
}
return tNode;
}
function addTNodeAndUpdateInsertBeforeIndex(previousTNodes, newTNode) {
ngDevMode && assertEqual(newTNode.insertBeforeIndex, null, "We expect that insertBeforeIndex is not set");
previousTNodes.push(newTNode);
if (previousTNodes.length > 1) {
for (let i = previousTNodes.length - 2; i >= 0; i--) {
const existingTNode = previousTNodes[i];
if (!isI18nText(existingTNode)) {
if (isNewTNodeCreatedBefore(existingTNode, newTNode) && getInsertBeforeIndex(existingTNode) === null) {
setInsertBeforeIndex(existingTNode, newTNode.index);
}
}
}
}
}
function isI18nText(tNode) {
return !(tNode.type & 64);
}
function isNewTNodeCreatedBefore(existingTNode, newTNode) {
return isI18nText(newTNode) || existingTNode.index > newTNode.index;
}
function getInsertBeforeIndex(tNode) {
const index = tNode.insertBeforeIndex;
return Array.isArray(index) ? index[0] : index;
}
function setInsertBeforeIndex(tNode, value) {
const index = tNode.insertBeforeIndex;
if (Array.isArray(index)) {
index[0] = value;
} else {
setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);
tNode.insertBeforeIndex = value;
}
}
function getTIcu(tView, index) {
const value = tView.data[index];
if (value === null || typeof value === "string")
return null;
if (ngDevMode && !(value.hasOwnProperty("tView") || value.hasOwnProperty("currentCaseLViewIndex"))) {
throwError2("We expect to get 'null'|'TIcu'|'TIcuContainer', but got: " + value);
}
const tIcu = value.hasOwnProperty("currentCaseLViewIndex") ? value : value.value;
ngDevMode && assertTIcu(tIcu);
return tIcu;
}
function setTIcu(tView, index, tIcu) {
const tNode = tView.data[index];
ngDevMode && assertEqual(tNode === null || tNode.hasOwnProperty("tView"), true, "We expect to get 'null'|'TIcuContainer'");
if (tNode === null) {
tView.data[index] = tIcu;
} else {
ngDevMode && assertTNodeType(
tNode,
32
/* TNodeType.Icu */
);
tNode.value = tIcu;
}
}
function setTNodeInsertBeforeIndex(tNode, index) {
ngDevMode && assertTNode(tNode);
let insertBeforeIndex = tNode.insertBeforeIndex;
if (insertBeforeIndex === null) {
setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);
insertBeforeIndex = tNode.insertBeforeIndex = [
null,
index
];
} else {
assertEqual(Array.isArray(insertBeforeIndex), true, "Expecting array here");
insertBeforeIndex.push(index);
}
}
function createTNodePlaceholder(tView, previousTNodes, index) {
const tNode = createTNodeAtIndex(tView, index, 64, null, null);
addTNodeAndUpdateInsertBeforeIndex(previousTNodes, tNode);
return tNode;
}
function getCurrentICUCaseIndex(tIcu, lView) {
const currentCase = lView[tIcu.currentCaseLViewIndex];
return currentCase === null ? currentCase : currentCase < 0 ? ~currentCase : currentCase;
}
function getParentFromIcuCreateOpCode(mergedCode) {
return mergedCode >>> 17;
}
function getRefFromIcuCreateOpCode(mergedCode) {
return (mergedCode & 131070) >>> 1;
}
function getInstructionFromIcuCreateOpCode(mergedCode) {
return mergedCode & 1;
}
function icuCreateOpCode(opCode, parentIdx, refIdx) {
ngDevMode && assertGreaterThanOrEqual(parentIdx, 0, "Missing parent index");
ngDevMode && assertGreaterThan(refIdx, 0, "Missing ref index");
return opCode | parentIdx << 17 | refIdx << 1;
}
function isRootTemplateMessage(subTemplateIndex) {
return subTemplateIndex === -1;
}
function enterIcu(state, tIcu, lView) {
state.index = 0;
const currentCase = getCurrentICUCaseIndex(tIcu, lView);
if (currentCase !== null) {
ngDevMode && assertNumberInRange(currentCase, 0, tIcu.cases.length - 1);
state.removes = tIcu.remove[currentCase];
} else {
state.removes = EMPTY_ARRAY;
}
}
function icuContainerIteratorNext(state) {
if (state.index < state.removes.length) {
const removeOpCode = state.removes[state.index++];
ngDevMode && assertNumber(removeOpCode, "Expecting OpCode number");
if (removeOpCode > 0) {
const rNode = state.lView[removeOpCode];
ngDevMode && assertDomNode(rNode);
return rNode;
} else {
state.stack.push(state.index, state.removes);
const tIcuIndex = ~removeOpCode;
const tIcu = state.lView[TVIEW].data[tIcuIndex];
ngDevMode && assertTIcu(tIcu);
enterIcu(state, tIcu, state.lView);
return icuContainerIteratorNext(state);
}
} else {
if (state.stack.length === 0) {
return null;
} else {
state.removes = state.stack.pop();
state.index = state.stack.pop();
return icuContainerIteratorNext(state);
}
}
}
function loadIcuContainerVisitor() {
const _state = {
stack: [],
index: -1
};
function icuContainerIteratorStart(tIcuContainerNode, lView) {
_state.lView = lView;
while (_state.stack.length)
_state.stack.pop();
ngDevMode && assertTNodeForLView(tIcuContainerNode, lView);
enterIcu(_state, tIcuContainerNode.value, lView);
return icuContainerIteratorNext.bind(null, _state);
}
return icuContainerIteratorStart;
}
var REF_EXTRACTOR_REGEXP = /* @__PURE__ */ new RegExp(`^(\\d+)*(${REFERENCE_NODE_BODY}|${REFERENCE_NODE_HOST})*(.*)`);
var _prepareI18nBlockForHydrationImpl = () => {
};
function prepareI18nBlockForHydration(lView, index, parentTNode, subTemplateIndex) {
_prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex);
}
var _claimDehydratedIcuCaseImpl = () => {
};
function claimDehydratedIcuCase(lView, icuIndex, caseIndex) {
_claimDehydratedIcuCaseImpl(lView, icuIndex, caseIndex);
}
function cleanupI18nHydrationData(lView) {
const hydrationInfo = lView[HYDRATION];
if (hydrationInfo) {
const { i18nNodes, dehydratedIcuData: dehydratedIcuDataMap } = hydrationInfo;
if (i18nNodes && dehydratedIcuDataMap) {
const renderer = lView[RENDERER];
for (const dehydratedIcuData of dehydratedIcuDataMap.values()) {
cleanupDehydratedIcuData(renderer, i18nNodes, dehydratedIcuData);
}
}
hydrationInfo.i18nNodes = void 0;
hydrationInfo.dehydratedIcuData = void 0;
}
}
function cleanupDehydratedIcuData(renderer, i18nNodes, dehydratedIcuData) {
for (const node of dehydratedIcuData.node.cases[dehydratedIcuData.case]) {
const rNode = i18nNodes.get(node.index - HEADER_OFFSET);
if (rNode) {
nativeRemoveNode(renderer, rNode, false);
}
}
}
function removeDehydratedViews(lContainer) {
const views = lContainer[DEHYDRATED_VIEWS] ?? [];
const parentLView = lContainer[PARENT];
const renderer = parentLView[RENDERER];
const retainedViews = [];
for (const view of views) {
if (view.data[DEFER_BLOCK_ID] !== void 0) {
retainedViews.push(view);
} else {
removeDehydratedView(view, renderer);
ngDevMode && ngDevMode.dehydratedViewsRemoved++;
}
}
lContainer[DEHYDRATED_VIEWS] = retainedViews;
}
function removeDehydratedViewList(deferBlock) {
const { lContainer } = deferBlock;
const dehydratedViews = lContainer[DEHYDRATED_VIEWS];
if (dehydratedViews === null)
return;
const parentLView = lContainer[PARENT];
const renderer = parentLView[RENDERER];
for (const view of dehydratedViews) {
removeDehydratedView(view, renderer);
ngDevMode && ngDevMode.dehydratedViewsRemoved++;
}
}
function removeDehydratedView(dehydratedView, renderer) {
let nodesRemoved = 0;
let currentRNode = dehydratedView.firstChild;
if (currentRNode) {
const numNodes = dehydratedView.data[NUM_ROOT_NODES];
while (nodesRemoved < numNodes) {
ngDevMode && validateSiblingNodeExists(currentRNode);
const nextSibling = currentRNode.nextSibling;
nativeRemoveNode(renderer, currentRNode, false);
currentRNode = nextSibling;
nodesRemoved++;
}
}
}
function cleanupLContainer(lContainer) {
removeDehydratedViews(lContainer);
const hostLView = lContainer[HOST];
if (isLView(hostLView)) {
cleanupLView(hostLView);
}
for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
cleanupLView(lContainer[i]);
}
}
function cleanupLView(lView) {
cleanupI18nHydrationData(lView);
const tView = lView[TVIEW];
for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {
if (isLContainer(lView[i])) {
const lContainer = lView[i];
cleanupLContainer(lContainer);
} else if (isLView(lView[i])) {
cleanupLView(lView[i]);
}
}
}
function cleanupDehydratedViews(appRef) {
const viewRefs = appRef._views;
for (const viewRef of viewRefs) {
const lNode = getLNodeForHydration(viewRef);
if (lNode !== null && lNode[HOST] !== null) {
if (isLView(lNode)) {
cleanupLView(lNode);
} else {
cleanupLContainer(lNode);
}
ngDevMode && ngDevMode.dehydratedViewsCleanupRuns++;
}
}
}
function cleanupHydratedDeferBlocks(deferBlock, hydratedBlocks, registry2, appRef) {
if (deferBlock !== null) {
registry2.cleanup(hydratedBlocks);
cleanupLContainer(deferBlock.lContainer);
cleanupDehydratedViews(appRef);
}
}
var _findMatchingDehydratedViewImpl = () => null;
var _findAndReconcileMatchingDehydratedViewsImpl = () => null;
function findMatchingDehydratedView(lContainer, template) {
return _findMatchingDehydratedViewImpl(lContainer, template);
}
function findAndReconcileMatchingDehydratedViews(lContainer, templateTNode, hostLView) {
return _findAndReconcileMatchingDehydratedViewsImpl(lContainer, templateTNode, hostLView);
}
var ComponentRef$1 = class ComponentRef {
};
var ComponentFactory$1 = class ComponentFactory {
};
var _NullComponentFactoryResolver = class {
resolveComponentFactory(component) {
throw new RuntimeError(917, typeof ngDevMode !== "undefined" && ngDevMode && `No component factory found for ${stringify(component)}.`);
}
};
var ComponentFactoryResolver$1 = class ComponentFactoryResolver {
static NULL = new _NullComponentFactoryResolver();
};
var RendererFactory2 = class {
};
var Renderer2 = class {
/**
* If null or undefined, the view engine won't call it.
* This is used as a performance optimization for production mode.
*/
destroyNode = null;
/**
* @internal
* @nocollapse
*/
static __NG_ELEMENT_ID__ = () => injectRenderer2();
};
function injectRenderer2() {
const lView = getLView();
const tNode = getCurrentTNode();
const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);
return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];
}
var Sanitizer = class _Sanitizer {
/** @nocollapse */
static \u0275prov = (
/** @pureOrBreakMyCode */
/* @__PURE__ */ \u0275\u0275defineInjectable({
token: _Sanitizer,
providedIn: "root",
factory: () => null
})
);
};
function isModuleWithProviders(value) {
return value.ngModule !== void 0;
}
function isNgModule(value) {
return !!getNgModuleDef(value);
}
function isPipe(value) {
return !!getPipeDef(value);
}
function isDirective(value) {
return !!getDirectiveDef(value);
}
function isComponent(value) {
return !!getComponentDef(value);
}
function getDependencyTypeForError(type) {
if (getComponentDef(type))
return "component";
if (getDirectiveDef(type))
return "directive";
if (getPipeDef(type))
return "pipe";
return "type";
}
function verifyStandaloneImport(depType, importingType) {
if (isForwardRef(depType)) {
depType = resolveForwardRef(depType);
if (!depType) {
throw new Error(`Expected forwardRef function, imported from "${stringifyForError(importingType)}", to return a standalone entity or NgModule but got "${stringifyForError(depType) || depType}".`);
}
}
if (getNgModuleDef(depType) == null) {
const def = getComponentDef(depType) || getDirectiveDef(depType) || getPipeDef(depType);
if (def != null) {
if (!def.standalone) {
throw new Error(`The "${stringifyForError(depType)}" ${getDependencyTypeForError(depType)}, imported from "${stringifyForError(importingType)}", is not standalone. Did you forget to add the standalone: true flag?`);
}
} else {
if (isModuleWithProviders(depType)) {
throw new Error(`A module with providers was imported from "${stringifyForError(importingType)}". Modules with providers are not supported in standalone components imports.`);
} else {
throw new Error(`The "${stringifyForError(depType)}" type, imported from "${stringifyForError(importingType)}", must be a standalone component / directive / pipe or an NgModule. Did you forget to add the required @Component / @Directive / @Pipe or @NgModule annotation?`);
}
}
}
}
var DepsTracker = class {
ownerNgModule = /* @__PURE__ */ new Map();
ngModulesWithSomeUnresolvedDecls = /* @__PURE__ */ new Set();
ngModulesScopeCache = /* @__PURE__ */ new Map();
standaloneComponentsScopeCache = /* @__PURE__ */ new Map();
/**
* Attempts to resolve ng module's forward ref declarations as much as possible and add them to
* the `ownerNgModule` map. This method normally should be called after the initial parsing when
* all the forward refs are resolved (e.g., when trying to render a component)
*/
resolveNgModulesDecls() {
if (this.ngModulesWithSomeUnresolvedDecls.size === 0) {
return;
}
for (const moduleType of this.ngModulesWithSomeUnresolvedDecls) {
const def = getNgModuleDef(moduleType);
if (def?.declarations) {
for (const decl of maybeUnwrapFn(def.declarations)) {
if (isComponent(decl)) {
this.ownerNgModule.set(decl, moduleType);
}
}
}
}
this.ngModulesWithSomeUnresolvedDecls.clear();
}
/** @override */
getComponentDependencies(type, rawImports) {
this.resolveNgModulesDecls();
const def = getComponentDef(type);
if (def === null) {
throw new Error(`Attempting to get component dependencies for a type that is not a component: ${type}`);
}
if (def.standalone) {
const scope = this.getStandaloneComponentScope(type, rawImports);
if (scope.compilation.isPoisoned) {
return { dependencies: [] };
}
return {
dependencies: [
...scope.compilation.directives,
...scope.compilation.pipes,
...scope.compilation.ngModules
]
};
} else {
if (!this.ownerNgModule.has(type)) {
return { dependencies: [] };
}
const scope = this.getNgModuleScope(this.ownerNgModule.get(type));
if (scope.compilation.isPoisoned) {
return { dependencies: [] };
}
return {
dependencies: [...scope.compilation.directives, ...scope.compilation.pipes]
};
}
}
/**
* @override
* This implementation does not make use of param scopeInfo since it assumes the scope info is
* already added to the type itself through methods like {@link ɵɵsetNgModuleScope}
*/
registerNgModule(type, scopeInfo) {
if (!isNgModule(type)) {
throw new Error(`Attempting to register a Type which is not NgModule as NgModule: ${type}`);
}
this.ngModulesWithSomeUnresolvedDecls.add(type);
}
/** @override */
clearScopeCacheFor(type) {
this.ngModulesScopeCache.delete(type);
this.standaloneComponentsScopeCache.delete(type);
}
/** @override */
getNgModuleScope(type) {
if (this.ngModulesScopeCache.has(type)) {
return this.ngModulesScopeCache.get(type);
}
const scope = this.computeNgModuleScope(type);
this.ngModulesScopeCache.set(type, scope);
return scope;
}
/** Compute NgModule scope afresh. */
computeNgModuleScope(type) {
const def = getNgModuleDefOrThrow(type);
const scope = {
exported: { directives: /* @__PURE__ */ new Set(), pipes: /* @__PURE__ */ new Set() },
compilation: { directives: /* @__PURE__ */ new Set(), pipes: /* @__PURE__ */ new Set() }
};
for (const imported of maybeUnwrapFn(def.imports)) {
if (isNgModule(imported)) {
const importedScope = this.getNgModuleScope(imported);
addSet(importedScope.exported.directives, scope.compilation.directives);
addSet(importedScope.exported.pipes, scope.compilation.pipes);
} else if (isStandalone(imported)) {
if (isDirective(imported) || isComponent(imported)) {
scope.compilation.directives.add(imported);
} else if (isPipe(imported)) {
scope.compilation.pipes.add(imported);
} else {
throw new RuntimeError(980, "The standalone imported type is neither a component nor a directive nor a pipe");
}
} else {
scope.compilation.isPoisoned = true;
break;
}
}
if (!scope.compilation.isPoisoned) {
for (const decl of maybeUnwrapFn(def.declarations)) {
if (isNgModule(decl) || isStandalone(decl)) {
scope.compilation.isPoisoned = true;
break;
}
if (isPipe(decl)) {
scope.compilation.pipes.add(decl);
} else {
scope.compilation.directives.add(decl);
}
}
}
for (const exported of maybeUnwrapFn(def.exports)) {
if (isNgModule(exported)) {
const exportedScope = this.getNgModuleScope(exported);
addSet(exportedScope.exported.directives, scope.exported.directives);
addSet(exportedScope.exported.pipes, scope.exported.pipes);
addSet(exportedScope.exported.directives, scope.compilation.directives);
addSet(exportedScope.exported.pipes, scope.compilation.pipes);
} else if (isPipe(exported)) {
scope.exported.pipes.add(exported);
} else {
scope.exported.directives.add(exported);
}
}
return scope;
}
/** @override */
getStandaloneComponentScope(type, rawImports) {
if (this.standaloneComponentsScopeCache.has(type)) {
return this.standaloneComponentsScopeCache.get(type);
}
const ans = this.computeStandaloneComponentScope(type, rawImports);
this.standaloneComponentsScopeCache.set(type, ans);
return ans;
}
computeStandaloneComponentScope(type, rawImports) {
const ans = {
compilation: {
// Standalone components are always able to self-reference.
directives: /* @__PURE__ */ new Set([type]),
pipes: /* @__PURE__ */ new Set(),
ngModules: /* @__PURE__ */ new Set()
}
};
for (const rawImport of flatten(rawImports ?? [])) {
const imported = resolveForwardRef(rawImport);
try {
verifyStandaloneImport(imported, type);
} catch (e) {
ans.compilation.isPoisoned = true;
return ans;
}
if (isNgModule(imported)) {
ans.compilation.ngModules.add(imported);
const importedScope = this.getNgModuleScope(imported);
if (importedScope.exported.isPoisoned) {
ans.compilation.isPoisoned = true;
return ans;
}
addSet(importedScope.exported.directives, ans.compilation.directives);
addSet(importedScope.exported.pipes, ans.compilation.pipes);
} else if (isPipe(imported)) {
ans.compilation.pipes.add(imported);
} else if (isDirective(imported) || isComponent(imported)) {
ans.compilation.directives.add(imported);
} else {
ans.compilation.isPoisoned = true;
return ans;
}
}
return ans;
}
/** @override */
isOrphanComponent(cmp) {
const def = getComponentDef(cmp);
if (!def || def.standalone) {
return false;
}
this.resolveNgModulesDecls();
return !this.ownerNgModule.has(cmp);
}
};
function addSet(sourceSet, targetSet) {
for (const m of sourceSet) {
targetSet.add(m);
}
}
var depsTracker = new DepsTracker();
var NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};
var ChainedInjector = class {
injector;
parentInjector;
constructor(injector, parentInjector) {
this.injector = injector;
this.parentInjector = parentInjector;
}
get(token, notFoundValue, options) {
const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, options);
if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR || notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
return value;
}
return this.parentInjector.get(token, notFoundValue, options);
}
};
function computeStaticStyling(tNode, attrs, writeToHost) {
ngDevMode && assertFirstCreatePass(getTView(), "Expecting to be called in first template pass only");
let styles = writeToHost ? tNode.styles : null;
let classes = writeToHost ? tNode.classes : null;
let mode = 0;
if (attrs !== null) {
for (let i = 0; i < attrs.length; i++) {
const value = attrs[i];
if (typeof value === "number") {
mode = value;
} else if (mode == 1) {
classes = concatStringsWithSpace(classes, value);
} else if (mode == 2) {
const style = value;
const styleValue = attrs[++i];
styles = concatStringsWithSpace(styles, style + ": " + styleValue + ";");
}
}
}
writeToHost ? tNode.styles = styles : tNode.stylesWithoutHost = styles;
writeToHost ? tNode.classes = classes : tNode.classesWithoutHost = classes;
}
function \u0275\u0275directiveInject(token, flags = 0) {
const lView = getLView();
if (lView === null) {
ngDevMode && assertInjectImplementationNotEqual(\u0275\u0275directiveInject);
return \u0275\u0275inject(token, flags);
}
const tNode = getCurrentTNode();
const value = getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);
ngDevMode && emitInjectEvent(token, value, flags);
return value;
}
function \u0275\u0275invalidFactory() {
const msg = ngDevMode ? `This constructor was not compatible with Dependency Injection.` : "invalid";
throw new Error(msg);
}
function resolveDirectives(tView, lView, tNode, localRefs, directiveMatcher) {
ngDevMode && assertFirstCreatePass(tView);
const exportsMap = localRefs === null ? null : { "": -1 };
const matchedDirectiveDefs = directiveMatcher(tView, tNode);
if (matchedDirectiveDefs !== null) {
let directiveDefs = matchedDirectiveDefs;
let hostDirectiveDefs = null;
let hostDirectiveRanges = null;
for (const def of matchedDirectiveDefs) {
if (def.resolveHostDirectives !== null) {
[directiveDefs, hostDirectiveDefs, hostDirectiveRanges] = def.resolveHostDirectives(matchedDirectiveDefs);
break;
}
}
ngDevMode && assertNoDuplicateDirectives(directiveDefs);
initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs, hostDirectiveRanges);
}
if (exportsMap !== null && localRefs !== null) {
cacheMatchingLocalNames(tNode, localRefs, exportsMap);
}
}
function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
const localNames = tNode.localNames = [];
for (let i = 0; i < localRefs.length; i += 2) {
const index = exportsMap[localRefs[i + 1]];
if (index == null)
throw new RuntimeError(-301, ngDevMode && `Export of name '${localRefs[i + 1]}' not found!`);
localNames.push(localRefs[i], index);
}
}
function markAsComponentHost(tView, hostTNode, componentOffset) {
ngDevMode && assertFirstCreatePass(tView);
ngDevMode && assertGreaterThan(componentOffset, -1, "componentOffset must be great than -1");
hostTNode.componentOffset = componentOffset;
(tView.components ??= []).push(hostTNode.index);
}
function initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs, hostDirectiveRanges) {
ngDevMode && assertFirstCreatePass(tView);
const directivesLength = directives.length;
let hasSeenComponent = false;
for (let i = 0; i < directivesLength; i++) {
const def = directives[i];
if (!hasSeenComponent && isComponentDef(def)) {
hasSeenComponent = true;
markAsComponentHost(tView, tNode, i);
}
diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, def.type);
}
initTNodeFlags(tNode, tView.data.length, directivesLength);
for (let i = 0; i < directivesLength; i++) {
const def = directives[i];
if (def.providersResolver)
def.providersResolver(def);
}
let preOrderHooksFound = false;
let preOrderCheckHooksFound = false;
let directiveIdx = allocExpando(tView, lView, directivesLength, null);
ngDevMode && assertSame(directiveIdx, tNode.directiveStart, "TNode.directiveStart should point to just allocated space");
if (directivesLength > 0) {
tNode.directiveToIndex = /* @__PURE__ */ new Map();
}
for (let i = 0; i < directivesLength; i++) {
const def = directives[i];
tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);
configureViewWithDirective(tView, tNode, lView, directiveIdx, def);
saveNameToExportMap(directiveIdx, def, exportsMap);
if (hostDirectiveRanges !== null && hostDirectiveRanges.has(def)) {
const [start, end] = hostDirectiveRanges.get(def);
tNode.directiveToIndex.set(def.type, [
directiveIdx,
start + tNode.directiveStart,
end + tNode.directiveStart
]);
} else if (hostDirectiveDefs === null || !hostDirectiveDefs.has(def)) {
tNode.directiveToIndex.set(def.type, directiveIdx);
}
if (def.contentQueries !== null)
tNode.flags |= 4;
if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0)
tNode.flags |= 64;
const lifeCycleHooks = def.type.prototype;
if (!preOrderHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) {
(tView.preOrderHooks ??= []).push(tNode.index);
preOrderHooksFound = true;
}
if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {
(tView.preOrderCheckHooks ??= []).push(tNode.index);
preOrderCheckHooksFound = true;
}
directiveIdx++;
}
initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs);
}
function initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs) {
ngDevMode && assertFirstCreatePass(tView);
for (let index = tNode.directiveStart; index < tNode.directiveEnd; index++) {
const directiveDef = tView.data[index];
if (hostDirectiveDefs === null || !hostDirectiveDefs.has(directiveDef)) {
setupSelectorMatchedInputsOrOutputs(0, tNode, directiveDef, index);
setupSelectorMatchedInputsOrOutputs(1, tNode, directiveDef, index);
setupInitialInputs(tNode, index, false);
} else {
const hostDirectiveDef = hostDirectiveDefs.get(directiveDef);
setupHostDirectiveInputsOrOutputs(0, tNode, hostDirectiveDef, index);
setupHostDirectiveInputsOrOutputs(1, tNode, hostDirectiveDef, index);
setupInitialInputs(tNode, index, true);
}
}
}
function setupSelectorMatchedInputsOrOutputs(mode, tNode, def, directiveIndex) {
const aliasMap = mode === 0 ? def.inputs : def.outputs;
for (const publicName in aliasMap) {
if (aliasMap.hasOwnProperty(publicName)) {
let bindings;
if (mode === 0) {
bindings = tNode.inputs ??= {};
} else {
bindings = tNode.outputs ??= {};
}
bindings[publicName] ??= [];
bindings[publicName].push(directiveIndex);
setShadowStylingInputFlags(tNode, publicName);
}
}
}
function setupHostDirectiveInputsOrOutputs(mode, tNode, config2, directiveIndex) {
const aliasMap = mode === 0 ? config2.inputs : config2.outputs;
for (const initialName in aliasMap) {
if (aliasMap.hasOwnProperty(initialName)) {
const publicName = aliasMap[initialName];
let bindings;
if (mode === 0) {
bindings = tNode.hostDirectiveInputs ??= {};
} else {
bindings = tNode.hostDirectiveOutputs ??= {};
}
bindings[publicName] ??= [];
bindings[publicName].push(directiveIndex, initialName);
setShadowStylingInputFlags(tNode, publicName);
}
}
}
function setShadowStylingInputFlags(tNode, publicName) {
if (publicName === "class") {
tNode.flags |= 8;
} else if (publicName === "style") {
tNode.flags |= 16;
}
}
function setupInitialInputs(tNode, directiveIndex, isHostDirective) {
const { attrs, inputs, hostDirectiveInputs } = tNode;
if (attrs === null || !isHostDirective && inputs === null || isHostDirective && hostDirectiveInputs === null || // Do not use unbound attributes as inputs to structural directives, since structural
// directive inputs can only be set using microsyntax (e.g. `<div *dir="exp">`).
isInlineTemplate(tNode)) {
tNode.initialInputs ??= [];
tNode.initialInputs.push(null);
return;
}
let inputsToStore = null;
let i = 0;
while (i < attrs.length) {
const attrName = attrs[i];
if (attrName === 0) {
i += 4;
continue;
} else if (attrName === 5) {
i += 2;
continue;
} else if (typeof attrName === "number") {
break;
}
if (!isHostDirective && inputs.hasOwnProperty(attrName)) {
const inputConfig = inputs[attrName];
for (const index of inputConfig) {
if (index === directiveIndex) {
inputsToStore ??= [];
inputsToStore.push(attrName, attrs[i + 1]);
break;
}
}
} else if (isHostDirective && hostDirectiveInputs.hasOwnProperty(attrName)) {
const config2 = hostDirectiveInputs[attrName];
for (let j = 0; j < config2.length; j += 2) {
if (config2[j] === directiveIndex) {
inputsToStore ??= [];
inputsToStore.push(config2[j + 1], attrs[i + 1]);
break;
}
}
}
i += 2;
}
tNode.initialInputs ??= [];
tNode.initialInputs.push(inputsToStore);
}
function configureViewWithDirective(tView, tNode, lView, directiveIndex, def) {
ngDevMode && assertGreaterThanOrEqual(directiveIndex, HEADER_OFFSET, "Must be in Expando section");
tView.data[directiveIndex] = def;
const directiveFactory = def.factory || (def.factory = getFactoryDef(def.type, true));
const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), \u0275\u0275directiveInject, ngDevMode ? def.type.name : null);
tView.blueprint[directiveIndex] = nodeInjectorFactory;
lView[directiveIndex] = nodeInjectorFactory;
registerHostBindingOpCodes(tView, tNode, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def);
}
function registerHostBindingOpCodes(tView, tNode, directiveIdx, directiveVarsIdx, def) {
ngDevMode && assertFirstCreatePass(tView);
const hostBindings = def.hostBindings;
if (hostBindings) {
let hostBindingOpCodes = tView.hostBindingOpCodes;
if (hostBindingOpCodes === null) {
hostBindingOpCodes = tView.hostBindingOpCodes = [];
}
const elementIndx = ~tNode.index;
if (lastSelectedElementIdx(hostBindingOpCodes) != elementIndx) {
hostBindingOpCodes.push(elementIndx);
}
hostBindingOpCodes.push(directiveIdx, directiveVarsIdx, hostBindings);
}
}
function lastSelectedElementIdx(hostBindingOpCodes) {
let i = hostBindingOpCodes.length;
while (i > 0) {
const value = hostBindingOpCodes[--i];
if (typeof value === "number" && value < 0) {
return value;
}
}
return 0;
}
function saveNameToExportMap(directiveIdx, def, exportsMap) {
if (exportsMap) {
if (def.exportAs) {
for (let i = 0; i < def.exportAs.length; i++) {
exportsMap[def.exportAs[i]] = directiveIdx;
}
}
if (isComponentDef(def))
exportsMap[""] = directiveIdx;
}
}
function initTNodeFlags(tNode, index, numberOfDirectives) {
ngDevMode && assertNotEqual(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, "Reached the max number of directives");
tNode.flags |= 1;
tNode.directiveStart = index;
tNode.directiveEnd = index + numberOfDirectives;
tNode.providerIndexes = index;
}
function assertNoDuplicateDirectives(directives) {
if (directives.length < 2) {
return;
}
const seenDirectives = /* @__PURE__ */ new Set();
for (const current of directives) {
if (seenDirectives.has(current)) {
throw new RuntimeError(309, `Directive ${current.type.name} matches multiple times on the same element. Directives can only match an element once.`);
}
seenDirectives.add(current);
}
}
function directiveHostFirstCreatePass(index, lView, type, name, directiveMatcher, bindingsEnabled, attrsIndex, localRefsIndex) {
const tView = lView[TVIEW];
ngDevMode && assertFirstCreatePass(tView);
const tViewConsts = tView.consts;
const attrs = getConstant(tViewConsts, attrsIndex);
const tNode = getOrCreateTNode(tView, index, type, name, attrs);
if (bindingsEnabled) {
resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex), directiveMatcher);
}
tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
if (tNode.attrs !== null) {
computeStaticStyling(tNode, tNode.attrs, false);
}
if (tNode.mergedAttrs !== null) {
computeStaticStyling(tNode, tNode.mergedAttrs, true);
}
if (tView.queries !== null) {
tView.queries.elementStart(tView, tNode);
}
return tNode;
}
function directiveHostEndFirstCreatePass(tView, tNode) {
ngDevMode && assertFirstCreatePass(tView);
registerPostOrderHooks(tView, tNode);
if (isContentQueryHost(tNode)) {
tView.queries.elementEnd(tNode);
}
}
function domOnlyFirstCreatePass(index, tView, type, name, attrsIndex, localRefsIndex) {
ngDevMode && assertFirstCreatePass(tView);
const tViewConsts = tView.consts;
const attrs = getConstant(tViewConsts, attrsIndex);
const tNode = getOrCreateTNode(tView, index, type, name, attrs);
tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
if (localRefsIndex != null) {
const refs = getConstant(tViewConsts, localRefsIndex);
tNode.localNames = [];
for (let i = 0; i < refs.length; i += 2) {
tNode.localNames.push(refs[i], -1);
}
}
if (tNode.attrs !== null) {
computeStaticStyling(tNode, tNode.attrs, false);
}
if (tNode.mergedAttrs !== null) {
computeStaticStyling(tNode, tNode.mergedAttrs, true);
}
if (tView.queries !== null) {
tView.queries.elementStart(tView, tNode);
}
return tNode;
}
function isListLikeIterable(obj) {
if (!isJsObject(obj))
return false;
return Array.isArray(obj) || !(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
Symbol.iterator in obj;
}
function areIterablesEqual(a, b, comparator) {
const iterator1 = a[Symbol.iterator]();
const iterator2 = b[Symbol.iterator]();
while (true) {
const item1 = iterator1.next();
const item2 = iterator2.next();
if (item1.done && item2.done)
return true;
if (item1.done || item2.done)
return false;
if (!comparator(item1.value, item2.value))
return false;
}
}
function iterateListLike(obj, fn) {
if (Array.isArray(obj)) {
for (let i = 0; i < obj.length; i++) {
fn(obj[i]);
}
} else {
const iterator2 = obj[Symbol.iterator]();
let item;
while (!(item = iterator2.next()).done) {
fn(item.value);
}
}
}
function isJsObject(o) {
return o !== null && (typeof o === "function" || typeof o === "object");
}
function devModeEqual(a, b) {
const isListLikeIterableA = isListLikeIterable(a);
const isListLikeIterableB = isListLikeIterable(b);
if (isListLikeIterableA && isListLikeIterableB) {
return areIterablesEqual(a, b, devModeEqual);
} else {
const isAObject = a && (typeof a === "object" || typeof a === "function");
const isBObject = b && (typeof b === "object" || typeof b === "function");
if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
return true;
} else {
return Object.is(a, b);
}
}
}
function updateBinding(lView, bindingIndex, value) {
return lView[bindingIndex] = value;
}
function getBinding(lView, bindingIndex) {
ngDevMode && assertIndexInRange(lView, bindingIndex);
ngDevMode && assertNotSame(lView[bindingIndex], NO_CHANGE, "Stored value should never be NO_CHANGE.");
return lView[bindingIndex];
}
function bindingUpdated(lView, bindingIndex, value) {
ngDevMode && assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
if (value === NO_CHANGE) {
return false;
}
const oldValue = lView[bindingIndex];
if (Object.is(oldValue, value)) {
return false;
} else {
if (ngDevMode && isInCheckNoChangesMode()) {
const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : void 0;
if (!devModeEqual(oldValueToCompare, value)) {
const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName, lView);
}
return false;
}
lView[bindingIndex] = value;
return true;
}
}
function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
const different = bindingUpdated(lView, bindingIndex, exp1);
return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
}
function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
}
function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
}
function wrapListener(tNode, lView, listenerFn) {
return function wrapListenerIn_markDirtyAndPreventDefault(event) {
const startView = isComponentHost(tNode) ? getComponentLViewByIndex(tNode.index, lView) : lView;
markViewDirty(
startView,
5
/* NotificationSource.Listener */
);
const context2 = lView[CONTEXT];
let result = executeListenerWithErrorHandling(lView, context2, listenerFn, event);
let nextListenerFn = wrapListenerIn_markDirtyAndPreventDefault.__ngNextListenerFn__;
while (nextListenerFn) {
result = executeListenerWithErrorHandling(lView, context2, nextListenerFn, event) && result;
nextListenerFn = nextListenerFn.__ngNextListenerFn__;
}
return result;
};
}
function executeListenerWithErrorHandling(lView, context2, listenerFn, e) {
const prevConsumer = setActiveConsumer(null);
try {
profiler(6, context2, listenerFn);
return listenerFn(e) !== false;
} catch (error) {
handleUncaughtError(lView, error);
return false;
} finally {
profiler(7, context2, listenerFn);
setActiveConsumer(prevConsumer);
}
}
function listenToDomEvent(tNode, tView, lView, eventTargetResolver, renderer, eventName, originalListener, wrappedListener) {
ngDevMode && assertNotSame(wrappedListener, originalListener, "Expected wrapped and original listeners to be different.");
const isTNodeDirectiveHost = isDirectiveHost(tNode);
let hasCoalesced = false;
let existingListener = null;
if (!eventTargetResolver && isTNodeDirectiveHost) {
existingListener = findExistingListener(tView, lView, eventName, tNode.index);
}
if (existingListener !== null) {
const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
lastListenerFn.__ngNextListenerFn__ = originalListener;
existingListener.__ngLastListenerFn__ = originalListener;
hasCoalesced = true;
} else {
const native = getNativeByTNode(tNode, lView);
const target = eventTargetResolver ? eventTargetResolver(native) : native;
stashEventListenerImpl(lView, target, eventName, wrappedListener);
const cleanupFn = renderer.listen(target, eventName, wrappedListener);
const idxOrTargetGetter = eventTargetResolver ? (_lView) => eventTargetResolver(unwrapRNode(_lView[tNode.index])) : tNode.index;
storeListenerCleanup(idxOrTargetGetter, tView, lView, eventName, wrappedListener, cleanupFn, false);
}
return hasCoalesced;
}
function findExistingListener(tView, lView, eventName, tNodeIndex) {
const tCleanup = tView.cleanup;
if (tCleanup != null) {
for (let i = 0; i < tCleanup.length - 1; i += 2) {
const cleanupEventName = tCleanup[i];
if (cleanupEventName === eventName && tCleanup[i + 1] === tNodeIndex) {
const lCleanup = lView[CLEANUP];
const listenerIdxInLCleanup = tCleanup[i + 2];
return lCleanup && lCleanup.length > listenerIdxInLCleanup ? lCleanup[listenerIdxInLCleanup] : null;
}
if (typeof cleanupEventName === "string") {
i += 2;
}
}
}
return null;
}
function storeListenerCleanup(indexOrTargetGetter, tView, lView, eventName, listenerFn, cleanup, isOutput) {
const tCleanup = tView.firstCreatePass ? getOrCreateTViewCleanup(tView) : null;
const lCleanup = getOrCreateLViewCleanup(lView);
const index = lCleanup.length;
lCleanup.push(listenerFn, cleanup);
tCleanup && tCleanup.push(eventName, indexOrTargetGetter, index, (index + 1) * (isOutput ? -1 : 1));
}
function listenToOutput(tNode, lView, directiveIndex, lookupName, eventName, listenerFn) {
ngDevMode && assertIndexInRange(lView, directiveIndex);
const instance = lView[directiveIndex];
const tView = lView[TVIEW];
const def = tView.data[directiveIndex];
const propertyName = def.outputs[lookupName];
const output = instance[propertyName];
if (ngDevMode && !isOutputSubscribable(output)) {
throw new Error(`@Output ${propertyName} not initialized in '${instance.constructor.name}'.`);
}
const subscription = output.subscribe(listenerFn);
storeListenerCleanup(tNode.index, tView, lView, eventName, listenerFn, subscription, true);
}
function isOutputSubscribable(value) {
return value != null && typeof value.subscribe === "function";
}
var BINDING = /* @__PURE__ */ Symbol("BINDING");
var ComponentFactoryResolver2 = class extends ComponentFactoryResolver$1 {
ngModule;
/**
* @param ngModule The NgModuleRef to which all resolved factories are bound.
*/
constructor(ngModule) {
super();
this.ngModule = ngModule;
}
resolveComponentFactory(component) {
ngDevMode && assertComponentType(component);
const componentDef = getComponentDef(component);
return new ComponentFactory2(componentDef, this.ngModule);
}
};
function toInputRefArray(map2) {
return Object.keys(map2).map((name) => {
const [propName, flags, transform] = map2[name];
const inputData = {
propName,
templateName: name,
isSignal: (flags & InputFlags.SignalBased) !== 0
};
if (transform) {
inputData.transform = transform;
}
return inputData;
});
}
function toOutputRefArray(map2) {
return Object.keys(map2).map((name) => ({ propName: map2[name], templateName: name }));
}
function verifyNotAnOrphanComponent(componentDef) {
if (false) {
if (depsTracker.isOrphanComponent(componentDef.type)) {
throw new RuntimeError(981, `Orphan component found! Trying to render the component ${debugStringifyTypeForError(componentDef.type)} without first loading the NgModule that declares it. It is recommended to make this component standalone in order to avoid this error. If this is not possible now, import the component's NgModule in the appropriate NgModule, or the standalone component in which you are trying to render this component. If this is a lazy import, load the NgModule lazily as well and use its module injector.`);
}
}
}
function createRootViewInjector(componentDef, environmentInjector, injector) {
let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ? environmentInjector : environmentInjector?.injector;
if (realEnvironmentInjector && componentDef.getStandaloneInjector !== null) {
realEnvironmentInjector = componentDef.getStandaloneInjector(realEnvironmentInjector) || realEnvironmentInjector;
}
const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;
return rootViewInjector;
}
function createRootLViewEnvironment(rootLViewInjector) {
const rendererFactory = rootLViewInjector.get(RendererFactory2, null);
if (rendererFactory === null) {
throw new RuntimeError(407, ngDevMode && "Angular was not able to inject a renderer (RendererFactory2). Likely this is due to a broken DI hierarchy. Make sure that any injector used to create this component has a correct parent.");
}
const sanitizer = rootLViewInjector.get(Sanitizer, null);
const changeDetectionScheduler = rootLViewInjector.get(ChangeDetectionScheduler, null);
let ngReflect = false;
if (typeof ngDevMode === "undefined" || ngDevMode) {
ngReflect = rootLViewInjector.get(NG_REFLECT_ATTRS_FLAG, NG_REFLECT_ATTRS_FLAG_DEFAULT);
}
return {
rendererFactory,
sanitizer,
changeDetectionScheduler,
ngReflect
};
}
function createHostElement(componentDef, renderer) {
const tagName = inferTagNameFromDefinition(componentDef);
const namespace = tagName === "svg" ? SVG_NAMESPACE : tagName === "math" ? MATH_ML_NAMESPACE : null;
return createElementNode(renderer, tagName, namespace);
}
function inferTagNameFromDefinition(componentDef) {
return (componentDef.selectors[0][0] || "div").toLowerCase();
}
var ComponentFactory2 = class extends ComponentFactory$1 {
componentDef;
ngModule;
selector;
componentType;
ngContentSelectors;
isBoundToModule;
cachedInputs = null;
cachedOutputs = null;
get inputs() {
this.cachedInputs ??= toInputRefArray(this.componentDef.inputs);
return this.cachedInputs;
}
get outputs() {
this.cachedOutputs ??= toOutputRefArray(this.componentDef.outputs);
return this.cachedOutputs;
}
/**
* @param componentDef The component definition.
* @param ngModule The NgModuleRef to which the factory is bound.
*/
constructor(componentDef, ngModule) {
super();
this.componentDef = componentDef;
this.ngModule = ngModule;
this.componentType = componentDef.type;
this.selector = stringifyCSSSelectorList(componentDef.selectors);
this.ngContentSelectors = componentDef.ngContentSelectors ?? [];
this.isBoundToModule = !!ngModule;
}
create(injector, projectableNodes, rootSelectorOrNode, environmentInjector, directives, componentBindings) {
profiler(
22
/* ProfilerEvent.DynamicComponentStart */
);
const prevConsumer = setActiveConsumer(null);
try {
const cmpDef = this.componentDef;
ngDevMode && verifyNotAnOrphanComponent(cmpDef);
const rootTView = createRootTView(rootSelectorOrNode, cmpDef, componentBindings, directives);
const rootViewInjector = createRootViewInjector(cmpDef, environmentInjector || this.ngModule, injector);
const environment = createRootLViewEnvironment(rootViewInjector);
const hostRenderer = environment.rendererFactory.createRenderer(null, cmpDef);
const hostElement = rootSelectorOrNode ? locateHostElement(hostRenderer, rootSelectorOrNode, cmpDef.encapsulation, rootViewInjector) : createHostElement(cmpDef, hostRenderer);
const hasInputBindings = componentBindings?.some(isInputBinding) || directives?.some((d) => typeof d !== "function" && d.bindings.some(isInputBinding));
const rootLView = createLView(null, rootTView, null, 512 | getInitialLViewFlagsFromDef(cmpDef), null, null, environment, hostRenderer, rootViewInjector, null, retrieveHydrationInfo(
hostElement,
rootViewInjector,
true
/* isRootView */
));
rootLView[HEADER_OFFSET] = hostElement;
enterView(rootLView);
let componentView = null;
try {
const hostTNode = directiveHostFirstCreatePass(HEADER_OFFSET, rootLView, 2, "#host", () => rootTView.directiveRegistry, true, 0);
if (hostElement) {
setupStaticAttributes(hostRenderer, hostElement, hostTNode);
attachPatchData(hostElement, rootLView);
}
createDirectivesInstances(rootTView, rootLView, hostTNode);
executeContentQueries(rootTView, hostTNode, rootLView);
directiveHostEndFirstCreatePass(rootTView, hostTNode);
if (projectableNodes !== void 0) {
projectNodes(hostTNode, this.ngContentSelectors, projectableNodes);
}
componentView = getComponentLViewByIndex(hostTNode.index, rootLView);
rootLView[CONTEXT] = componentView[CONTEXT];
renderView(rootTView, rootLView, null);
} catch (e) {
if (componentView !== null) {
unregisterLView(componentView);
}
unregisterLView(rootLView);
throw e;
} finally {
profiler(
23
/* ProfilerEvent.DynamicComponentEnd */
);
leaveView();
}
return new ComponentRef2(this.componentType, rootLView, !!hasInputBindings);
} finally {
setActiveConsumer(prevConsumer);
}
}
};
function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
const tAttributes = rootSelectorOrNode ? ["ng-version", "20.2.1"] : (
// Extract attributes and classes from the first selector only to match VE behavior.
extractAttrsAndClassesFromSelector(componentDef.selectors[0])
);
let creationBindings = null;
let updateBindings = null;
let varsToAllocate = 0;
if (componentBindings) {
for (const binding of componentBindings) {
varsToAllocate += binding[BINDING].requiredVars;
if (binding.create) {
binding.targetIdx = 0;
(creationBindings ??= []).push(binding);
}
if (binding.update) {
binding.targetIdx = 0;
(updateBindings ??= []).push(binding);
}
}
}
if (directives) {
for (let i = 0; i < directives.length; i++) {
const directive = directives[i];
if (typeof directive !== "function") {
for (const binding of directive.bindings) {
varsToAllocate += binding[BINDING].requiredVars;
const targetDirectiveIdx = i + 1;
if (binding.create) {
binding.targetIdx = targetDirectiveIdx;
(creationBindings ??= []).push(binding);
}
if (binding.update) {
binding.targetIdx = targetDirectiveIdx;
(updateBindings ??= []).push(binding);
}
}
}
}
}
const directivesToApply = [componentDef];
if (directives) {
for (const directive of directives) {
const directiveType = typeof directive === "function" ? directive : directive.type;
const directiveDef = ngDevMode ? getDirectiveDefOrThrow(directiveType) : getDirectiveDef(directiveType);
if (ngDevMode && !directiveDef.standalone) {
throw new RuntimeError(907, `The ${stringifyForError(directiveType)} directive must be standalone in order to be applied to a dynamically-created component.`);
}
directivesToApply.push(directiveDef);
}
}
const rootTView = createTView(0, null, getRootTViewTemplate(creationBindings, updateBindings), 1, varsToAllocate, directivesToApply, null, null, null, [tAttributes], null);
return rootTView;
}
function getRootTViewTemplate(creationBindings, updateBindings) {
if (!creationBindings && !updateBindings) {
return null;
}
return (flags) => {
if (flags & 1 && creationBindings) {
for (const binding of creationBindings) {
binding.create();
}
}
if (flags & 2 && updateBindings) {
for (const binding of updateBindings) {
binding.update();
}
}
};
}
function isInputBinding(binding) {
const kind = binding[BINDING].kind;
return kind === "input" || kind === "twoWay";
}
var ComponentRef2 = class extends ComponentRef$1 {
_rootLView;
_hasInputBindings;
instance;
hostView;
changeDetectorRef;
componentType;
location;
previousInputValues = null;
_tNode;
constructor(componentType, _rootLView, _hasInputBindings) {
super();
this._rootLView = _rootLView;
this._hasInputBindings = _hasInputBindings;
this._tNode = getTNode(_rootLView[TVIEW], HEADER_OFFSET);
this.location = createElementRef(this._tNode, _rootLView);
this.instance = getComponentLViewByIndex(this._tNode.index, _rootLView)[CONTEXT];
this.hostView = this.changeDetectorRef = new ViewRef(
_rootLView,
void 0
/* _cdRefInjectingView */
);
this.componentType = componentType;
}
setInput(name, value) {
if (this._hasInputBindings && ngDevMode) {
throw new RuntimeError(317, "Cannot call `setInput` on a component that is using the `inputBinding` or `twoWayBinding` functions.");
}
const tNode = this._tNode;
this.previousInputValues ??= /* @__PURE__ */ new Map();
if (this.previousInputValues.has(name) && Object.is(this.previousInputValues.get(name), value)) {
return;
}
const lView = this._rootLView;
const hasSetInput = setAllInputsForProperty(tNode, lView[TVIEW], lView, name, value);
this.previousInputValues.set(name, value);
const childComponentLView = getComponentLViewByIndex(tNode.index, lView);
markViewDirty(
childComponentLView,
1
/* NotificationSource.SetInput */
);
if (ngDevMode && !hasSetInput) {
const cmpNameForError = stringifyForError(this.componentType);
let message = `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;
message += `Make sure that the '${name}' property is declared as an input using the input() or model() function or the @Input() decorator.`;
reportUnknownPropertyError(message);
}
}
get injector() {
return new NodeInjector(this._tNode, this._rootLView);
}
destroy() {
this.hostView.destroy();
}
onDestroy(callback) {
this.hostView.onDestroy(callback);
}
};
function projectNodes(tNode, ngContentSelectors, projectableNodes) {
const projection = tNode.projection = [];
for (let i = 0; i < ngContentSelectors.length; i++) {
const nodesforSlot = projectableNodes[i];
projection.push(nodesforSlot != null && nodesforSlot.length ? Array.from(nodesforSlot) : null);
}
}
var ViewContainerRef = class {
/**
* @internal
* @nocollapse
*/
static __NG_ELEMENT_ID__ = injectViewContainerRef;
};
function injectViewContainerRef() {
const previousTNode = getCurrentTNode();
return createContainerRef(previousTNode, getLView());
}
var VE_ViewContainerRef = ViewContainerRef;
var R3ViewContainerRef = class ViewContainerRef2 extends VE_ViewContainerRef {
_lContainer;
_hostTNode;
_hostLView;
constructor(_lContainer, _hostTNode, _hostLView) {
super();
this._lContainer = _lContainer;
this._hostTNode = _hostTNode;
this._hostLView = _hostLView;
}
get element() {
return createElementRef(this._hostTNode, this._hostLView);
}
get injector() {
return new NodeInjector(this._hostTNode, this._hostLView);
}
/** @deprecated No replacement */
get parentInjector() {
const parentLocation = getParentInjectorLocation(this._hostTNode, this._hostLView);
if (hasParentInjector(parentLocation)) {
const parentView = getParentInjectorView(parentLocation, this._hostLView);
const injectorIndex = getParentInjectorIndex(parentLocation);
ngDevMode && assertNodeInjector(parentView, injectorIndex);
const parentTNode = parentView[TVIEW].data[
injectorIndex + 8
/* NodeInjectorOffset.TNODE */
];
return new NodeInjector(parentTNode, parentView);
} else {
return new NodeInjector(null, this._hostLView);
}
}
clear() {
while (this.length > 0) {
this.remove(this.length - 1);
}
}
get(index) {
const viewRefs = getViewRefs(this._lContainer);
return viewRefs !== null && viewRefs[index] || null;
}
get length() {
return this._lContainer.length - CONTAINER_HEADER_OFFSET;
}
createEmbeddedView(templateRef, context2, indexOrOptions) {
let index;
let injector;
if (typeof indexOrOptions === "number") {
index = indexOrOptions;
} else if (indexOrOptions != null) {
index = indexOrOptions.index;
injector = indexOrOptions.injector;
}
const dehydratedView = findMatchingDehydratedView(this._lContainer, templateRef.ssrId);
const viewRef = templateRef.createEmbeddedViewImpl(context2 || {}, injector, dehydratedView);
this.insertImpl(viewRef, index, shouldAddViewToDom(this._hostTNode, dehydratedView));
return viewRef;
}
createComponent(componentFactoryOrType, indexOrOptions, injector, projectableNodes, environmentInjector, directives, bindings) {
const isComponentFactory = componentFactoryOrType && !isType(componentFactoryOrType);
let index;
if (isComponentFactory) {
if (ngDevMode) {
assertEqual(typeof indexOrOptions !== "object", true, "It looks like Component factory was provided as the first argument and an options object as the second argument. This combination of arguments is incompatible. You can either change the first argument to provide Component type or change the second argument to be a number (representing an index at which to insert the new component's host view into this container)");
}
index = indexOrOptions;
} else {
if (ngDevMode) {
assertDefined(getComponentDef(componentFactoryOrType), `Provided Component class doesn't contain Component definition. Please check whether provided class has @Component decorator.`);
assertEqual(typeof indexOrOptions !== "number", true, "It looks like Component type was provided as the first argument and a number (representing an index at which to insert the new component's host view into this container as the second argument. This combination of arguments is incompatible. Please use an object as the second argument instead.");
}
const options = indexOrOptions || {};
if (ngDevMode && options.environmentInjector && options.ngModuleRef) {
throwError2(`Cannot pass both environmentInjector and ngModuleRef options to createComponent().`);
}
index = options.index;
injector = options.injector;
projectableNodes = options.projectableNodes;
environmentInjector = options.environmentInjector || options.ngModuleRef;
directives = options.directives;
bindings = options.bindings;
}
const componentFactory = isComponentFactory ? componentFactoryOrType : new ComponentFactory2(getComponentDef(componentFactoryOrType));
const contextInjector = injector || this.parentInjector;
if (!environmentInjector && componentFactory.ngModule == null) {
const _injector = isComponentFactory ? contextInjector : this.parentInjector;
const result = _injector.get(EnvironmentInjector, null);
if (result) {
environmentInjector = result;
}
}
const componentDef = getComponentDef(componentFactory.componentType ?? {});
const dehydratedView = findMatchingDehydratedView(this._lContainer, componentDef?.id ?? null);
const rNode = dehydratedView?.firstChild ?? null;
const componentRef = componentFactory.create(contextInjector, projectableNodes, rNode, environmentInjector, directives, bindings);
this.insertImpl(componentRef.hostView, index, shouldAddViewToDom(this._hostTNode, dehydratedView));
return componentRef;
}
insert(viewRef, index) {
return this.insertImpl(viewRef, index, true);
}
insertImpl(viewRef, index, addToDOM) {
const lView = viewRef._lView;
if (ngDevMode && viewRef.destroyed) {
throw new Error("Cannot insert a destroyed View in a ViewContainer!");
}
if (viewAttachedToContainer(lView)) {
const prevIdx = this.indexOf(viewRef);
if (prevIdx !== -1) {
this.detach(prevIdx);
} else {
const prevLContainer = lView[PARENT];
ngDevMode && assertEqual(isLContainer(prevLContainer), true, "An attached view should have its PARENT point to a container.");
const prevVCRef = new R3ViewContainerRef(prevLContainer, prevLContainer[T_HOST], prevLContainer[PARENT]);
prevVCRef.detach(prevVCRef.indexOf(viewRef));
}
}
const adjustedIdx = this._adjustIndex(index);
const lContainer = this._lContainer;
addLViewToLContainer(lContainer, lView, adjustedIdx, addToDOM);
viewRef.attachToViewContainerRef();
addToArray(getOrCreateViewRefs(lContainer), adjustedIdx, viewRef);
return viewRef;
}
move(viewRef, newIndex) {
if (ngDevMode && viewRef.destroyed) {
throw new Error("Cannot move a destroyed View in a ViewContainer!");
}
return this.insert(viewRef, newIndex);
}
indexOf(viewRef) {
const viewRefsArr = getViewRefs(this._lContainer);
return viewRefsArr !== null ? viewRefsArr.indexOf(viewRef) : -1;
}
remove(index) {
const adjustedIdx = this._adjustIndex(index, -1);
const detachedView = detachView(this._lContainer, adjustedIdx);
if (detachedView) {
removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx);
destroyLView(detachedView[TVIEW], detachedView);
}
}
detach(index) {
const adjustedIdx = this._adjustIndex(index, -1);
const view = detachView(this._lContainer, adjustedIdx);
const wasDetached = view && removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx) != null;
return wasDetached ? new ViewRef(view) : null;
}
_adjustIndex(index, shift = 0) {
if (index == null) {
return this.length + shift;
}
if (ngDevMode) {
assertGreaterThan(index, -1, `ViewRef index must be positive, got ${index}`);
assertLessThan(index, this.length + 1 + shift, "index");
}
return index;
}
};
function getViewRefs(lContainer) {
return lContainer[VIEW_REFS];
}
function getOrCreateViewRefs(lContainer) {
return lContainer[VIEW_REFS] || (lContainer[VIEW_REFS] = []);
}
function createContainerRef(hostTNode, hostLView) {
ngDevMode && assertTNodeType(
hostTNode,
12 | 3
/* TNodeType.AnyRNode */
);
let lContainer;
const slotValue = hostLView[hostTNode.index];
if (isLContainer(slotValue)) {
lContainer = slotValue;
} else {
lContainer = createLContainer(slotValue, hostLView, null, hostTNode);
hostLView[hostTNode.index] = lContainer;
addToEndOfViewTree(hostLView, lContainer);
}
_locateOrCreateAnchorNode(lContainer, hostLView, hostTNode, slotValue);
return new R3ViewContainerRef(lContainer, hostTNode, hostLView);
}
function insertAnchorNode(hostLView, hostTNode) {
const renderer = hostLView[RENDERER];
const commentNode = renderer.createComment(ngDevMode ? "container" : "");
const hostNative = getNativeByTNode(hostTNode, hostLView);
const parentOfHostNative = renderer.parentNode(hostNative);
nativeInsertBefore(renderer, parentOfHostNative, commentNode, renderer.nextSibling(hostNative), false);
return commentNode;
}
var _locateOrCreateAnchorNode = createAnchorNode;
var _populateDehydratedViewsInLContainer = () => false;
function populateDehydratedViewsInLContainer(lContainer, tNode, hostLView) {
return _populateDehydratedViewsInLContainer(lContainer, tNode, hostLView);
}
function createAnchorNode(lContainer, hostLView, hostTNode, slotValue) {
if (lContainer[NATIVE])
return;
let commentNode;
if (hostTNode.type & 8) {
commentNode = unwrapRNode(slotValue);
} else {
commentNode = insertAnchorNode(hostLView, hostTNode);
}
lContainer[NATIVE] = commentNode;
}
var LQuery_ = class _LQuery_ {
queryList;
matches = null;
constructor(queryList) {
this.queryList = queryList;
}
clone() {
return new _LQuery_(this.queryList);
}
setDirty() {
this.queryList.setDirty();
}
};
var LQueries_ = class _LQueries_ {
queries;
constructor(queries = []) {
this.queries = queries;
}
createEmbeddedView(tView) {
const tQueries = tView.queries;
if (tQueries !== null) {
const noOfInheritedQueries = tView.contentQueries !== null ? tView.contentQueries[0] : tQueries.length;
const viewLQueries = [];
for (let i = 0; i < noOfInheritedQueries; i++) {
const tQuery = tQueries.getByIndex(i);
const parentLQuery = this.queries[tQuery.indexInDeclarationView];
viewLQueries.push(parentLQuery.clone());
}
return new _LQueries_(viewLQueries);
}
return null;
}
insertView(tView) {
this.dirtyQueriesWithMatches(tView);
}
detachView(tView) {
this.dirtyQueriesWithMatches(tView);
}
finishViewCreation(tView) {
this.dirtyQueriesWithMatches(tView);
}
dirtyQueriesWithMatches(tView) {
for (let i = 0; i < this.queries.length; i++) {
if (getTQuery(tView, i).matches !== null) {
this.queries[i].setDirty();
}
}
}
};
var TQueryMetadata_ = class {
flags;
read;
predicate;
constructor(predicate, flags, read = null) {
this.flags = flags;
this.read = read;
if (typeof predicate === "string") {
this.predicate = splitQueryMultiSelectors(predicate);
} else {
this.predicate = predicate;
}
}
};
var TQueries_ = class _TQueries_ {
queries;
constructor(queries = []) {
this.queries = queries;
}
elementStart(tView, tNode) {
ngDevMode && assertFirstCreatePass(tView, "Queries should collect results on the first template pass only");
for (let i = 0; i < this.queries.length; i++) {
this.queries[i].elementStart(tView, tNode);
}
}
elementEnd(tNode) {
for (let i = 0; i < this.queries.length; i++) {
this.queries[i].elementEnd(tNode);
}
}
embeddedTView(tNode) {
let queriesForTemplateRef = null;
for (let i = 0; i < this.length; i++) {
const childQueryIndex = queriesForTemplateRef !== null ? queriesForTemplateRef.length : 0;
const tqueryClone = this.getByIndex(i).embeddedTView(tNode, childQueryIndex);
if (tqueryClone) {
tqueryClone.indexInDeclarationView = i;
if (queriesForTemplateRef !== null) {
queriesForTemplateRef.push(tqueryClone);
} else {
queriesForTemplateRef = [tqueryClone];
}
}
}
return queriesForTemplateRef !== null ? new _TQueries_(queriesForTemplateRef) : null;
}
template(tView, tNode) {
ngDevMode && assertFirstCreatePass(tView, "Queries should collect results on the first template pass only");
for (let i = 0; i < this.queries.length; i++) {
this.queries[i].template(tView, tNode);
}
}
getByIndex(index) {
ngDevMode && assertIndexInRange(this.queries, index);
return this.queries[index];
}
get length() {
return this.queries.length;
}
track(tquery) {
this.queries.push(tquery);
}
};
var TQuery_ = class _TQuery_ {
metadata;
matches = null;
indexInDeclarationView = -1;
crossesNgTemplate = false;
/**
* A node index on which a query was declared (-1 for view queries and ones inherited from the
* declaration template). We use this index (alongside with _appliesToNextNode flag) to know
* when to apply content queries to elements in a template.
*/
_declarationNodeIndex;
/**
* A flag indicating if a given query still applies to nodes it is crossing. We use this flag
* (alongside with _declarationNodeIndex) to know when to stop applying content queries to
* elements in a template.
*/
_appliesToNextNode = true;
constructor(metadata, nodeIndex = -1) {
this.metadata = metadata;
this._declarationNodeIndex = nodeIndex;
}
elementStart(tView, tNode) {
if (this.isApplyingToNode(tNode)) {
this.matchTNode(tView, tNode);
}
}
elementEnd(tNode) {
if (this._declarationNodeIndex === tNode.index) {
this._appliesToNextNode = false;
}
}
template(tView, tNode) {
this.elementStart(tView, tNode);
}
embeddedTView(tNode, childQueryIndex) {
if (this.isApplyingToNode(tNode)) {
this.crossesNgTemplate = true;
this.addMatch(-tNode.index, childQueryIndex);
return new _TQuery_(this.metadata);
}
return null;
}
isApplyingToNode(tNode) {
if (this._appliesToNextNode && (this.metadata.flags & 1) !== 1) {
const declarationNodeIdx = this._declarationNodeIndex;
let parent = tNode.parent;
while (parent !== null && parent.type & 8 && parent.index !== declarationNodeIdx) {
parent = parent.parent;
}
return declarationNodeIdx === (parent !== null ? parent.index : -1);
}
return this._appliesToNextNode;
}
matchTNode(tView, tNode) {
const predicate = this.metadata.predicate;
if (Array.isArray(predicate)) {
for (let i = 0; i < predicate.length; i++) {
const name = predicate[i];
this.matchTNodeWithReadOption(tView, tNode, getIdxOfMatchingSelector(tNode, name));
this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, name, false, false));
}
} else {
if (predicate === TemplateRef) {
if (tNode.type & 4) {
this.matchTNodeWithReadOption(tView, tNode, -1);
}
} else {
this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, predicate, false, false));
}
}
}
matchTNodeWithReadOption(tView, tNode, nodeMatchIdx) {
if (nodeMatchIdx !== null) {
const read = this.metadata.read;
if (read !== null) {
if (read === ElementRef || read === ViewContainerRef || read === TemplateRef && tNode.type & 4) {
this.addMatch(tNode.index, -2);
} else {
const directiveOrProviderIdx = locateDirectiveOrProvider(tNode, tView, read, false, false);
if (directiveOrProviderIdx !== null) {
this.addMatch(tNode.index, directiveOrProviderIdx);
}
}
} else {
this.addMatch(tNode.index, nodeMatchIdx);
}
}
}
addMatch(tNodeIdx, matchIdx) {
if (this.matches === null) {
this.matches = [tNodeIdx, matchIdx];
} else {
this.matches.push(tNodeIdx, matchIdx);
}
}
};
function getIdxOfMatchingSelector(tNode, selector) {
const localNames = tNode.localNames;
if (localNames !== null) {
for (let i = 0; i < localNames.length; i += 2) {
if (localNames[i] === selector) {
return localNames[i + 1];
}
}
}
return null;
}
function createResultByTNodeType(tNode, currentView) {
if (tNode.type & (3 | 8)) {
return createElementRef(tNode, currentView);
} else if (tNode.type & 4) {
return createTemplateRef(tNode, currentView);
}
return null;
}
function createResultForNode(lView, tNode, matchingIdx, read) {
if (matchingIdx === -1) {
return createResultByTNodeType(tNode, lView);
} else if (matchingIdx === -2) {
return createSpecialToken(lView, tNode, read);
} else {
return getNodeInjectable(lView, lView[TVIEW], matchingIdx, tNode);
}
}
function createSpecialToken(lView, tNode, read) {
if (read === ElementRef) {
return createElementRef(tNode, lView);
} else if (read === TemplateRef) {
return createTemplateRef(tNode, lView);
} else if (read === ViewContainerRef) {
ngDevMode && assertTNodeType(
tNode,
3 | 12
/* TNodeType.AnyContainer */
);
return createContainerRef(tNode, lView);
} else {
ngDevMode && throwError2(`Special token to read should be one of ElementRef, TemplateRef or ViewContainerRef but got ${stringify(read)}.`);
}
}
function materializeViewResults(tView, lView, tQuery, queryIndex) {
const lQuery = lView[QUERIES].queries[queryIndex];
if (lQuery.matches === null) {
const tViewData = tView.data;
const tQueryMatches = tQuery.matches;
const result = [];
for (let i = 0; tQueryMatches !== null && i < tQueryMatches.length; i += 2) {
const matchedNodeIdx = tQueryMatches[i];
if (matchedNodeIdx < 0) {
result.push(null);
} else {
ngDevMode && assertIndexInRange(tViewData, matchedNodeIdx);
const tNode = tViewData[matchedNodeIdx];
result.push(createResultForNode(lView, tNode, tQueryMatches[i + 1], tQuery.metadata.read));
}
}
lQuery.matches = result;
}
return lQuery.matches;
}
function collectQueryResults(tView, lView, queryIndex, result) {
const tQuery = tView.queries.getByIndex(queryIndex);
const tQueryMatches = tQuery.matches;
if (tQueryMatches !== null) {
const lViewResults = materializeViewResults(tView, lView, tQuery, queryIndex);
for (let i = 0; i < tQueryMatches.length; i += 2) {
const tNodeIdx = tQueryMatches[i];
if (tNodeIdx > 0) {
result.push(lViewResults[i / 2]);
} else {
const childQueryIndex = tQueryMatches[i + 1];
const declarationLContainer = lView[-tNodeIdx];
ngDevMode && assertLContainer(declarationLContainer);
for (let i2 = CONTAINER_HEADER_OFFSET; i2 < declarationLContainer.length; i2++) {
const embeddedLView = declarationLContainer[i2];
if (embeddedLView[DECLARATION_LCONTAINER] === embeddedLView[PARENT]) {
collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);
}
}
if (declarationLContainer[MOVED_VIEWS] !== null) {
const embeddedLViews = declarationLContainer[MOVED_VIEWS];
for (let i2 = 0; i2 < embeddedLViews.length; i2++) {
const embeddedLView = embeddedLViews[i2];
collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);
}
}
}
}
}
return result;
}
function loadQueryInternal(lView, queryIndex) {
ngDevMode && assertDefined(lView[QUERIES], "LQueries should be defined when trying to load a query");
ngDevMode && assertIndexInRange(lView[QUERIES].queries, queryIndex);
return lView[QUERIES].queries[queryIndex].queryList;
}
function createLQuery(tView, lView, flags) {
const queryList = new QueryList(
(flags & 4) === 4
/* QueryFlags.emitDistinctChangesOnly */
);
storeCleanupWithContext(tView, lView, queryList, queryList.destroy);
const lQueries = (lView[QUERIES] ??= new LQueries_()).queries;
return lQueries.push(new LQuery_(queryList)) - 1;
}
function createViewQuery(predicate, flags, read) {
ngDevMode && assertNumber(flags, "Expecting flags");
const tView = getTView();
if (tView.firstCreatePass) {
createTQuery(tView, new TQueryMetadata_(predicate, flags, read), -1);
if ((flags & 2) === 2) {
tView.staticViewQueries = true;
}
}
return createLQuery(tView, getLView(), flags);
}
function createContentQuery(directiveIndex, predicate, flags, read) {
ngDevMode && assertNumber(flags, "Expecting flags");
const tView = getTView();
if (tView.firstCreatePass) {
const tNode = getCurrentTNode();
createTQuery(tView, new TQueryMetadata_(predicate, flags, read), tNode.index);
saveContentQueryAndDirectiveIndex(tView, directiveIndex);
if ((flags & 2) === 2) {
tView.staticContentQueries = true;
}
}
return createLQuery(tView, getLView(), flags);
}
function splitQueryMultiSelectors(locator) {
return locator.split(",").map((s) => s.trim());
}
function createTQuery(tView, metadata, nodeIndex) {
if (tView.queries === null)
tView.queries = new TQueries_();
tView.queries.track(new TQuery_(metadata, nodeIndex));
}
function saveContentQueryAndDirectiveIndex(tView, directiveIndex) {
const tViewContentQueries = tView.contentQueries || (tView.contentQueries = []);
const lastSavedDirectiveIndex = tViewContentQueries.length ? tViewContentQueries[tViewContentQueries.length - 1] : -1;
if (directiveIndex !== lastSavedDirectiveIndex) {
tViewContentQueries.push(tView.queries.length - 1, directiveIndex);
}
}
function getTQuery(tView, index) {
ngDevMode && assertDefined(tView.queries, "TQueries must be defined to retrieve a TQuery");
return tView.queries.getByIndex(index);
}
function getQueryResults(lView, queryIndex) {
const tView = lView[TVIEW];
const tQuery = getTQuery(tView, queryIndex);
return tQuery.crossesNgTemplate ? collectQueryResults(tView, lView, queryIndex, []) : materializeViewResults(tView, lView, tQuery, queryIndex);
}
function createQuerySignalFn(firstOnly, required, opts) {
let node;
const signalFn = createComputed(() => {
node._dirtyCounter();
const value = refreshSignalQuery(node, firstOnly);
if (required && value === void 0) {
throw new RuntimeError(-951, ngDevMode && "Child query result is required but no value is available.");
}
return value;
});
node = signalFn[SIGNAL];
node._dirtyCounter = signal(0);
node._flatValue = void 0;
if (ngDevMode) {
signalFn.toString = () => `[Query Signal]`;
node.debugName = opts?.debugName;
}
return signalFn;
}
function createSingleResultOptionalQuerySignalFn(opts) {
return createQuerySignalFn(
/* firstOnly */
true,
/* required */
false,
opts
);
}
function createSingleResultRequiredQuerySignalFn(opts) {
return createQuerySignalFn(
/* firstOnly */
true,
/* required */
true,
opts
);
}
function createMultiResultQuerySignalFn(opts) {
return createQuerySignalFn(
/* firstOnly */
false,
/* required */
false,
opts
);
}
function bindQueryToSignal(target, queryIndex) {
const node = target[SIGNAL];
node._lView = getLView();
node._queryIndex = queryIndex;
node._queryList = loadQueryInternal(node._lView, queryIndex);
node._queryList.onDirty(() => node._dirtyCounter.update((v) => v + 1));
}
function refreshSignalQuery(node, firstOnly) {
const lView = node._lView;
const queryIndex = node._queryIndex;
if (lView === void 0 || queryIndex === void 0 || lView[FLAGS] & 4) {
return firstOnly ? void 0 : EMPTY_ARRAY;
}
const queryList = loadQueryInternal(lView, queryIndex);
const results = getQueryResults(lView, queryIndex);
queryList.reset(results, unwrapElementRef);
if (firstOnly) {
return queryList.first;
} else {
const resultChanged = queryList._changesDetected;
if (resultChanged || node._flatValue === void 0) {
return node._flatValue = queryList.toArray();
}
return node._flatValue;
}
}
function resolveComponentResources(resourceResolver) {
const componentResolved = [];
const urlMap = /* @__PURE__ */ new Map();
function cachedResourceResolve(url) {
let promise = urlMap.get(url);
if (!promise) {
const resp = resourceResolver(url);
urlMap.set(url, promise = resp.then((res) => unwrapResponse(url, res)));
}
return promise;
}
componentResourceResolutionQueue.forEach((component, type) => {
const promises = [];
if (component.templateUrl) {
promises.push(cachedResourceResolve(component.templateUrl).then((template) => {
component.template = template;
}));
}
const styles = typeof component.styles === "string" ? [component.styles] : component.styles || [];
component.styles = styles;
if (component.styleUrl && component.styleUrls?.length) {
throw new Error("@Component cannot define both `styleUrl` and `styleUrls`. Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple");
} else if (component.styleUrls?.length) {
const styleOffset = component.styles.length;
const styleUrls = component.styleUrls;
component.styleUrls.forEach((styleUrl, index) => {
styles.push("");
promises.push(cachedResourceResolve(styleUrl).then((style) => {
styles[styleOffset + index] = style;
styleUrls.splice(styleUrls.indexOf(styleUrl), 1);
if (styleUrls.length == 0) {
component.styleUrls = void 0;
}
}));
});
} else if (component.styleUrl) {
promises.push(cachedResourceResolve(component.styleUrl).then((style) => {
styles.push(style);
component.styleUrl = void 0;
}));
}
const fullyResolved = Promise.all(promises).then(() => componentDefResolved(type));
componentResolved.push(fullyResolved);
});
clearResolutionOfComponentResourcesQueue();
return Promise.all(componentResolved).then(() => void 0);
}
var componentResourceResolutionQueue = /* @__PURE__ */ new Map();
var componentDefPendingResolution = /* @__PURE__ */ new Set();
function maybeQueueResolutionOfComponentResources(type, metadata) {
if (componentNeedsResolution(metadata)) {
componentResourceResolutionQueue.set(type, metadata);
componentDefPendingResolution.add(type);
}
}
function componentNeedsResolution(component) {
return !!(component.templateUrl && !component.hasOwnProperty("template") || component.styleUrls && component.styleUrls.length || component.styleUrl);
}
function clearResolutionOfComponentResourcesQueue() {
const old = componentResourceResolutionQueue;
componentResourceResolutionQueue = /* @__PURE__ */ new Map();
return old;
}
function isComponentResourceResolutionQueueEmpty() {
return componentResourceResolutionQueue.size === 0;
}
function unwrapResponse(url, response) {
if (typeof response === "string") {
return response;
}
if (response.status !== void 0 && response.status !== 200) {
return Promise.reject(new RuntimeError(918, ngDevMode && `Could not load resource: ${url}. Response status: ${response.status}`));
}
return response.text();
}
function componentDefResolved(type) {
componentDefPendingResolution.delete(type);
}
var modules = /* @__PURE__ */ new Map();
var checkForDuplicateNgModules = true;
function assertSameOrNotExisting(id, type, incoming) {
if (type && type !== incoming && checkForDuplicateNgModules) {
throw new Error(`Duplicate module registered for ${id} - ${stringify(type)} vs ${stringify(type.name)}`);
}
}
function registerNgModuleType(ngModuleType, id) {
const existing = modules.get(id) || null;
assertSameOrNotExisting(id, existing, ngModuleType);
modules.set(id, ngModuleType);
}
function \u0275\u0275validateIframeAttribute(attrValue, tagName, attrName) {
const lView = getLView();
const tNode = getSelectedTNode();
const element = getNativeByTNode(tNode, lView);
if (tNode.type === 2 && tagName.toLowerCase() === "iframe") {
const iframe = element;
iframe.src = "";
iframe.srcdoc = trustedHTMLFromString("");
nativeRemoveNode(lView[RENDERER], iframe);
const errorMessage = ngDevMode && `Angular has detected that the \`${attrName}\` was applied as a binding to an <iframe>${getTemplateLocationDetails(lView)}. For security reasons, the \`${attrName}\` can be set on an <iframe> as a static attribute only.
To fix this, switch the \`${attrName}\` binding to a static attribute in a template or in host bindings section.`;
throw new RuntimeError(-910, errorMessage);
}
return attrValue;
}
var markedFeatures = /* @__PURE__ */ new Set();
function performanceMarkFeature(feature) {
if (markedFeatures.has(feature)) {
return;
}
markedFeatures.add(feature);
performance?.mark?.("mark_feature_usage", { detail: { feature } });
}
var NgModuleRef$1 = class NgModuleRef {
};
var NgModuleFactory$1 = class NgModuleFactory {
};
function createNgModule(ngModule, parentInjector) {
return new NgModuleRef2(ngModule, parentInjector ?? null, []);
}
var NgModuleRef2 = class extends NgModuleRef$1 {
ngModuleType;
_parent;
// tslint:disable-next-line:require-internal-with-underscore
_bootstrapComponents = [];
_r3Injector;
instance;
destroyCbs = [];
// When bootstrapping a module we have a dependency graph that looks like this:
// ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the
// module being resolved tries to inject the ComponentFactoryResolver, it'll create a
// circular dependency which will result in a runtime error, because the injector doesn't
// exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves
// and providing it, rather than letting the injector resolve it.
componentFactoryResolver = new ComponentFactoryResolver2(this);
constructor(ngModuleType, _parent, additionalProviders, runInjectorInitializers = true) {
super();
this.ngModuleType = ngModuleType;
this._parent = _parent;
const ngModuleDef = getNgModuleDef(ngModuleType);
ngDevMode && assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
{ provide: NgModuleRef$1, useValue: this },
{
provide: ComponentFactoryResolver$1,
useValue: this.componentFactoryResolver
},
...additionalProviders
], stringify(ngModuleType), /* @__PURE__ */ new Set(["environment"]));
if (runInjectorInitializers) {
this.resolveInjectorInitializers();
}
}
resolveInjectorInitializers() {
this._r3Injector.resolveInjectorInitializers();
this.instance = this._r3Injector.get(this.ngModuleType);
}
get injector() {
return this._r3Injector;
}
destroy() {
ngDevMode && assertDefined(this.destroyCbs, "NgModule already destroyed");
const injector = this._r3Injector;
!injector.destroyed && injector.destroy();
this.destroyCbs.forEach((fn) => fn());
this.destroyCbs = null;
}
onDestroy(callback) {
ngDevMode && assertDefined(this.destroyCbs, "NgModule already destroyed");
this.destroyCbs.push(callback);
}
};
var NgModuleFactory2 = class extends NgModuleFactory$1 {
moduleType;
constructor(moduleType) {
super();
this.moduleType = moduleType;
}
create(parentInjector) {
return new NgModuleRef2(this.moduleType, parentInjector, []);
}
};
function createNgModuleRefWithProviders(moduleType, parentInjector, additionalProviders) {
return new NgModuleRef2(moduleType, parentInjector, additionalProviders, false);
}
var EnvironmentNgModuleRefAdapter = class extends NgModuleRef$1 {
injector;
componentFactoryResolver = new ComponentFactoryResolver2(this);
instance = null;
constructor(config2) {
super();
const injector = new R3Injector([
...config2.providers,
{ provide: NgModuleRef$1, useValue: this },
{ provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver }
], config2.parent || getNullInjector(), config2.debugName, /* @__PURE__ */ new Set(["environment"]));
this.injector = injector;
if (config2.runEnvironmentInitializers) {
injector.resolveInjectorInitializers();
}
}
destroy() {
this.injector.destroy();
}
onDestroy(callback) {
this.injector.onDestroy(callback);
}
};
function createEnvironmentInjector(providers, parent, debugName = null) {
const adapter = new EnvironmentNgModuleRefAdapter({
providers,
parent,
debugName,
runEnvironmentInitializers: true
});
return adapter.injector;
}
var StandaloneService = class _StandaloneService {
_injector;
cachedInjectors = /* @__PURE__ */ new Map();
constructor(_injector) {
this._injector = _injector;
}
getOrCreateStandaloneInjector(componentDef) {
if (!componentDef.standalone) {
return null;
}
if (!this.cachedInjectors.has(componentDef)) {
const providers = internalImportProvidersFrom(false, componentDef.type);
const standaloneInjector = providers.length > 0 ? createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) : null;
this.cachedInjectors.set(componentDef, standaloneInjector);
}
return this.cachedInjectors.get(componentDef);
}
ngOnDestroy() {
try {
for (const injector of this.cachedInjectors.values()) {
if (injector !== null) {
injector.destroy();
}
}
} finally {
this.cachedInjectors.clear();
}
}
/** @nocollapse */
static \u0275prov = (
/** @pureOrBreakMyCode */
/* @__PURE__ */ \u0275\u0275defineInjectable({
token: _StandaloneService,
providedIn: "environment",
factory: () => new _StandaloneService(\u0275\u0275inject(EnvironmentInjector))
})
);
};
function \u0275\u0275defineComponent(componentDefinition) {
return noSideEffects(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && initNgDevMode();
const baseDef = getNgDirectiveDef(componentDefinition);
const def = __spreadProps(__spreadValues({}, baseDef), {
decls: componentDefinition.decls,
vars: componentDefinition.vars,
template: componentDefinition.template,
consts: componentDefinition.consts || null,
ngContentSelectors: componentDefinition.ngContentSelectors,
onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,
directiveDefs: null,
// assigned in noSideEffects
pipeDefs: null,
// assigned in noSideEffects
dependencies: baseDef.standalone && componentDefinition.dependencies || null,
getStandaloneInjector: baseDef.standalone ? (parentInjector) => {
return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(def);
} : null,
getExternalStyles: null,
signals: componentDefinition.signals ?? false,
data: componentDefinition.data || {},
encapsulation: componentDefinition.encapsulation || ViewEncapsulation.Emulated,
styles: componentDefinition.styles || EMPTY_ARRAY,
_: null,
schemas: componentDefinition.schemas || null,
tView: null,
id: ""
});
if (baseDef.standalone) {
performanceMarkFeature("NgStandalone");
}
initFeatures(def);
const dependencies = componentDefinition.dependencies;
def.directiveDefs = extractDefListOrFactory(dependencies, extractDirectiveDef);
def.pipeDefs = extractDefListOrFactory(dependencies, getPipeDef);
def.id = getComponentId(def);
return def;
});
}
function extractDirectiveDef(type) {
return getComponentDef(type) || getDirectiveDef(type);
}
function \u0275\u0275defineNgModule(def) {
return noSideEffects(() => {
const res = {
type: def.type,
bootstrap: def.bootstrap || EMPTY_ARRAY,
declarations: def.declarations || EMPTY_ARRAY,
imports: def.imports || EMPTY_ARRAY,
exports: def.exports || EMPTY_ARRAY,
transitiveCompileScopes: null,
schemas: def.schemas || null,
id: def.id || null
};
return res;
});
}
function parseAndConvertInputsForDefinition(obj, declaredInputs) {
if (obj == null)
return EMPTY_OBJ;
const newLookup = {};
for (const minifiedKey in obj) {
if (obj.hasOwnProperty(minifiedKey)) {
const value = obj[minifiedKey];
let publicName;
let declaredName;
let inputFlags;
let transform;
if (Array.isArray(value)) {
inputFlags = value[0];
publicName = value[1];
declaredName = value[2] ?? publicName;
transform = value[3] || null;
} else {
publicName = value;
declaredName = value;
inputFlags = InputFlags.None;
transform = null;
}
newLookup[publicName] = [minifiedKey, inputFlags, transform];
declaredInputs[publicName] = declaredName;
}
}
return newLookup;
}
function parseAndConvertOutputsForDefinition(obj) {
if (obj == null)
return EMPTY_OBJ;
const newLookup = {};
for (const minifiedKey in obj) {
if (obj.hasOwnProperty(minifiedKey)) {
newLookup[obj[minifiedKey]] = minifiedKey;
}
}
return newLookup;
}
function \u0275\u0275defineDirective(directiveDefinition) {
return noSideEffects(() => {
const def = getNgDirectiveDef(directiveDefinition);
initFeatures(def);
return def;
});
}
function \u0275\u0275definePipe(pipeDef) {
return {
type: pipeDef.type,
name: pipeDef.name,
factory: null,
pure: pipeDef.pure !== false,
standalone: pipeDef.standalone ?? true,
onDestroy: pipeDef.type.prototype.ngOnDestroy || null
};
}
function getNgDirectiveDef(directiveDefinition) {
const declaredInputs = {};
return {
type: directiveDefinition.type,
providersResolver: null,
factory: null,
hostBindings: directiveDefinition.hostBindings || null,
hostVars: directiveDefinition.hostVars || 0,
hostAttrs: directiveDefinition.hostAttrs || null,
contentQueries: directiveDefinition.contentQueries || null,
declaredInputs,
inputConfig: directiveDefinition.inputs || EMPTY_OBJ,
exportAs: directiveDefinition.exportAs || null,
standalone: directiveDefinition.standalone ?? true,
signals: directiveDefinition.signals === true,
selectors: directiveDefinition.selectors || EMPTY_ARRAY,
viewQuery: directiveDefinition.viewQuery || null,
features: directiveDefinition.features || null,
setInput: null,
resolveHostDirectives: null,
hostDirectives: null,
inputs: parseAndConvertInputsForDefinition(directiveDefinition.inputs, declaredInputs),
outputs: parseAndConvertOutputsForDefinition(directiveDefinition.outputs),
debugInfo: null
};
}
function initFeatures(definition) {
definition.features?.forEach((fn) => fn(definition));
}
function extractDefListOrFactory(dependencies, defExtractor) {
if (!dependencies) {
return null;
}
return () => {
const resolvedDependencies = typeof dependencies === "function" ? dependencies() : dependencies;
const result = [];
for (const dep of resolvedDependencies) {
const definition = defExtractor(dep);
if (definition !== null) {
result.push(definition);
}
}
return result;
};
}
var GENERATED_COMP_IDS = /* @__PURE__ */ new Map();
function getComponentId(componentDef) {
let hash = 0;
const componentDefConsts = typeof componentDef.consts === "function" ? "" : componentDef.consts;
const hashSelectors = [
componentDef.selectors,
componentDef.ngContentSelectors,
componentDef.hostVars,
componentDef.hostAttrs,
componentDefConsts,
componentDef.vars,
componentDef.decls,
componentDef.encapsulation,
componentDef.standalone,
componentDef.signals,
componentDef.exportAs,
JSON.stringify(componentDef.inputs),
JSON.stringify(componentDef.outputs),
// We cannot use 'componentDef.type.name' as the name of the symbol will change and will not
// match in the server and browser bundles.
Object.getOwnPropertyNames(componentDef.type.prototype),
!!componentDef.contentQueries,
!!componentDef.viewQuery
];
if (typeof ngDevMode === "undefined" || ngDevMode) {
for (const item of hashSelectors) {
assertNotEqual(typeof item, "function", "Internal error: attempting to use a function in component id computation logic.");
}
}
for (const char of hashSelectors.join("|")) {
hash = Math.imul(31, hash) + char.charCodeAt(0) << 0;
}
hash += 2147483647 + 1;
const compId = "c" + hash;
if ((typeof ngDevMode === "undefined" || ngDevMode) && true) {
if (GENERATED_COMP_IDS.has(compId)) {
const previousCompDefType = GENERATED_COMP_IDS.get(compId);
if (previousCompDefType !== componentDef.type) {
console.warn(formatRuntimeError(-912, `Component ID generation collision detected. Components '${previousCompDefType.name}' and '${componentDef.type.name}' with selector '${stringifyCSSSelectorList(componentDef.selectors)}' generated the same component ID. To fix this, you can change the selector of one of those components or add an extra host attribute to force a different ID.`));
}
} else {
GENERATED_COMP_IDS.set(compId, componentDef.type);
}
}
return compId;
}
function getSuperType(type) {
return Object.getPrototypeOf(type.prototype).constructor;
}
function \u0275\u0275InheritDefinitionFeature(definition) {
let superType = getSuperType(definition.type);
let shouldInheritFields = true;
const inheritanceChain = [definition];
while (superType) {
let superDef = void 0;
if (isComponentDef(definition)) {
superDef = superType.\u0275cmp || superType.\u0275dir;
} else {
if (superType.\u0275cmp) {
throw new RuntimeError(903, ngDevMode && `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
}
superDef = superType.\u0275dir;
}
if (superDef) {
if (shouldInheritFields) {
inheritanceChain.push(superDef);
const writeableDef = definition;
writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
const superHostBindings = superDef.hostBindings;
superHostBindings && inheritHostBindings(definition, superHostBindings);
const superViewQuery = superDef.viewQuery;
const superContentQueries = superDef.contentQueries;
superViewQuery && inheritViewQuery(definition, superViewQuery);
superContentQueries && inheritContentQueries(definition, superContentQueries);
mergeInputsWithTransforms(definition, superDef);
fillProperties(definition.outputs, superDef.outputs);
if (isComponentDef(superDef) && superDef.data.animation) {
const defData = definition.data;
defData.animation = (defData.animation || []).concat(superDef.data.animation);
}
}
const features = superDef.features;
if (features) {
for (let i = 0; i < features.length; i++) {
const feature = features[i];
if (feature && feature.ngInherit) {
feature(definition);
}
if (feature === \u0275\u0275InheritDefinitionFeature) {
shouldInheritFields = false;
}
}
}
}
superType = Object.getPrototypeOf(superType);
}
mergeHostAttrsAcrossInheritance(inheritanceChain);
}
function mergeInputsWithTransforms(target, source) {
for (const key in source.inputs) {
if (!source.inputs.hasOwnProperty(key)) {
continue;
}
if (target.inputs.hasOwnProperty(key)) {
continue;
}
const value = source.inputs[key];
if (value !== void 0) {
target.inputs[key] = value;
target.declaredInputs[key] = source.declaredInputs[key];
}
}
}
function mergeHostAttrsAcrossInheritance(inheritanceChain) {
let hostVars = 0;
let hostAttrs = null;
for (let i = inheritanceChain.length - 1; i >= 0; i--) {
const def = inheritanceChain[i];
def.hostVars = hostVars += def.hostVars;
def.hostAttrs = mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
}
}
function maybeUnwrapEmpty(value) {
if (value === EMPTY_OBJ) {
return {};
} else if (value === EMPTY_ARRAY) {
return [];
} else {
return value;
}
}
function inheritViewQuery(definition, superViewQuery) {
const prevViewQuery = definition.viewQuery;
if (prevViewQuery) {
definition.viewQuery = (rf, ctx) => {
superViewQuery(rf, ctx);
prevViewQuery(rf, ctx);
};
} else {
definition.viewQuery = superViewQuery;
}
}
function inheritContentQueries(definition, superContentQueries) {
const prevContentQueries = definition.contentQueries;
if (prevContentQueries) {
definition.contentQueries = (rf, ctx, directiveIndex) => {
superContentQueries(rf, ctx, directiveIndex);
prevContentQueries(rf, ctx, directiveIndex);
};
} else {
definition.contentQueries = superContentQueries;
}
}
function inheritHostBindings(definition, superHostBindings) {
const prevHostBindings = definition.hostBindings;
if (prevHostBindings) {
definition.hostBindings = (rf, ctx) => {
superHostBindings(rf, ctx);
prevHostBindings(rf, ctx);
};
} else {
definition.hostBindings = superHostBindings;
}
}
var COPY_DIRECTIVE_FIELDS = [
// The child class should use the providers of its parent.
"providersResolver"
// Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such
// as inputs, outputs, and host binding functions.
];
var COPY_COMPONENT_FIELDS = [
// The child class should use the template function of its parent, including all template
// semantics.
"template",
"decls",
"consts",
"vars",
"onPush",
"ngContentSelectors",
// The child class should use the CSS styles of its parent, including all styling semantics.
"styles",
"encapsulation",
// The child class should be checked by the runtime in the same way as its parent.
"schemas"
];
function \u0275\u0275CopyDefinitionFeature(definition) {
let superType = getSuperType(definition.type);
let superDef = void 0;
if (isComponentDef(definition)) {
superDef = superType.\u0275cmp;
} else {
superDef = superType.\u0275dir;
}
const defAny = definition;
for (const field of COPY_DIRECTIVE_FIELDS) {
defAny[field] = superDef[field];
}
if (isComponentDef(superDef)) {
for (const field of COPY_COMPONENT_FIELDS) {
defAny[field] = superDef[field];
}
}
}
function \u0275\u0275HostDirectivesFeature(rawHostDirectives) {
const feature = (definition) => {
const isEager = Array.isArray(rawHostDirectives);
if (definition.hostDirectives === null) {
definition.resolveHostDirectives = resolveHostDirectives;
definition.hostDirectives = isEager ? rawHostDirectives.map(createHostDirectiveDef) : [rawHostDirectives];
} else if (isEager) {
definition.hostDirectives.unshift(...rawHostDirectives.map(createHostDirectiveDef));
} else {
definition.hostDirectives.unshift(rawHostDirectives);
}
};
feature.ngInherit = true;
return feature;
}
function resolveHostDirectives(matches) {
const allDirectiveDefs = [];
let hasComponent = false;
let hostDirectiveDefs = null;
let hostDirectiveRanges = null;
for (let i = 0; i < matches.length; i++) {
const def = matches[i];
if (def.hostDirectives !== null) {
const start = allDirectiveDefs.length;
hostDirectiveDefs ??= /* @__PURE__ */ new Map();
hostDirectiveRanges ??= /* @__PURE__ */ new Map();
findHostDirectiveDefs(def, allDirectiveDefs, hostDirectiveDefs);
hostDirectiveRanges.set(def, [start, allDirectiveDefs.length - 1]);
}
if (i === 0 && isComponentDef(def)) {
hasComponent = true;
allDirectiveDefs.push(def);
}
}
for (let i = hasComponent ? 1 : 0; i < matches.length; i++) {
allDirectiveDefs.push(matches[i]);
}
return [allDirectiveDefs, hostDirectiveDefs, hostDirectiveRanges];
}
function findHostDirectiveDefs(currentDef, matchedDefs, hostDirectiveDefs) {
if (currentDef.hostDirectives !== null) {
for (const configOrFn of currentDef.hostDirectives) {
if (typeof configOrFn === "function") {
const resolved2 = configOrFn();
for (const config2 of resolved2) {
trackHostDirectiveDef(createHostDirectiveDef(config2), matchedDefs, hostDirectiveDefs);
}
} else {
trackHostDirectiveDef(configOrFn, matchedDefs, hostDirectiveDefs);
}
}
}
}
function trackHostDirectiveDef(def, matchedDefs, hostDirectiveDefs) {
const hostDirectiveDef = getDirectiveDef(def.directive);
if (typeof ngDevMode === "undefined" || ngDevMode) {
validateHostDirective(def, hostDirectiveDef);
}
patchDeclaredInputs(hostDirectiveDef.declaredInputs, def.inputs);
findHostDirectiveDefs(hostDirectiveDef, matchedDefs, hostDirectiveDefs);
hostDirectiveDefs.set(hostDirectiveDef, def);
matchedDefs.push(hostDirectiveDef);
}
function createHostDirectiveDef(config2) {
return typeof config2 === "function" ? { directive: resolveForwardRef(config2), inputs: EMPTY_OBJ, outputs: EMPTY_OBJ } : {
directive: resolveForwardRef(config2.directive),
inputs: bindingArrayToMap(config2.inputs),
outputs: bindingArrayToMap(config2.outputs)
};
}
function bindingArrayToMap(bindings) {
if (bindings === void 0 || bindings.length === 0) {
return EMPTY_OBJ;
}
const result = {};
for (let i = 0; i < bindings.length; i += 2) {
result[bindings[i]] = bindings[i + 1];
}
return result;
}
function patchDeclaredInputs(declaredInputs, exposedInputs) {
for (const publicName in exposedInputs) {
if (exposedInputs.hasOwnProperty(publicName)) {
const remappedPublicName = exposedInputs[publicName];
const privateName = declaredInputs[publicName];
if ((typeof ngDevMode === "undefined" || ngDevMode) && declaredInputs.hasOwnProperty(remappedPublicName)) {
assertEqual(declaredInputs[remappedPublicName], declaredInputs[publicName], `Conflicting host directive input alias ${publicName}.`);
}
declaredInputs[remappedPublicName] = privateName;
}
}
}
function validateHostDirective(hostDirectiveConfig, directiveDef) {
const type = hostDirectiveConfig.directive;
if (directiveDef === null) {
if (getComponentDef(type) !== null) {
throw new RuntimeError(310, `Host directive ${type.name} cannot be a component.`);
}
throw new RuntimeError(307, `Could not resolve metadata for host directive ${type.name}. Make sure that the ${type.name} class is annotated with an @Directive decorator.`);
}
if (!directiveDef.standalone) {
throw new RuntimeError(308, `Host directive ${directiveDef.type.name} must be standalone.`);
}
validateMappings("input", directiveDef, hostDirectiveConfig.inputs);
validateMappings("output", directiveDef, hostDirectiveConfig.outputs);
}
function validateMappings(bindingType, def, hostDirectiveBindings) {
const className = def.type.name;
const bindings = bindingType === "input" ? def.inputs : def.outputs;
for (const publicName in hostDirectiveBindings) {
if (hostDirectiveBindings.hasOwnProperty(publicName)) {
if (!bindings.hasOwnProperty(publicName)) {
throw new RuntimeError(311, `Directive ${className} does not have an ${bindingType} with a public name of ${publicName}.`);
}
const remappedPublicName = hostDirectiveBindings[publicName];
if (bindings.hasOwnProperty(remappedPublicName) && remappedPublicName !== publicName) {
throw new RuntimeError(312, `Cannot alias ${bindingType} ${publicName} of host directive ${className} to ${remappedPublicName}, because it already has a different ${bindingType} with the same public name.`);
}
}
}
}
function templateCreate(tNode, declarationLView, declarationTView, index, templateFn, decls, vars, flags) {
if (declarationTView.firstCreatePass) {
tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
const embeddedTView = tNode.tView = createTView(
2,
tNode,
templateFn,
decls,
vars,
declarationTView.directiveRegistry,
declarationTView.pipeRegistry,
null,
declarationTView.schemas,
declarationTView.consts,
null
/* ssrId */
);
if (declarationTView.queries !== null) {
declarationTView.queries.template(declarationTView, tNode);
embeddedTView.queries = declarationTView.queries.embeddedTView(tNode);
}
}
if (flags) {
tNode.flags |= flags;
}
setCurrentTNode(tNode, false);
const comment = _locateOrCreateContainerAnchor(declarationTView, declarationLView, tNode, index);
if (wasLastNodeCreated()) {
appendChild(declarationTView, declarationLView, comment, tNode);
}
attachPatchData(comment, declarationLView);
const lContainer = createLContainer(comment, declarationLView, comment, tNode);
declarationLView[index + HEADER_OFFSET] = lContainer;
addToEndOfViewTree(declarationLView, lContainer);
populateDehydratedViewsInLContainer(lContainer, tNode, declarationLView);
}
function declareDirectiveHostTemplate(declarationLView, declarationTView, index, templateFn, decls, vars, tagName, attrs, flags, localRefsIndex, localRefExtractor) {
const adjustedIndex = index + HEADER_OFFSET;
let tNode;
if (declarationTView.firstCreatePass) {
tNode = getOrCreateTNode(declarationTView, adjustedIndex, 4, tagName || null, attrs || null);
if (getBindingsEnabled()) {
resolveDirectives(declarationTView, declarationLView, tNode, getConstant(declarationTView.consts, localRefsIndex), findDirectiveDefMatches);
}
registerPostOrderHooks(declarationTView, tNode);
} else {
tNode = declarationTView.data[adjustedIndex];
}
templateCreate(tNode, declarationLView, declarationTView, index, templateFn, decls, vars, flags);
if (isDirectiveHost(tNode)) {
createDirectivesInstances(declarationTView, declarationLView, tNode);
}
if (localRefsIndex != null) {
saveResolvedLocalsInData(declarationLView, tNode, localRefExtractor);
}
return tNode;
}
function declareNoDirectiveHostTemplate(declarationLView, declarationTView, index, templateFn, decls, vars, tagName, attrs, flags, localRefsIndex, localRefExtractor) {
const adjustedIndex = index + HEADER_OFFSET;
let tNode;
if (declarationTView.firstCreatePass) {
tNode = getOrCreateTNode(declarationTView, adjustedIndex, 4, tagName || null, attrs || null);
if (localRefsIndex != null) {
const refs = getConstant(declarationTView.consts, localRefsIndex);
tNode.localNames = [];
for (let i = 0; i < refs.length; i += 2) {
tNode.localNames.push(refs[i], -1);
}
}
} else {
tNode = declarationTView.data[adjustedIndex];
}
templateCreate(tNode, declarationLView, declarationTView, index, templateFn, decls, vars, flags);
if (localRefsIndex != null) {
saveResolvedLocalsInData(declarationLView, tNode, localRefExtractor);
}
return tNode;
}
function \u0275\u0275template(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {
const lView = getLView();
const tView = getTView();
const attrs = getConstant(tView.consts, attrsIndex);
declareDirectiveHostTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, void 0, localRefsIndex, localRefExtractor);
return \u0275\u0275template;
}
function \u0275\u0275domTemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {
const lView = getLView();
const tView = getTView();
const attrs = getConstant(tView.consts, attrsIndex);
declareNoDirectiveHostTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, void 0, localRefsIndex, localRefExtractor);
return \u0275\u0275domTemplate;
}
var _locateOrCreateContainerAnchor = createContainerAnchorImpl;
function createContainerAnchorImpl(tView, lView, tNode, index) {
lastNodeWasCreated(true);
return lView[RENDERER].createComment(ngDevMode ? "container" : "");
}
var DeferDependenciesLoadingState;
(function(DeferDependenciesLoadingState2) {
DeferDependenciesLoadingState2[DeferDependenciesLoadingState2["NOT_STARTED"] = 0] = "NOT_STARTED";
DeferDependenciesLoadingState2[DeferDependenciesLoadingState2["IN_PROGRESS"] = 1] = "IN_PROGRESS";
DeferDependenciesLoadingState2[DeferDependenciesLoadingState2["COMPLETE"] = 2] = "COMPLETE";
DeferDependenciesLoadingState2[DeferDependenciesLoadingState2["FAILED"] = 3] = "FAILED";
})(DeferDependenciesLoadingState || (DeferDependenciesLoadingState = {}));
var MINIMUM_SLOT = 0;
var LOADING_AFTER_SLOT = 1;
var DeferBlockState;
(function(DeferBlockState2) {
DeferBlockState2[DeferBlockState2["Placeholder"] = 0] = "Placeholder";
DeferBlockState2[DeferBlockState2["Loading"] = 1] = "Loading";
DeferBlockState2[DeferBlockState2["Complete"] = 2] = "Complete";
DeferBlockState2[DeferBlockState2["Error"] = 3] = "Error";
})(DeferBlockState || (DeferBlockState = {}));
var DeferBlockInternalState;
(function(DeferBlockInternalState2) {
DeferBlockInternalState2[DeferBlockInternalState2["Initial"] = -1] = "Initial";
})(DeferBlockInternalState || (DeferBlockInternalState = {}));
var NEXT_DEFER_BLOCK_STATE = 0;
var DEFER_BLOCK_STATE = 1;
var STATE_IS_FROZEN_UNTIL = 2;
var LOADING_AFTER_CLEANUP_FN = 3;
var TRIGGER_CLEANUP_FNS = 4;
var PREFETCH_TRIGGER_CLEANUP_FNS = 5;
var SSR_UNIQUE_ID = 6;
var SSR_BLOCK_STATE = 7;
var ON_COMPLETE_FNS = 8;
var HYDRATE_TRIGGER_CLEANUP_FNS = 9;
var DeferBlockBehavior;
(function(DeferBlockBehavior2) {
DeferBlockBehavior2[DeferBlockBehavior2["Manual"] = 0] = "Manual";
DeferBlockBehavior2[DeferBlockBehavior2["Playthrough"] = 1] = "Playthrough";
})(DeferBlockBehavior || (DeferBlockBehavior = {}));
function storeTriggerCleanupFn(type, lDetails, cleanupFn) {
const key = getCleanupFnKeyByType(type);
if (lDetails[key] === null) {
lDetails[key] = [];
}
lDetails[key].push(cleanupFn);
}
function invokeTriggerCleanupFns(type, lDetails) {
const key = getCleanupFnKeyByType(type);
const cleanupFns = lDetails[key];
if (cleanupFns !== null) {
for (const cleanupFn of cleanupFns) {
cleanupFn();
}
lDetails[key] = null;
}
}
function invokeAllTriggerCleanupFns(lDetails) {
invokeTriggerCleanupFns(1, lDetails);
invokeTriggerCleanupFns(0, lDetails);
invokeTriggerCleanupFns(2, lDetails);
}
function getCleanupFnKeyByType(type) {
let key = TRIGGER_CLEANUP_FNS;
if (type === 1) {
key = PREFETCH_TRIGGER_CLEANUP_FNS;
} else if (type === 2) {
key = HYDRATE_TRIGGER_CLEANUP_FNS;
}
return key;
}
var TracingAction;
(function(TracingAction2) {
TracingAction2[TracingAction2["CHANGE_DETECTION"] = 0] = "CHANGE_DETECTION";
TracingAction2[TracingAction2["AFTER_NEXT_RENDER"] = 1] = "AFTER_NEXT_RENDER";
})(TracingAction || (TracingAction = {}));
var TracingService = new InjectionToken(ngDevMode ? "TracingService" : "");
var SCHEDULE_IN_ROOT_ZONE_DEFAULT = false;
var EventEmitter_ = class extends Subject {
// tslint:disable-next-line:require-internal-with-underscore
__isAsync;
destroyRef = void 0;
pendingTasks = void 0;
constructor(isAsync = false) {
super();
this.__isAsync = isAsync;
if (isInInjectionContext()) {
this.destroyRef = inject2(DestroyRef, { optional: true }) ?? void 0;
this.pendingTasks = inject2(PendingTasksInternal, { optional: true }) ?? void 0;
}
}
emit(value) {
const prevConsumer = setActiveConsumer(null);
try {
super.next(value);
} finally {
setActiveConsumer(prevConsumer);
}
}
subscribe(observerOrNext, error, complete) {
let nextFn = observerOrNext;
let errorFn = error || (() => null);
let completeFn = complete;
if (observerOrNext && typeof observerOrNext === "object") {
const observer = observerOrNext;
nextFn = observer.next?.bind(observer);
errorFn = observer.error?.bind(observer);
completeFn = observer.complete?.bind(observer);
}
if (this.__isAsync) {
errorFn = this.wrapInTimeout(errorFn);
if (nextFn) {
nextFn = this.wrapInTimeout(nextFn);
}
if (completeFn) {
completeFn = this.wrapInTimeout(completeFn);
}
}
const sink = super.subscribe({ next: nextFn, error: errorFn, complete: completeFn });
if (observerOrNext instanceof Subscription) {
observerOrNext.add(sink);
}
return sink;
}
wrapInTimeout(fn) {
return (value) => {
const taskId = this.pendingTasks?.add();
setTimeout(() => {
try {
fn(value);
} finally {
if (taskId !== void 0) {
this.pendingTasks?.remove(taskId);
}
}
});
};
}
};
var EventEmitter = EventEmitter_;
function scheduleCallbackWithRafRace(callback) {
let timeoutId;
let animationFrameId;
function cleanup() {
callback = noop2;
try {
if (animationFrameId !== void 0 && typeof cancelAnimationFrame === "function") {
cancelAnimationFrame(animationFrameId);
}
if (timeoutId !== void 0) {
clearTimeout(timeoutId);
}
} catch {
}
}
timeoutId = setTimeout(() => {
callback();
cleanup();
});
if (typeof requestAnimationFrame === "function") {
animationFrameId = requestAnimationFrame(() => {
callback();
cleanup();
});
}
return () => cleanup();
}
function scheduleCallbackWithMicrotask(callback) {
queueMicrotask(() => callback());
return () => {
callback = noop2;
};
}
var AsyncStackTaggingZoneSpec = class {
createTask;
constructor(namePrefix, consoleAsyncStackTaggingImpl = console) {
this.name = "asyncStackTagging for " + namePrefix;
this.createTask = consoleAsyncStackTaggingImpl?.createTask ?? (() => null);
}
// ZoneSpec implementation below.
name;
onScheduleTask(delegate, _current, target, task) {
task.consoleTask = this.createTask(`Zone - ${task.source || task.type}`);
return delegate.scheduleTask(target, task);
}
onInvokeTask(delegate, _currentZone, targetZone, task, applyThis, applyArgs) {
let ret;
if (task.consoleTask) {
ret = task.consoleTask.run(() => delegate.invokeTask(targetZone, task, applyThis, applyArgs));
} else {
ret = delegate.invokeTask(targetZone, task, applyThis, applyArgs);
}
return ret;
}
};
var isAngularZoneProperty = "isAngularZone";
var angularZoneInstanceIdProperty = isAngularZoneProperty + "_ID";
var ngZoneInstanceId = 0;
var NgZone = class _NgZone {
hasPendingMacrotasks = false;
hasPendingMicrotasks = false;
/**
* Whether there are no outstanding microtasks or macrotasks.
*/
isStable = true;
/**
* Notifies when code enters Angular Zone. This gets fired first on VM Turn.
*/
onUnstable = new EventEmitter(false);
/**
* Notifies when there is no more microtasks enqueued in the current VM Turn.
* This is a hint for Angular to do change detection, which may enqueue more microtasks.
* For this reason this event can fire multiple times per VM Turn.
*/
onMicrotaskEmpty = new EventEmitter(false);
/**
* Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which
* implies we are about to relinquish VM turn.
* This event gets called just once.
*/
onStable = new EventEmitter(false);
/**
* Notifies that an error has been delivered.
*/
onError = new EventEmitter(false);
constructor(options) {
const { enableLongStackTrace = false, shouldCoalesceEventChangeDetection = false, shouldCoalesceRunChangeDetection = false, scheduleInRootZone = SCHEDULE_IN_ROOT_ZONE_DEFAULT } = options;
if (typeof Zone == "undefined") {
throw new RuntimeError(908, ngDevMode && `In this configuration Angular requires Zone.js`);
}
Zone.assertZonePatched();
const self = this;
self._nesting = 0;
self._outer = self._inner = Zone.current;
if (ngDevMode) {
self._inner = self._inner.fork(new AsyncStackTaggingZoneSpec("Angular"));
}
if (Zone["TaskTrackingZoneSpec"]) {
self._inner = self._inner.fork(new Zone["TaskTrackingZoneSpec"]());
}
if (enableLongStackTrace && Zone["longStackTraceZoneSpec"]) {
self._inner = self._inner.fork(Zone["longStackTraceZoneSpec"]);
}
self.shouldCoalesceEventChangeDetection = !shouldCoalesceRunChangeDetection && shouldCoalesceEventChangeDetection;
self.shouldCoalesceRunChangeDetection = shouldCoalesceRunChangeDetection;
self.callbackScheduled = false;
self.scheduleInRootZone = scheduleInRootZone;
forkInnerZoneWithAngularBehavior(self);
}
/**
This method checks whether the method call happens within an Angular Zone instance.
*/
static isInAngularZone() {
return typeof Zone !== "undefined" && Zone.current.get(isAngularZoneProperty) === true;
}
/**
Assures that the method is called within the Angular Zone, otherwise throws an error.
*/
static assertInAngularZone() {
if (!_NgZone.isInAngularZone()) {
throw new RuntimeError(909, ngDevMode && "Expected to be in Angular Zone, but it is not!");
}
}
/**
Assures that the method is called outside of the Angular Zone, otherwise throws an error.
*/
static assertNotInAngularZone() {
if (_NgZone.isInAngularZone()) {
throw new RuntimeError(909, ngDevMode && "Expected to not be in Angular Zone, but it is!");
}
}
/**
* Executes the `fn` function synchronously within the Angular zone and returns value returned by
* the function.
*
* Running functions via `run` allows you to reenter Angular zone from a task that was executed
* outside of the Angular zone (typically started via {@link #runOutsideAngular}).
*
* Any future tasks or microtasks scheduled from within this function will continue executing from
* within the Angular zone.
*
* If a synchronous error happens it will be rethrown and not reported via `onError`.
*/
run(fn, applyThis, applyArgs) {
return this._inner.run(fn, applyThis, applyArgs);
}
/**
* Executes the `fn` function synchronously within the Angular zone as a task and returns value
* returned by the function.
*
* Running functions via `runTask` allows you to reenter Angular zone from a task that was executed
* outside of the Angular zone (typically started via {@link #runOutsideAngular}).
*
* Any future tasks or microtasks scheduled from within this function will continue executing from
* within the Angular zone.
*
* If a synchronous error happens it will be rethrown and not reported via `onError`.
*/
runTask(fn, applyThis, applyArgs, name) {
const zone = this._inner;
const task = zone.scheduleEventTask("NgZoneEvent: " + name, fn, EMPTY_PAYLOAD, noop2, noop2);
try {
return zone.runTask(task, applyThis, applyArgs);
} finally {
zone.cancelTask(task);
}
}
/**
* Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not
* rethrown.
*/
runGuarded(fn, applyThis, applyArgs) {
return this._inner.runGuarded(fn, applyThis, applyArgs);
}
/**
* Executes the `fn` function synchronously in Angular's parent zone and returns value returned by
* the function.
*
* Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do
* work that
* doesn't trigger Angular change-detection or is subject to Angular's error handling.
*
* Any future tasks or microtasks scheduled from within this function will continue executing from
* outside of the Angular zone.
*
* Use {@link #run} to reenter the Angular zone and do work that updates the application model.
*/
runOutsideAngular(fn) {
return this._outer.run(fn);
}
};
var EMPTY_PAYLOAD = {};
function checkStable(zone) {
if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {
try {
zone._nesting++;
zone.onMicrotaskEmpty.emit(null);
} finally {
zone._nesting--;
if (!zone.hasPendingMicrotasks) {
try {
zone.runOutsideAngular(() => zone.onStable.emit(null));
} finally {
zone.isStable = true;
}
}
}
}
}
function delayChangeDetectionForEvents(zone) {
if (zone.isCheckStableRunning || zone.callbackScheduled) {
return;
}
zone.callbackScheduled = true;
function scheduleCheckStable() {
scheduleCallbackWithRafRace(() => {
zone.callbackScheduled = false;
updateMicroTaskStatus(zone);
zone.isCheckStableRunning = true;
checkStable(zone);
zone.isCheckStableRunning = false;
});
}
if (zone.scheduleInRootZone) {
Zone.root.run(() => {
scheduleCheckStable();
});
} else {
zone._outer.run(() => {
scheduleCheckStable();
});
}
updateMicroTaskStatus(zone);
}
function forkInnerZoneWithAngularBehavior(zone) {
const delayChangeDetectionForEventsDelegate = () => {
delayChangeDetectionForEvents(zone);
};
const instanceId = ngZoneInstanceId++;
zone._inner = zone._inner.fork({
name: "angular",
properties: {
[isAngularZoneProperty]: true,
[angularZoneInstanceIdProperty]: instanceId,
[angularZoneInstanceIdProperty + instanceId]: true
},
onInvokeTask: (delegate, current, target, task, applyThis, applyArgs) => {
if (shouldBeIgnoredByZone(applyArgs)) {
return delegate.invokeTask(target, task, applyThis, applyArgs);
}
try {
onEnter(zone);
return delegate.invokeTask(target, task, applyThis, applyArgs);
} finally {
if (zone.shouldCoalesceEventChangeDetection && task.type === "eventTask" || zone.shouldCoalesceRunChangeDetection) {
delayChangeDetectionForEventsDelegate();
}
onLeave(zone);
}
},
onInvoke: (delegate, current, target, callback, applyThis, applyArgs, source) => {
try {
onEnter(zone);
return delegate.invoke(target, callback, applyThis, applyArgs, source);
} finally {
if (zone.shouldCoalesceRunChangeDetection && // Do not delay change detection when the task is the scheduler's tick.
// We need to synchronously trigger the stability logic so that the
// zone-based scheduler can prevent a duplicate ApplicationRef.tick
// by first checking if the scheduler tick is running. This does seem a bit roundabout,
// but we _do_ still want to trigger all the correct events when we exit the zone.run
// (`onMicrotaskEmpty` and `onStable` _should_ emit; developers can have code which
// relies on these events happening after change detection runs).
// Note: `zone.callbackScheduled` is already in delayChangeDetectionForEventsDelegate
// but is added here as well to prevent reads of applyArgs when not necessary
!zone.callbackScheduled && !isSchedulerTick(applyArgs)) {
delayChangeDetectionForEventsDelegate();
}
onLeave(zone);
}
},
onHasTask: (delegate, current, target, hasTaskState) => {
delegate.hasTask(target, hasTaskState);
if (current === target) {
if (hasTaskState.change == "microTask") {
zone._hasPendingMicrotasks = hasTaskState.microTask;
updateMicroTaskStatus(zone);
checkStable(zone);
} else if (hasTaskState.change == "macroTask") {
zone.hasPendingMacrotasks = hasTaskState.macroTask;
}
}
},
onHandleError: (delegate, current, target, error) => {
delegate.handleError(target, error);
zone.runOutsideAngular(() => zone.onError.emit(error));
return false;
}
});
}
function updateMicroTaskStatus(zone) {
if (zone._hasPendingMicrotasks || (zone.shouldCoalesceEventChangeDetection || zone.shouldCoalesceRunChangeDetection) && zone.callbackScheduled === true) {
zone.hasPendingMicrotasks = true;
} else {
zone.hasPendingMicrotasks = false;
}
}
function onEnter(zone) {
zone._nesting++;
if (zone.isStable) {
zone.isStable = false;
zone.onUnstable.emit(null);
}
}
function onLeave(zone) {
zone._nesting--;
checkStable(zone);
}
var NoopNgZone = class {
hasPendingMicrotasks = false;
hasPendingMacrotasks = false;
isStable = true;
onUnstable = new EventEmitter();
onMicrotaskEmpty = new EventEmitter();
onStable = new EventEmitter();
onError = new EventEmitter();
run(fn, applyThis, applyArgs) {
return fn.apply(applyThis, applyArgs);
}
runGuarded(fn, applyThis, applyArgs) {
return fn.apply(applyThis, applyArgs);
}
runOutsideAngular(fn) {
return fn();
}
runTask(fn, applyThis, applyArgs, name) {
return fn.apply(applyThis, applyArgs);
}
};
function shouldBeIgnoredByZone(applyArgs) {
return hasApplyArgsData(applyArgs, "__ignore_ng_zone__");
}
function isSchedulerTick(applyArgs) {
return hasApplyArgsData(applyArgs, "__scheduler_tick__");
}
function hasApplyArgsData(applyArgs, key) {
if (!Array.isArray(applyArgs)) {
return false;
}
if (applyArgs.length !== 1) {
return false;
}
return applyArgs[0]?.data?.[key] === true;
}
function getNgZone(ngZoneToUse = "zone.js", options) {
if (ngZoneToUse === "noop") {
return new NoopNgZone();
}
if (ngZoneToUse === "zone.js") {
return new NgZone(options);
}
return ngZoneToUse;
}
var AfterRenderManager = class _AfterRenderManager {
impl = null;
execute() {
this.impl?.execute();
}
/** @nocollapse */
static \u0275prov = (
/** @pureOrBreakMyCode */
/* @__PURE__ */ \u0275\u0275defineInjectable({
token: _AfterRenderManager,
providedIn: "root",
factory: () => new _AfterRenderManager()
})
);
};
var AFTER_RENDER_PHASES = /* @__PURE__ */ (() => [
0,
1,
2,
3
])();
var AfterRenderImpl = class _AfterRenderImpl {
ngZone = inject2(NgZone);
scheduler = inject2(ChangeDetectionScheduler);
errorHandler = inject2(ErrorHandler, { optional: true });
/** Current set of active sequences. */
sequences = /* @__PURE__ */ new Set();
/** Tracks registrations made during the current set of executions. */
deferredRegistrations = /* @__PURE__ */ new Set();
/** Whether the `AfterRenderManager` is currently executing hooks. */
executing = false;
constructor() {
inject2(TracingService, { optional: true });
}
/**
* Run the sequence of phases of hooks, once through. As a result of executing some hooks, more
* might be scheduled.
*/
execute() {
const hasSequencesToExecute = this.sequences.size > 0;
if (hasSequencesToExecute) {
profiler(
16
/* ProfilerEvent.AfterRenderHooksStart */
);
}
this.executing = true;
for (const phase of AFTER_RENDER_PHASES) {
for (const sequence of this.sequences) {
if (sequence.erroredOrDestroyed || !sequence.hooks[phase]) {
continue;
}
try {
sequence.pipelinedValue = this.ngZone.runOutsideAngular(() => this.maybeTrace(() => {
const hookFn = sequence.hooks[phase];
const value = hookFn(sequence.pipelinedValue);
return value;
}, sequence.snapshot));
} catch (err) {
sequence.erroredOrDestroyed = true;
this.errorHandler?.handleError(err);
}
}
}
this.executing = false;
for (const sequence of this.sequences) {
sequence.afterRun();
if (sequence.once) {
this.sequences.delete(sequence);
sequence.destroy();
}
}
for (const sequence of this.deferredRegistrations) {
this.sequences.add(sequence);
}
if (this.deferredRegistrations.size > 0) {
this.scheduler.notify(
7
/* NotificationSource.RenderHook */
);
}
this.deferredRegistrations.clear();
if (hasSequencesToExecute) {
profiler(
17
/* ProfilerEvent.AfterRenderHooksEnd */
);
}
}
register(sequence) {
const { view } = sequence;
if (view !== void 0) {
(view[AFTER_RENDER_SEQUENCES_TO_ADD] ??= []).push(sequence);
markAncestorsForTraversal(view);
view[FLAGS] |= 8192;
} else if (!this.executing) {
this.addSequence(sequence);
} else {
this.deferredRegistrations.add(sequence);
}
}
addSequence(sequence) {
this.sequences.add(sequence);
this.scheduler.notify(
7
/* NotificationSource.RenderHook */
);
}
unregister(sequence) {
if (this.executing && this.sequences.has(sequence)) {
sequence.erroredOrDestroyed = true;
sequence.pipelinedValue = void 0;
sequence.once = true;
} else {
this.sequences.delete(sequence);
this.deferredRegistrations.delete(sequence);
}
}
maybeTrace(fn, snapshot) {
return snapshot ? snapshot.run(TracingAction.AFTER_NEXT_RENDER, fn) : fn();
}
/** @nocollapse */
static \u0275prov = (
/** @pureOrBreakMyCode */
/* @__PURE__ */ \u0275\u0275defineInjectable({
token: _AfterRenderImpl,
providedIn: "root",
factory: () => new _AfterRenderImpl()
})
);
};
var AfterRenderSequence = class {
impl;
hooks;
view;
once;
snapshot;
/**
* Whether this sequence errored or was destroyed during this execution, and hooks should no
* longer run for it.
*/
erroredOrDestroyed = false;
/**
* The value returned by the last hook execution (if any), ready to be pipelined into the next
* one.
*/
pipelinedValue = void 0;
unregisterOnDestroy;
constructor(impl, hooks, view, once, destroyRef, snapshot = null) {
this.impl = impl;
this.hooks = hooks;
this.view = view;
this.once = once;
this.snapshot = snapshot;
this.unregisterOnDestroy = destroyRef?.onDestroy(() => this.destroy());
}
afterRun() {
this.erroredOrDestroyed = false;
this.pipelinedValue = void 0;
this.snapshot?.dispose();
this.snapshot = null;
}
destroy() {
this.impl.unregister(this);
this.unregisterOnDestroy?.();
const scheduled2 = this.view?.[AFTER_RENDER_SEQUENCES_TO_ADD];
if (scheduled2) {
this.view[AFTER_RENDER_SEQUENCES_TO_ADD] = scheduled2.filter((s) => s !== this);
}
}
};
function afterEveryRender(callbackOrSpec, options) {
ngDevMode && assertNotInReactiveContext(afterEveryRender, "Call `afterEveryRender` outside of a reactive context. For example, schedule the render callback inside the component constructor`.");
if (ngDevMode && !options?.injector) {
assertInInjectionContext(afterEveryRender);
}
const injector = options?.injector ?? inject2(Injector);
if (false) {
return NOOP_AFTER_RENDER_REF;
}
performanceMarkFeature("NgAfterRender");
return afterEveryRenderImpl(
callbackOrSpec,
injector,
options,
/* once */
false
);
}
function afterNextRender(callbackOrSpec, options) {
if (ngDevMode && !options?.injector) {
assertInInjectionContext(afterNextRender);
}
const injector = options?.injector ?? inject2(Injector);
if (false) {
return NOOP_AFTER_RENDER_REF;
}
performanceMarkFeature("NgAfterNextRender");
return afterEveryRenderImpl(
callbackOrSpec,
injector,
options,
/* once */
true
);
}
function getHooks(callbackOrSpec) {
if (callbackOrSpec instanceof Function) {
return [
void 0,
void 0,
/* MixedReadWrite */
callbackOrSpec,
void 0
];
} else {
return [
callbackOrSpec.earlyRead,
callbackOrSpec.write,
callbackOrSpec.mixedReadWrite,
callbackOrSpec.read
];
}
}
function afterEveryRenderImpl(callbackOrSpec, injector, options, once) {
const manager = injector.get(AfterRenderManager);
manager.impl ??= injector.get(AfterRenderImpl);
const tracing = injector.get(TracingService, null, { optional: true });
const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;
const viewContext = injector.get(ViewContext, null, { optional: true });
const sequence = new AfterRenderSequence(manager.impl, getHooks(callbackOrSpec), viewContext?.view, once, destroyRef, tracing?.snapshot(null));
manager.impl.register(sequence);
return sequence;
}
function getDeferBlockDataIndex(deferBlockIndex) {
return deferBlockIndex + 1;
}
function getLDeferBlockDetails(lView, tNode) {
const tView = lView[TVIEW];
const slotIndex = getDeferBlockDataIndex(tNode.index);
ngDevMode && assertIndexInDeclRange(tView, slotIndex);
return lView[slotIndex];
}
function setLDeferBlockDetails(lView, deferBlockIndex, lDetails) {
const tView = lView[TVIEW];
const slotIndex = getDeferBlockDataIndex(deferBlockIndex);
ngDevMode && assertIndexInDeclRange(tView, slotIndex);
lView[slotIndex] = lDetails;
}
function getTDeferBlockDetails(tView, tNode) {
const slotIndex = getDeferBlockDataIndex(tNode.index);
ngDevMode && assertIndexInDeclRange(tView, slotIndex);
return tView.data[slotIndex];
}
function setTDeferBlockDetails(tView, deferBlockIndex, deferBlockConfig) {
const slotIndex = getDeferBlockDataIndex(deferBlockIndex);
ngDevMode && assertIndexInDeclRange(tView, slotIndex);
tView.data[slotIndex] = deferBlockConfig;
}
function getTemplateIndexForState(newState, hostLView, tNode) {
const tView = hostLView[TVIEW];
const tDetails = getTDeferBlockDetails(tView, tNode);
switch (newState) {
case DeferBlockState.Complete:
return tDetails.primaryTmplIndex;
case DeferBlockState.Loading:
return tDetails.loadingTmplIndex;
case DeferBlockState.Error:
return tDetails.errorTmplIndex;
case DeferBlockState.Placeholder:
return tDetails.placeholderTmplIndex;
default:
ngDevMode && throwError2(`Unexpected defer block state: ${newState}`);
return null;
}
}
function getMinimumDurationForState(tDetails, currentState) {
if (currentState === DeferBlockState.Placeholder) {
return tDetails.placeholderBlockConfig?.[MINIMUM_SLOT] ?? null;
} else if (currentState === DeferBlockState.Loading) {
return tDetails.loadingBlockConfig?.[MINIMUM_SLOT] ?? null;
}
return null;
}
function getLoadingBlockAfter(tDetails) {
return tDetails.loadingBlockConfig?.[LOADING_AFTER_SLOT] ?? null;
}
function addDepsToRegistry(currentDeps, newDeps) {
if (!currentDeps || currentDeps.length === 0) {
return newDeps;
}
const currentDepSet = new Set(currentDeps);
for (const dep of newDeps) {
currentDepSet.add(dep);
}
return currentDeps.length === currentDepSet.size ? currentDeps : Array.from(currentDepSet);
}
function getPrimaryBlockTNode(tView, tDetails) {
const adjustedIndex = tDetails.primaryTmplIndex + HEADER_OFFSET;
return getTNode(tView, adjustedIndex);
}
function assertDeferredDependenciesLoaded(tDetails) {
assertEqual(tDetails.loadingState, DeferDependenciesLoadingState.COMPLETE, "Expecting all deferred dependencies to be loaded.");
}
function isTDeferBlockDetails(value) {
return value !== null && typeof value === "object" && typeof value.primaryTmplIndex === "number";
}
function trackTriggerForDebugging(tView, tNode, textRepresentation) {
const tDetails = getTDeferBlockDetails(tView, tNode);
tDetails.debug ??= {};
tDetails.debug.triggers ??= /* @__PURE__ */ new Set();
tDetails.debug.triggers.add(textRepresentation);
}
function onViewportWrapper(trigger, callback, injector) {
const ngZone = injector.get(NgZone);
return onViewport(trigger, () => ngZone.run(callback), () => ngZone.runOutsideAngular(() => createIntersectionObserver()));
}
function getTriggerLView(deferredHostLView, deferredTNode, walkUpTimes) {
if (walkUpTimes == null) {
return deferredHostLView;
}
if (walkUpTimes >= 0) {
return walkUpViews(walkUpTimes, deferredHostLView);
}
const deferredContainer = deferredHostLView[deferredTNode.index];
ngDevMode && assertLContainer(deferredContainer);
const triggerLView = deferredContainer[CONTAINER_HEADER_OFFSET] ?? null;
if (ngDevMode && triggerLView !== null) {
const lDetails = getLDeferBlockDetails(deferredHostLView, deferredTNode);
const renderedState = lDetails[DEFER_BLOCK_STATE];
assertEqual(renderedState, DeferBlockState.Placeholder, "Expected a placeholder to be rendered in this defer block.");
assertLView(triggerLView);
}
return triggerLView;
}
function getTriggerElement(triggerLView, triggerIndex) {
const element = getNativeByIndex(HEADER_OFFSET + triggerIndex, triggerLView);
ngDevMode && assertElement(element);
return element;
}
function registerDomTrigger(initialLView, tNode, triggerIndex, walkUpTimes, registerFn, callback, type) {
const injector = initialLView[INJECTOR];
const zone = injector.get(NgZone);
let poll;
function pollDomTrigger() {
if (isDestroyed(initialLView)) {
poll.destroy();
return;
}
const lDetails = getLDeferBlockDetails(initialLView, tNode);
const renderedState = lDetails[DEFER_BLOCK_STATE];
if (renderedState !== DeferBlockInternalState.Initial && renderedState !== DeferBlockState.Placeholder) {
poll.destroy();
return;
}
const triggerLView = getTriggerLView(initialLView, tNode, walkUpTimes);
if (!triggerLView) {
return;
}
poll.destroy();
if (isDestroyed(triggerLView)) {
return;
}
const element = getTriggerElement(triggerLView, triggerIndex);
const cleanup = registerFn(element, () => {
zone.run(() => {
if (initialLView !== triggerLView) {
removeLViewOnDestroy(triggerLView, cleanup);
}
callback();
});
}, injector);
if (initialLView !== triggerLView) {
storeLViewOnDestroy(triggerLView, cleanup);
}
storeTriggerCleanupFn(type, lDetails, cleanup);
}
poll = afterEveryRender({ read: pollDomTrigger }, { injector });
}
function onIdle(callback, injector) {
const scheduler = injector.get(IdleScheduler);
const cleanupFn = () => scheduler.remove(callback);
scheduler.add(callback);
return cleanupFn;
}
var _requestIdleCallback = () => typeof requestIdleCallback !== "undefined" ? requestIdleCallback : setTimeout;
var _cancelIdleCallback = () => typeof requestIdleCallback !== "undefined" ? cancelIdleCallback : clearTimeout;
var IdleScheduler = class _IdleScheduler {
// Indicates whether current callbacks are being invoked.
executingCallbacks = false;
// Currently scheduled idle callback id.
idleId = null;
// Set of callbacks to be invoked next.
current = /* @__PURE__ */ new Set();
// Set of callbacks collected while invoking current set of callbacks.
// Those callbacks are scheduled for the next idle period.
deferred = /* @__PURE__ */ new Set();
ngZone = inject2(NgZone);
requestIdleCallbackFn = _requestIdleCallback().bind(globalThis);
cancelIdleCallbackFn = _cancelIdleCallback().bind(globalThis);
add(callback) {
const target = this.executingCallbacks ? this.deferred : this.current;
target.add(callback);
if (this.idleId === null) {
this.scheduleIdleCallback();
}
}
remove(callback) {
const { current, deferred } = this;
current.delete(callback);
deferred.delete(callback);
if (current.size === 0 && deferred.size === 0) {
this.cancelIdleCallback();
}
}
scheduleIdleCallback() {
const callback = () => {
this.cancelIdleCallback();
this.executingCallbacks = true;
for (const callback2 of this.current) {
callback2();
}
this.current.clear();
this.executingCallbacks = false;
if (this.deferred.size > 0) {
for (const callback2 of this.deferred) {
this.current.add(callback2);
}
this.deferred.clear();
this.scheduleIdleCallback();
}
};
this.idleId = this.requestIdleCallbackFn(() => this.ngZone.run(callback));
}
cancelIdleCallback() {
if (this.idleId !== null) {
this.cancelIdleCallbackFn(this.idleId);
this.idleId = null;
}
}
ngOnDestroy() {
this.cancelIdleCallback();
this.current.clear();
this.deferred.clear();
}
/** @nocollapse */
static \u0275prov = (
/** @pureOrBreakMyCode */
/* @__PURE__ */ \u0275\u0275defineInjectable({
token: _IdleScheduler,
providedIn: "root",
factory: () => new _IdleScheduler()
})
);
};
function onTimer(delay) {
return (callback, injector) => scheduleTimerTrigger(delay, callback, injector);
}
function scheduleTimerTrigger(delay, callback, injector) {
const scheduler = injector.get(TimerScheduler);
const ngZone = injector.get(NgZone);
const cleanupFn = () => scheduler.remove(callback);
scheduler.add(delay, callback, ngZone);
return cleanupFn;
}
var TimerScheduler = class _TimerScheduler {
// Indicates whether current callbacks are being invoked.
executingCallbacks = false;
// Currently scheduled `setTimeout` id.
timeoutId = null;
// When currently scheduled timer would fire.
invokeTimerAt = null;
// List of callbacks to be invoked.
// For each callback we also store a timestamp on when the callback
// should be invoked. We store timestamps and callback functions
// in a flat array to avoid creating new objects for each entry.
// [timestamp1, callback1, timestamp2, callback2, ...]
current = [];
// List of callbacks collected while invoking current set of callbacks.
// Those callbacks are added to the "current" queue at the end of
// the current callback invocation. The shape of this list is the same
// as the shape of the `current` list.
deferred = [];
add(delay, callback, ngZone) {
const target = this.executingCallbacks ? this.deferred : this.current;
this.addToQueue(target, Date.now() + delay, callback);
this.scheduleTimer(ngZone);
}
remove(callback) {
const { current, deferred } = this;
const callbackIndex = this.removeFromQueue(current, callback);
if (callbackIndex === -1) {
this.removeFromQueue(deferred, callback);
}
if (current.length === 0 && deferred.length === 0) {
this.clearTimeout();
}
}
addToQueue(target, invokeAt, callback) {
let insertAtIndex = target.length;
for (let i = 0; i < target.length; i += 2) {
const invokeQueuedCallbackAt = target[i];
if (invokeQueuedCallbackAt > invokeAt) {
insertAtIndex = i;
break;
}
}
arrayInsert2(target, insertAtIndex, invokeAt, callback);
}
removeFromQueue(target, callback) {
let index = -1;
for (let i = 0; i < target.length; i += 2) {
const queuedCallback = target[i + 1];
if (queuedCallback === callback) {
index = i;
break;
}
}
if (index > -1) {
arraySplice(target, index, 2);
}
return index;
}
scheduleTimer(ngZone) {
const callback = () => {
this.clearTimeout();
this.executingCallbacks = true;
const current = [...this.current];
const now = Date.now();
for (let i = 0; i < current.length; i += 2) {
const invokeAt = current[i];
const callback2 = current[i + 1];
if (invokeAt <= now) {
callback2();
} else {
break;
}
}
let lastCallbackIndex = -1;
for (let i = 0; i < this.current.length; i += 2) {
const invokeAt = this.current[i];
if (invokeAt <= now) {
lastCallbackIndex = i + 1;
} else {
break;
}
}
if (lastCallbackIndex >= 0) {
arraySplice(this.current, 0, lastCallbackIndex + 1);
}
this.executingCallbacks = false;
if (this.deferred.length > 0) {
for (let i = 0; i < this.deferred.length; i += 2) {
const invokeAt = this.deferred[i];
const callback2 = this.deferred[i + 1];
this.addToQueue(this.current, invokeAt, callback2);
}
this.deferred.length = 0;
}
this.scheduleTimer(ngZone);
};
const FRAME_DURATION_MS = 16;
if (this.current.length > 0) {
const now = Date.now();
const invokeAt = this.current[0];
if (this.timeoutId === null || // Reschedule a timer in case a queue contains an item with
// an earlier timestamp and the delta is more than an average
// frame duration.
this.invokeTimerAt && this.invokeTimerAt - invokeAt > FRAME_DURATION_MS) {
this.clearTimeout();
const timeout = Math.max(invokeAt - now, FRAME_DURATION_MS);
this.invokeTimerAt = invokeAt;
this.timeoutId = ngZone.runOutsideAngular(() => {
return setTimeout(() => ngZone.run(callback), timeout);
});
}
}
}
clearTimeout() {
if (this.timeoutId !== null) {
clearTimeout(this.timeoutId);
this.timeoutId = null;
}
}
ngOnDestroy() {
this.clearTimeout();
this.current.length = 0;
this.deferred.length = 0;
}
/** @nocollapse */
static \u0275prov = (
/** @pureOrBreakMyCode */
/* @__PURE__ */ \u0275\u0275defineInjectable({
token: _TimerScheduler,
providedIn: "root",
factory: () => new _TimerScheduler()
})
);
};
var CachedInjectorService = class _CachedInjectorService {
cachedInjectors = /* @__PURE__ */ new Map();
getOrCreateInjector(key, parentInjector, providers, debugName) {
if (!this.cachedInjectors.has(key)) {
const injector = providers.length > 0 ? createEnvironmentInjector(providers, parentInjector, debugName) : null;
this.cachedInjectors.set(key, injector);
}
return this.cachedInjectors.get(key);
}
ngOnDestroy() {
try {
for (const injector of this.cachedInjectors.values()) {
if (injector !== null) {
injector.destroy();
}
}
} finally {
this.cachedInjectors.clear();
}
}
/** @nocollapse */
static \u0275prov = (
/** @pureOrBreakMyCode */
/* @__PURE__ */ \u0275\u0275defineInjectable({
token: _CachedInjectorService,
providedIn: "environment",
factory: () => new _CachedInjectorService()
})
);
};
var DEFER_BLOCK_DEPENDENCY_INTERCEPTOR = /* @__PURE__ */ new InjectionToken("DEFER_BLOCK_DEPENDENCY_INTERCEPTOR");
var DEFER_BLOCK_CONFIG = new InjectionToken(ngDevMode ? "DEFER_BLOCK_CONFIG" : "");
function getOrCreateEnvironmentInjector(parentInjector, tDetails, providers) {
return parentInjector.get(CachedInjectorService).getOrCreateInjector(tDetails, parentInjector, providers, ngDevMode ? "DeferBlock Injector" : "");
}
function createDeferBlockInjector(parentInjector, tDetails, providers) {
if (parentInjector instanceof ChainedInjector) {
const origInjector = parentInjector.injector;
const parentEnvInjector2 = parentInjector.parentInjector;
const envInjector = getOrCreateEnvironmentInjector(parentEnvInjector2, tDetails, providers);
return new ChainedInjector(origInjector, envInjector);
}
const parentEnvInjector = parentInjector.get(EnvironmentInjector);
if (parentEnvInjector !== parentInjector) {
const envInjector = getOrCreateEnvironmentInjector(parentEnvInjector, tDetails, providers);
return new ChainedInjector(parentInjector, envInjector);
}
return getOrCreateEnvironmentInjector(parentInjector, tDetails, providers);
}
function renderDeferBlockState(newState, tNode, lContainer, skipTimerScheduling = false) {
const hostLView = lContainer[PARENT];
const hostTView = hostLView[TVIEW];
if (isDestroyed(hostLView))
return;
ngDevMode && assertTNodeForLView(tNode, hostLView);
const lDetails = getLDeferBlockDetails(hostLView, tNode);
ngDevMode && assertDefined(lDetails, "Expected a defer block state defined");
const currentState = lDetails[DEFER_BLOCK_STATE];
const ssrState = lDetails[SSR_BLOCK_STATE];
if (ssrState !== null && newState < ssrState) {
return;
}
if (isValidStateChange(currentState, newState) && isValidStateChange(lDetails[NEXT_DEFER_BLOCK_STATE] ?? -1, newState)) {
const tDetails = getTDeferBlockDetails(hostTView, tNode);
const needsScheduling = !skipTimerScheduling && true && (getLoadingBlockAfter(tDetails) !== null || getMinimumDurationForState(tDetails, DeferBlockState.Loading) !== null || getMinimumDurationForState(tDetails, DeferBlockState.Placeholder));
if (ngDevMode && needsScheduling) {
assertDefined(applyDeferBlockStateWithSchedulingImpl, "Expected scheduling function to be defined");
}
const applyStateFn = needsScheduling ? applyDeferBlockStateWithSchedulingImpl : applyDeferBlockState;
try {
applyStateFn(newState, lDetails, lContainer, tNode, hostLView);
} catch (error) {
handleUncaughtError(hostLView, error);
}
}
}
function findMatchingDehydratedViewForDeferBlock(lContainer, lDetails) {
const dehydratedViewIx = lContainer[DEHYDRATED_VIEWS]?.findIndex((view) => view.data[DEFER_BLOCK_STATE$1] === lDetails[DEFER_BLOCK_STATE]) ?? -1;
const dehydratedView = dehydratedViewIx > -1 ? lContainer[DEHYDRATED_VIEWS][dehydratedViewIx] : null;
return { dehydratedView, dehydratedViewIx };
}
function applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView) {
profiler(
20
/* ProfilerEvent.DeferBlockStateStart */
);
const stateTmplIndex = getTemplateIndexForState(newState, hostLView, tNode);
if (stateTmplIndex !== null) {
lDetails[DEFER_BLOCK_STATE] = newState;
const hostTView = hostLView[TVIEW];
const adjustedIndex = stateTmplIndex + HEADER_OFFSET;
const activeBlockTNode = getTNode(hostTView, adjustedIndex);
const viewIndex = 0;
removeLViewFromLContainer(lContainer, viewIndex);
let injector;
if (newState === DeferBlockState.Complete) {
const tDetails = getTDeferBlockDetails(hostTView, tNode);
const providers = tDetails.providers;
if (providers && providers.length > 0) {
injector = createDeferBlockInjector(hostLView[INJECTOR], tDetails, providers);
}
}
const { dehydratedView, dehydratedViewIx } = findMatchingDehydratedViewForDeferBlock(lContainer, lDetails);
const embeddedLView = createAndRenderEmbeddedLView(hostLView, activeBlockTNode, null, {
injector,
dehydratedView
});
addLViewToLContainer(lContainer, embeddedLView, viewIndex, shouldAddViewToDom(activeBlockTNode, dehydratedView));
markViewDirty(
embeddedLView,
2
/* NotificationSource.DeferBlockStateUpdate */
);
if (dehydratedViewIx > -1) {
lContainer[DEHYDRATED_VIEWS]?.splice(dehydratedViewIx, 1);
}
if ((newState === DeferBlockState.Complete || newState === DeferBlockState.Error) && Array.isArray(lDetails[ON_COMPLETE_FNS])) {
for (const callback of lDetails[ON_COMPLETE_FNS]) {
callback();
}
lDetails[ON_COMPLETE_FNS] = null;
}
}
profiler(
21
/* ProfilerEvent.DeferBlockStateEnd */
);
}
function applyDeferBlockStateWithScheduling(newState, lDetails, lContainer, tNode, hostLView) {
const now = Date.now();
const hostTView = hostLView[TVIEW];
const tDetails = getTDeferBlockDetails(hostTView, tNode);
if (lDetails[STATE_IS_FROZEN_UNTIL] === null || lDetails[STATE_IS_FROZEN_UNTIL] <= now) {
lDetails[STATE_IS_FROZEN_UNTIL] = null;
const loadingAfter = getLoadingBlockAfter(tDetails);
const inLoadingAfterPhase = lDetails[LOADING_AFTER_CLEANUP_FN] !== null;
if (newState === DeferBlockState.Loading && loadingAfter !== null && !inLoadingAfterPhase) {
lDetails[NEXT_DEFER_BLOCK_STATE] = newState;
const cleanupFn = scheduleDeferBlockUpdate(loadingAfter, lDetails, tNode, lContainer, hostLView);
lDetails[LOADING_AFTER_CLEANUP_FN] = cleanupFn;
} else {
if (newState > DeferBlockState.Loading && inLoadingAfterPhase) {
lDetails[LOADING_AFTER_CLEANUP_FN]();
lDetails[LOADING_AFTER_CLEANUP_FN] = null;
lDetails[NEXT_DEFER_BLOCK_STATE] = null;
}
applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView);
const duration = getMinimumDurationForState(tDetails, newState);
if (duration !== null) {
lDetails[STATE_IS_FROZEN_UNTIL] = now + duration;
scheduleDeferBlockUpdate(duration, lDetails, tNode, lContainer, hostLView);
}
}
} else {
lDetails[NEXT_DEFER_BLOCK_STATE] = newState;
}
}
function scheduleDeferBlockUpdate(timeout, lDetails, tNode, lContainer, hostLView) {
const callback = () => {
const nextState = lDetails[NEXT_DEFER_BLOCK_STATE];
lDetails[STATE_IS_FROZEN_UNTIL] = null;
lDetails[NEXT_DEFER_BLOCK_STATE] = null;
if (nextState !== null) {
renderDeferBlockState(nextState, tNode, lContainer);
}
};
return scheduleTimerTrigger(timeout, callback, hostLView[INJECTOR]);
}
function isValidStateChange(currentState, newState) {
return currentState < newState;
}
function renderPlaceholder(lView, tNode) {
const lContainer = lView[tNode.index];
ngDevMode && assertLContainer(lContainer);
renderDeferBlockState(DeferBlockState.Placeholder, tNode, lContainer);
}
function renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer) {
ngDevMode && assertDefined(tDetails.loadingPromise, "Expected loading Promise to exist on this defer block");
tDetails.loadingPromise.then(() => {
if (tDetails.loadingState === DeferDependenciesLoadingState.COMPLETE) {
ngDevMode && assertDeferredDependenciesLoaded(tDetails);
renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer);
} else if (tDetails.loadingState === DeferDependenciesLoadingState.FAILED) {
renderDeferBlockState(DeferBlockState.Error, tNode, lContainer);
}
});
}
var applyDeferBlockStateWithSchedulingImpl = null;
function \u0275\u0275deferEnableTimerScheduling(tView, tDetails, placeholderConfigIndex, loadingConfigIndex) {
const tViewConsts = tView.consts;
if (placeholderConfigIndex != null) {
tDetails.placeholderBlockConfig = getConstant(tViewConsts, placeholderConfigIndex);
}
if (loadingConfigIndex != null) {
tDetails.loadingBlockConfig = getConstant(tViewConsts, loadingConfigIndex);
}
if (applyDeferBlockStateWithSchedulingImpl === null) {
applyDeferBlockStateWithSchedulingImpl = applyDeferBlockStateWithScheduling;
}
}
function setClassMetadata(type, decorators, ctorParameters, propDecorators) {
return noSideEffects(() => {
const clazz = type;
if (decorators !== null) {
if (clazz.hasOwnProperty("decorators") && clazz.decorators !== void 0) {
clazz.decorators.push(...decorators);
} else {
clazz.decorators = decorators;
}
}
if (ctorParameters !== null) {
clazz.ctorParameters = ctorParameters;
}
if (propDecorators !== null) {
if (clazz.hasOwnProperty("propDecorators") && clazz.propDecorators !== void 0) {
clazz.propDecorators = __spreadValues(__spreadValues({}, clazz.propDecorators), propDecorators);
} else {
clazz.propDecorators = propDecorators;
}
}
});
}
var Console = class _Console {
log(message) {
console.log(message);
}
// Note: for reporting errors use `DOM.logError()` as it is platform specific
warn(message) {
console.warn(message);
}
static \u0275fac = function Console_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _Console)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _Console, factory: _Console.\u0275fac, providedIn: "platform" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Console, [{
type: Injectable,
args: [{ providedIn: "platform" }]
}], null, null);
})();
var DIDebugData = class {
resolverToTokenToDependencies = /* @__PURE__ */ new WeakMap();
resolverToProviders = /* @__PURE__ */ new WeakMap();
resolverToEffects = /* @__PURE__ */ new WeakMap();
standaloneInjectorToComponent = /* @__PURE__ */ new WeakMap();
reset() {
this.resolverToTokenToDependencies = /* @__PURE__ */ new WeakMap();
this.resolverToProviders = /* @__PURE__ */ new WeakMap();
this.standaloneInjectorToComponent = /* @__PURE__ */ new WeakMap();
}
};
var frameworkDIDebugData = new DIDebugData();
function getFrameworkDIDebugData() {
return frameworkDIDebugData;
}
function setupFrameworkInjectorProfiler() {
frameworkDIDebugData.reset();
setInjectorProfiler(injectorProfilerEventHandler);
}
function injectorProfilerEventHandler(injectorProfilerEvent) {
const { context: context2, type } = injectorProfilerEvent;
if (type === 0) {
handleInjectEvent(context2, injectorProfilerEvent.service);
} else if (type === 1) {
handleInstanceCreatedByInjectorEvent(context2, injectorProfilerEvent.instance);
} else if (type === 2) {
handleProviderConfiguredEvent(context2, injectorProfilerEvent.providerRecord);
} else if (type === 3) {
handleEffectCreatedEvent(context2, injectorProfilerEvent.effect);
}
}
function handleEffectCreatedEvent(context2, effect2) {
const diResolver = getDIResolver(context2.injector);
if (diResolver === null) {
throwError2("An EffectCreated event must be run within an injection context.");
}
const { resolverToEffects } = frameworkDIDebugData;
if (!resolverToEffects.has(diResolver)) {
resolverToEffects.set(diResolver, []);
}
resolverToEffects.get(diResolver).push(effect2);
}
function handleInjectEvent(context2, data) {
const diResolver = getDIResolver(context2.injector);
if (diResolver === null) {
throwError2("An Inject event must be run within an injection context.");
}
const diResolverToInstantiatedToken = frameworkDIDebugData.resolverToTokenToDependencies;
if (!diResolverToInstantiatedToken.has(diResolver)) {
diResolverToInstantiatedToken.set(diResolver, /* @__PURE__ */ new WeakMap());
}
if (!canBeHeldWeakly(context2.token)) {
return;
}
const instantiatedTokenToDependencies = diResolverToInstantiatedToken.get(diResolver);
if (!instantiatedTokenToDependencies.has(context2.token)) {
instantiatedTokenToDependencies.set(context2.token, []);
}
const { token, value, flags } = data;
assertDefined(context2.token, "Injector profiler context token is undefined.");
const dependencies = instantiatedTokenToDependencies.get(context2.token);
assertDefined(dependencies, "Could not resolve dependencies for token.");
if (context2.injector instanceof NodeInjector) {
dependencies.push({ token, value, flags, injectedIn: getNodeInjectorContext(context2.injector) });
} else {
dependencies.push({ token, value, flags });
}
}
function getNodeInjectorContext(injector) {
if (!(injector instanceof NodeInjector)) {
throwError2("getNodeInjectorContext must be called with a NodeInjector");
}
const lView = getNodeInjectorLView(injector);
const tNode = getNodeInjectorTNode(injector);
if (tNode === null) {
return;
}
assertTNodeForLView(tNode, lView);
return { lView, tNode };
}
function handleInstanceCreatedByInjectorEvent(context2, data) {
const { value } = data;
if (data.value == null) {
return;
}
if (getDIResolver(context2.injector) === null) {
throwError2("An InjectorCreatedInstance event must be run within an injection context.");
}
let standaloneComponent = void 0;
if (typeof value === "object") {
standaloneComponent = value?.constructor;
}
if (standaloneComponent == void 0 || !isStandaloneComponent(standaloneComponent)) {
return;
}
const environmentInjector = context2.injector.get(EnvironmentInjector, null, { optional: true });
if (environmentInjector === null) {
return;
}
const { standaloneInjectorToComponent } = frameworkDIDebugData;
if (standaloneInjectorToComponent.has(environmentInjector)) {
return;
}
standaloneInjectorToComponent.set(environmentInjector, standaloneComponent);
}
function isStandaloneComponent(value) {
const def = getComponentDef(value);
return !!def?.standalone;
}
function handleProviderConfiguredEvent(context2, data) {
const { resolverToProviders } = frameworkDIDebugData;
let diResolver;
if (context2?.injector instanceof NodeInjector) {
diResolver = getNodeInjectorTNode(context2.injector);
} else {
diResolver = context2.injector;
}
if (diResolver === null) {
throwError2("A ProviderConfigured event must be run within an injection context.");
}
if (!resolverToProviders.has(diResolver)) {
resolverToProviders.set(diResolver, []);
}
resolverToProviders.get(diResolver).push(data);
}
function getDIResolver(injector) {
let diResolver = null;
if (injector === void 0) {
return diResolver;
}
if (injector instanceof NodeInjector) {
diResolver = getNodeInjectorLView(injector);
} else {
diResolver = injector;
}
return diResolver;
}
function canBeHeldWeakly(value) {
return value !== null && (typeof value === "object" || typeof value === "function" || typeof value === "symbol");
}
function applyChanges(component) {
ngDevMode && assertDefined(component, "component");
markViewDirty(
getComponentViewByInstance(component),
3
/* NotificationSource.DebugApplyChanges */
);
getRootComponents(component).forEach((rootComponent) => detectChanges(rootComponent));
}
function detectChanges(component) {
const view = getComponentViewByInstance(component);
view[FLAGS] |= 1024;
detectChangesInternal(view);
}
function getDeferBlocks$1(lView, deferBlocks) {
const tView = lView[TVIEW];
for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {
if (isLContainer(lView[i])) {
const lContainer = lView[i];
const isLast = i === tView.bindingStartIndex - 1;
if (!isLast) {
const tNode = tView.data[i];
const tDetails = getTDeferBlockDetails(tView, tNode);
if (isTDeferBlockDetails(tDetails)) {
deferBlocks.push({ lContainer, lView, tNode, tDetails });
continue;
}
}
if (isLView(lContainer[HOST])) {
getDeferBlocks$1(lContainer[HOST], deferBlocks);
}
for (let j = CONTAINER_HEADER_OFFSET; j < lContainer.length; j++) {
getDeferBlocks$1(lContainer[j], deferBlocks);
}
} else if (isLView(lView[i])) {
getDeferBlocks$1(lView[i], deferBlocks);
}
}
}
function getDeferBlocks(node) {
const results = [];
const lView = getLContext(node)?.lView;
if (lView) {
findDeferBlocks(node, lView, results);
}
return results;
}
function findDeferBlocks(node, lView, results) {
const viewInjector = lView[INJECTOR];
const registry2 = viewInjector.get(DEHYDRATED_BLOCK_REGISTRY, null, { optional: true });
const blocks = [];
getDeferBlocks$1(lView, blocks);
const transferState = viewInjector.get(TransferState);
const deferBlockParents = transferState.get(NGH_DEFER_BLOCKS_KEY, {});
for (const details of blocks) {
const native = getNativeByTNode(details.tNode, details.lView);
const lDetails = getLDeferBlockDetails(details.lView, details.tNode);
if (!node.contains(native)) {
continue;
}
const tDetails = details.tDetails;
const renderedLView = getRendererLView(details);
const rootNodes = [];
const hydrationState = inferHydrationState(tDetails, lDetails, registry2);
if (renderedLView !== null) {
collectNativeNodes(renderedLView[TVIEW], renderedLView, renderedLView[TVIEW].firstChild, rootNodes);
} else if (hydrationState === "dehydrated") {
const deferId = lDetails[SSR_UNIQUE_ID];
const deferData = deferBlockParents[deferId];
const numberOfRootNodes = deferData[NUM_ROOT_NODES];
let collectedNodeCount = 0;
const deferBlockCommentNode = details.lContainer[NATIVE];
let currentNode = deferBlockCommentNode.previousSibling;
while (collectedNodeCount < numberOfRootNodes && currentNode) {
rootNodes.unshift(currentNode);
currentNode = currentNode.previousSibling;
collectedNodeCount++;
}
}
const data = {
state: stringifyState(lDetails[DEFER_BLOCK_STATE]),
incrementalHydrationState: hydrationState,
hasErrorBlock: tDetails.errorTmplIndex !== null,
loadingBlock: {
exists: tDetails.loadingTmplIndex !== null,
minimumTime: tDetails.loadingBlockConfig?.[MINIMUM_SLOT] ?? null,
afterTime: tDetails.loadingBlockConfig?.[LOADING_AFTER_SLOT] ?? null
},
placeholderBlock: {
exists: tDetails.placeholderTmplIndex !== null,
minimumTime: tDetails.placeholderBlockConfig?.[MINIMUM_SLOT] ?? null
},
triggers: tDetails.debug?.triggers ? Array.from(tDetails.debug.triggers).sort() : [],
rootNodes
};
results.push(data);
if (renderedLView !== null) {
findDeferBlocks(node, renderedLView, results);
}
}
}
function stringifyState(state) {
switch (state) {
case DeferBlockState.Complete:
return "complete";
case DeferBlockState.Loading:
return "loading";
case DeferBlockState.Placeholder:
return "placeholder";
case DeferBlockState.Error:
return "error";
case DeferBlockInternalState.Initial:
return "initial";
default:
throw new Error(`Unrecognized state ${state}`);
}
}
function inferHydrationState(tDetails, lDetails, registry2) {
if (registry2 === null || lDetails[SSR_UNIQUE_ID] === null || tDetails.hydrateTriggers === null || tDetails.hydrateTriggers.has(
7
/* DeferBlockTrigger.Never */
)) {
return "not-configured";
}
return registry2.has(lDetails[SSR_UNIQUE_ID]) ? "dehydrated" : "hydrated";
}
function getRendererLView(details) {
if (details.lContainer.length <= CONTAINER_HEADER_OFFSET) {
return null;
}
const lView = details.lContainer[CONTAINER_HEADER_OFFSET];
ngDevMode && assertLView(lView);
return lView;
}
function getDependenciesFromInjectable(injector, token) {
const instance = injector.get(token, null, { self: true, optional: true });
if (instance === null) {
throw new Error(`Unable to determine instance of ${token} in given injector`);
}
const unformattedDependencies = getDependenciesForTokenInInjector(token, injector);
const resolutionPath = getInjectorResolutionPath(injector);
const dependencies = unformattedDependencies.map((dep) => {
const formattedDependency = {
value: dep.value
};
const flags = dep.flags;
formattedDependency.flags = {
optional: (8 & flags) === 8,
host: (1 & flags) === 1,
self: (2 & flags) === 2,
skipSelf: (4 & flags) === 4
};
for (let i = 0; i < resolutionPath.length; i++) {
const injectorToCheck = resolutionPath[i];
if (i === 0 && formattedDependency.flags.skipSelf) {
continue;
}
if (formattedDependency.flags.host && injectorToCheck instanceof EnvironmentInjector) {
break;
}
const instance2 = injectorToCheck.get(dep.token, null, {
self: true,
optional: true
});
if (instance2 !== null) {
if (formattedDependency.flags.host) {
const firstInjector = resolutionPath[0];
const lookupFromFirstInjector = firstInjector.get(dep.token, null, __spreadProps(__spreadValues({}, formattedDependency.flags), {
optional: true
}));
if (lookupFromFirstInjector !== null) {
formattedDependency.providedIn = injectorToCheck;
}
break;
}
formattedDependency.providedIn = injectorToCheck;
break;
}
if (i === 0 && formattedDependency.flags.self) {
break;
}
}
if (dep.token)
formattedDependency.token = dep.token;
return formattedDependency;
});
return { instance, dependencies };
}
function getDependenciesForTokenInInjector(token, injector) {
const { resolverToTokenToDependencies } = getFrameworkDIDebugData();
if (!(injector instanceof NodeInjector)) {
return resolverToTokenToDependencies.get(injector)?.get?.(token) ?? [];
}
const lView = getNodeInjectorLView(injector);
const tokenDependencyMap = resolverToTokenToDependencies.get(lView);
const dependencies = tokenDependencyMap?.get(token) ?? [];
return dependencies.filter((dependency) => {
const dependencyNode = dependency.injectedIn?.tNode;
if (dependencyNode === void 0) {
return false;
}
const instanceNode = getNodeInjectorTNode(injector);
assertTNode(dependencyNode);
assertTNode(instanceNode);
return dependencyNode === instanceNode;
});
}
function getProviderImportsContainer(injector) {
const { standaloneInjectorToComponent } = getFrameworkDIDebugData();
if (standaloneInjectorToComponent.has(injector)) {
return standaloneInjectorToComponent.get(injector);
}
const defTypeRef = injector.get(NgModuleRef$1, null, { self: true, optional: true });
if (defTypeRef === null) {
return null;
}
if (defTypeRef.instance === null) {
return null;
}
return defTypeRef.instance.constructor;
}
function getNodeInjectorProviders(injector) {
const diResolver = getNodeInjectorTNode(injector);
const { resolverToProviders } = getFrameworkDIDebugData();
return resolverToProviders.get(diResolver) ?? [];
}
function getProviderImportPaths(providerImportsContainer) {
const providerToPath = /* @__PURE__ */ new Map();
const visitedContainers = /* @__PURE__ */ new Set();
const visitor = walkProviderTreeToDiscoverImportPaths(providerToPath, visitedContainers);
walkProviderTree(providerImportsContainer, visitor, [], /* @__PURE__ */ new Set());
return providerToPath;
}
function walkProviderTreeToDiscoverImportPaths(providerToPath, visitedContainers) {
return (provider, container) => {
if (!providerToPath.has(provider)) {
providerToPath.set(provider, [container]);
}
if (!visitedContainers.has(container)) {
for (const prov of providerToPath.keys()) {
const existingImportPath = providerToPath.get(prov);
let containerDef = getInjectorDef(container);
if (!containerDef) {
const ngModule = container.ngModule;
containerDef = getInjectorDef(ngModule);
}
if (!containerDef) {
return;
}
const lastContainerAddedToPath = existingImportPath[0];
let isNextStepInPath = false;
deepForEach(containerDef.imports, (moduleImport) => {
if (isNextStepInPath) {
return;
}
isNextStepInPath = moduleImport.ngModule === lastContainerAddedToPath || moduleImport === lastContainerAddedToPath;
if (isNextStepInPath) {
providerToPath.get(prov)?.unshift(container);
}
});
}
}
visitedContainers.add(container);
};
}
function getEnvironmentInjectorProviders(injector) {
const providerRecordsWithoutImportPaths = getFrameworkDIDebugData().resolverToProviders.get(injector) ?? [];
if (isPlatformInjector(injector)) {
return providerRecordsWithoutImportPaths;
}
const providerImportsContainer = getProviderImportsContainer(injector);
if (providerImportsContainer === null) {
return providerRecordsWithoutImportPaths;
}
const providerToPath = getProviderImportPaths(providerImportsContainer);
const providerRecords = [];
for (const providerRecord of providerRecordsWithoutImportPaths) {
const provider = providerRecord.provider;
const token = provider.provide;
if (token === ENVIRONMENT_INITIALIZER || token === INJECTOR_DEF_TYPES) {
continue;
}
let importPath = providerToPath.get(provider) ?? [];
const def = getComponentDef(providerImportsContainer);
const isStandaloneComponent2 = !!def?.standalone;
if (isStandaloneComponent2) {
importPath = [providerImportsContainer, ...importPath];
}
providerRecords.push(__spreadProps(__spreadValues({}, providerRecord), { importPath }));
}
return providerRecords;
}
function isPlatformInjector(injector) {
return injector instanceof R3Injector && injector.scopes.has("platform");
}
function getInjectorProviders(injector) {
if (injector instanceof NodeInjector) {
return getNodeInjectorProviders(injector);
} else if (injector instanceof EnvironmentInjector) {
return getEnvironmentInjectorProviders(injector);
}
throwError2("getInjectorProviders only supports NodeInjector and EnvironmentInjector");
}
function getInjectorMetadata(injector) {
if (injector instanceof NodeInjector) {
const lView = getNodeInjectorLView(injector);
const tNode = getNodeInjectorTNode(injector);
assertTNodeForLView(tNode, lView);
return { type: "element", source: getNativeByTNode(tNode, lView) };
}
if (injector instanceof R3Injector) {
return { type: "environment", source: injector.source ?? null };
}
if (injector instanceof NullInjector) {
return { type: "null", source: null };
}
return null;
}
function getInjectorResolutionPath(injector) {
const resolutionPath = [injector];
getInjectorResolutionPathHelper(injector, resolutionPath);
return resolutionPath;
}
function getInjectorResolutionPathHelper(injector, resolutionPath) {
const parent = getInjectorParent(injector);
if (parent === null) {
if (injector instanceof NodeInjector) {
const firstInjector = resolutionPath[0];
if (firstInjector instanceof NodeInjector) {
const moduleInjector = getModuleInjectorOfNodeInjector(firstInjector);
if (moduleInjector === null) {
throwError2("NodeInjector must have some connection to the module injector tree");
}
resolutionPath.push(moduleInjector);
getInjectorResolutionPathHelper(moduleInjector, resolutionPath);
}
return resolutionPath;
}
} else {
resolutionPath.push(parent);
getInjectorResolutionPathHelper(parent, resolutionPath);
}
return resolutionPath;
}
function getInjectorParent(injector) {
if (injector instanceof R3Injector) {
return injector.parent;
}
let tNode;
let lView;
if (injector instanceof NodeInjector) {
tNode = getNodeInjectorTNode(injector);
lView = getNodeInjectorLView(injector);
} else if (injector instanceof NullInjector) {
return null;
} else if (injector instanceof ChainedInjector) {
return injector.parentInjector;
} else {
throwError2("getInjectorParent only support injectors of type R3Injector, NodeInjector, NullInjector");
}
const parentLocation = getParentInjectorLocation(tNode, lView);
if (hasParentInjector(parentLocation)) {
const parentInjectorIndex = getParentInjectorIndex(parentLocation);
const parentLView = getParentInjectorView(parentLocation, lView);
const parentTView = parentLView[TVIEW];
const parentTNode = parentTView.data[
parentInjectorIndex + 8
/* NodeInjectorOffset.TNODE */
];
return new NodeInjector(parentTNode, parentLView);
} else {
const chainedInjector = lView[INJECTOR];
const injectorParent = chainedInjector.injector?.parent;
if (injectorParent instanceof NodeInjector) {
return injectorParent;
}
}
return null;
}
function getModuleInjectorOfNodeInjector(injector) {
let lView;
if (injector instanceof NodeInjector) {
lView = getNodeInjectorLView(injector);
} else {
throwError2("getModuleInjectorOfNodeInjector must be called with a NodeInjector");
}
const inj = lView[INJECTOR];
const moduleInjector = inj instanceof ChainedInjector ? inj.parentInjector : inj.parent;
if (!moduleInjector) {
throwError2("NodeInjector must have some connection to the module injector tree");
}
return moduleInjector;
}
function isComputedNode(node) {
return node.kind === "computed";
}
function isTemplateEffectNode(node) {
return node.kind === "template";
}
function isSignalNode(node) {
return node.kind === "signal";
}
function getTemplateConsumer(injector) {
const tNode = getNodeInjectorTNode(injector);
assertTNode(tNode);
const lView = getNodeInjectorLView(injector);
assertLView(lView);
const templateLView = lView[tNode.index];
if (isLView(templateLView)) {
return templateLView[REACTIVE_TEMPLATE_CONSUMER] ?? null;
}
return null;
}
var signalDebugMap = /* @__PURE__ */ new WeakMap();
var counter$1 = 0;
function getNodesAndEdgesFromSignalMap(signalMap) {
const nodes = Array.from(signalMap.keys());
const debugSignalGraphNodes = [];
const edges = [];
for (const [consumer, producers] of signalMap.entries()) {
const consumerIndex = nodes.indexOf(consumer);
let id = signalDebugMap.get(consumer);
if (!id) {
counter$1++;
id = counter$1.toString();
signalDebugMap.set(consumer, id);
}
if (isComputedNode(consumer)) {
debugSignalGraphNodes.push({
label: consumer.debugName,
value: consumer.value,
kind: consumer.kind,
epoch: consumer.version,
debuggableFn: consumer.computation,
id
});
} else if (isSignalNode(consumer)) {
debugSignalGraphNodes.push({
label: consumer.debugName,
value: consumer.value,
kind: consumer.kind,
epoch: consumer.version,
id
});
} else if (isTemplateEffectNode(consumer)) {
debugSignalGraphNodes.push({
label: consumer.debugName ?? consumer.lView?.[HOST]?.tagName?.toLowerCase?.(),
kind: consumer.kind,
epoch: consumer.version,
// The `lView[CONTEXT]` is a reference to an instance of the component's class.
// We get the constructor so that `inspect(.constructor)` shows the component class.
debuggableFn: consumer.lView?.[CONTEXT]?.constructor,
id
});
} else {
debugSignalGraphNodes.push({
label: consumer.debugName,
kind: consumer.kind,
epoch: consumer.version,
id
});
}
for (const producer of producers) {
edges.push({ consumer: consumerIndex, producer: nodes.indexOf(producer) });
}
}
return { nodes: debugSignalGraphNodes, edges };
}
function extractEffectsFromInjector(injector) {
let diResolver = injector;
if (injector instanceof NodeInjector) {
const lView = getNodeInjectorLView(injector);
diResolver = lView;
}
const resolverToEffects = getFrameworkDIDebugData().resolverToEffects;
const effects = resolverToEffects.get(diResolver) ?? [];
return effects.map((effect2) => effect2[SIGNAL]);
}
function extractSignalNodesAndEdgesFromRoots(nodes, signalDependenciesMap = /* @__PURE__ */ new Map()) {
for (const node of nodes) {
if (signalDependenciesMap.has(node)) {
continue;
}
const producerNodes = [];
for (let link = node.producers; link !== void 0; link = link.nextProducer) {
const producer = link.producer;
producerNodes.push(producer);
}
signalDependenciesMap.set(node, producerNodes);
extractSignalNodesAndEdgesFromRoots(producerNodes, signalDependenciesMap);
}
return signalDependenciesMap;
}
function getSignalGraph(injector) {
let templateConsumer = null;
if (!(injector instanceof NodeInjector) && !(injector instanceof R3Injector)) {
return throwError2("getSignalGraph must be called with a NodeInjector or R3Injector");
}
if (injector instanceof NodeInjector) {
templateConsumer = getTemplateConsumer(injector);
}
const nonTemplateEffectNodes = extractEffectsFromInjector(injector);
const signalNodes = templateConsumer ? [templateConsumer, ...nonTemplateEffectNodes] : nonTemplateEffectNodes;
const signalDependenciesMap = extractSignalNodesAndEdgesFromRoots(signalNodes);
return getNodesAndEdgesFromSignalMap(signalDependenciesMap);
}
var changeDetectionRuns = 0;
var changeDetectionSyncRuns = 0;
var counter = 0;
var eventsStack = [];
function measureStart(startEvent) {
eventsStack.push([startEvent, counter]);
console.timeStamp("Event_" + startEvent + "_" + counter++);
}
function measureEnd(startEvent, entryName, color) {
const top = eventsStack.pop();
assertDefined(top, "Profiling error: could not find start event entry " + startEvent);
assertEqual(top[0], startEvent, `Profiling error: expected to see ${startEvent} event but got ${top[0]}`);
console.timeStamp(entryName, "Event_" + top[0] + "_" + top[1], void 0, "\u{1F170}\uFE0F Angular", void 0, color);
}
var chromeDevToolsInjectorProfiler = (event) => {
const eventType = event.type;
if (eventType === 4) {
measureStart(
100
/* ProfilerDIEvent.InjectorToCreateInstanceEvent */
);
} else if (eventType === 1) {
const token = event.context.token;
measureEnd(100, getProviderTokenMeasureName(token), "tertiary-dark");
}
};
var devToolsProfiler = (event, instance, eventFn) => {
switch (event) {
case 8:
case 10:
case 12:
case 14:
case 16:
case 18:
case 20:
case 22:
case 0:
case 4:
case 2:
case 24:
case 6: {
measureStart(event);
break;
}
case 9: {
measureEnd(8, "Bootstrap application", "primary-dark");
break;
}
case 11: {
measureEnd(10, "Bootstrap component", "primary-dark");
break;
}
case 13: {
changeDetectionSyncRuns = 0;
measureEnd(12, "Change detection " + changeDetectionRuns++, "primary-dark");
break;
}
case 15: {
measureEnd(14, "Synchronization " + changeDetectionSyncRuns++, "primary");
break;
}
case 17: {
measureEnd(16, "After render hooks", "primary");
break;
}
case 19: {
const typeName = getComponentMeasureName(instance);
measureEnd(18, typeName, "primary-light");
break;
}
case 21: {
measureEnd(20, "Defer block", "primary-dark");
break;
}
case 23: {
measureEnd(22, "Dynamic component creation", "primary-dark");
break;
}
case 3: {
measureEnd(2, stringifyForError(eventFn) + " (update)", "secondary-dark");
break;
}
case 1: {
measureEnd(0, stringifyForError(eventFn) + " (create)", "secondary");
break;
}
case 25: {
measureEnd(24, "HostBindings", "secondary-dark");
break;
}
case 5: {
const typeName = getComponentMeasureName(instance);
measureEnd(4, `${typeName}:${stringifyForError(eventFn)}`, "tertiary");
break;
}
case 7: {
measureEnd(6, stringifyForError(eventFn), "tertiary-light");
break;
}
default: {
throw new Error("Unexpected profiling event type: " + event);
}
}
};
function getComponentMeasureName(instance) {
return instance.constructor.name;
}
function getProviderTokenMeasureName(token) {
if (isTypeProvider(token)) {
return token.name;
} else if (token.provide != null) {
return getProviderTokenMeasureName(token.provide);
}
return token.toString();
}
function enableProfiling() {
performanceMarkFeature("Chrome DevTools profiling");
if (typeof ngDevMode !== "undefined" && ngDevMode) {
const removeInjectorProfiler = setInjectorProfiler(chromeDevToolsInjectorProfiler);
const removeProfiler3 = setProfiler(devToolsProfiler);
return () => {
removeInjectorProfiler();
removeProfiler3();
};
}
return () => {
};
}
function getTransferState(injector) {
const doc = getDocument();
const appId = injector.get(APP_ID);
const transferState = retrieveTransferredState(doc, appId);
const filteredEntries = {};
for (const [key, value] of Object.entries(transferState)) {
if (!isInternalHydrationTransferStateKey(key)) {
filteredEntries[key] = value;
}
}
return filteredEntries;
}
var GLOBAL_PUBLISH_EXPANDO_KEY = "ng";
var globalUtilsFunctions = {
/**
* Warning: functions that start with `ɵ` are considered *INTERNAL* and should not be relied upon
* in application's code. The contract of those functions might be changed in any release and/or a
* function can be removed completely.
*/
"\u0275getDependenciesFromInjectable": getDependenciesFromInjectable,
"\u0275getInjectorProviders": getInjectorProviders,
"\u0275getInjectorResolutionPath": getInjectorResolutionPath,
"\u0275getInjectorMetadata": getInjectorMetadata,
"\u0275setProfiler": setProfiler,
"\u0275getSignalGraph": getSignalGraph,
"\u0275getDeferBlocks": getDeferBlocks,
"\u0275getTransferState": getTransferState,
"getDirectiveMetadata": getDirectiveMetadata$1,
"getComponent": getComponent,
"getContext": getContext,
"getListeners": getListeners,
"getOwningComponent": getOwningComponent,
"getHostElement": getHostElement,
"getInjector": getInjector,
"getRootComponents": getRootComponents,
"getDirectives": getDirectives,
"applyChanges": applyChanges,
"isSignal": isSignal,
"enableProfiling": enableProfiling
};
var _published = false;
function publishDefaultGlobalUtils$1() {
if (!_published) {
_published = true;
if (typeof window !== "undefined") {
setupFrameworkInjectorProfiler();
}
for (const [methodName, method] of Object.entries(globalUtilsFunctions)) {
publishGlobalUtil(methodName, method);
}
}
}
function publishGlobalUtil(name, fn) {
publishUtil(name, fn);
}
function publishUtil(name, fn) {
if (typeof COMPILED === "undefined" || !COMPILED) {
const w = _global;
ngDevMode && assertDefined(fn, "function not defined");
w[GLOBAL_PUBLISH_EXPANDO_KEY] ??= {};
w[GLOBAL_PUBLISH_EXPANDO_KEY][name] = fn;
}
}
var TESTABILITY = new InjectionToken("");
var TESTABILITY_GETTER = new InjectionToken("");
var Testability = class _Testability {
_ngZone;
registry;
_isZoneStable = true;
_callbacks = [];
_taskTrackingZone = null;
_destroyRef;
constructor(_ngZone, registry2, testabilityGetter) {
this._ngZone = _ngZone;
this.registry = registry2;
if (isInInjectionContext()) {
this._destroyRef = inject2(DestroyRef, { optional: true }) ?? void 0;
}
if (!_testabilityGetter) {
setTestabilityGetter(testabilityGetter);
testabilityGetter.addToWindow(registry2);
}
this._watchAngularEvents();
_ngZone.run(() => {
this._taskTrackingZone = typeof Zone == "undefined" ? null : Zone.current.get("TaskTrackingZone");
});
}
_watchAngularEvents() {
const onUnstableSubscription = this._ngZone.onUnstable.subscribe({
next: () => {
this._isZoneStable = false;
}
});
const onStableSubscription = this._ngZone.runOutsideAngular(() => this._ngZone.onStable.subscribe({
next: () => {
NgZone.assertNotInAngularZone();
queueMicrotask(() => {
this._isZoneStable = true;
this._runCallbacksIfReady();
});
}
}));
this._destroyRef?.onDestroy(() => {
onUnstableSubscription.unsubscribe();
onStableSubscription.unsubscribe();
});
}
/**
* Whether an associated application is stable
*/
isStable() {
return this._isZoneStable && !this._ngZone.hasPendingMacrotasks;
}
_runCallbacksIfReady() {
if (this.isStable()) {
queueMicrotask(() => {
while (this._callbacks.length !== 0) {
let cb = this._callbacks.pop();
clearTimeout(cb.timeoutId);
cb.doneCb();
}
});
} else {
let pending = this.getPendingTasks();
this._callbacks = this._callbacks.filter((cb) => {
if (cb.updateCb && cb.updateCb(pending)) {
clearTimeout(cb.timeoutId);
return false;
}
return true;
});
}
}
getPendingTasks() {
if (!this._taskTrackingZone) {
return [];
}
return this._taskTrackingZone.macroTasks.map((t) => {
return {
source: t.source,
// From TaskTrackingZone:
// https://github.com/angular/zone.js/blob/master/lib/zone-spec/task-tracking.ts#L40
creationLocation: t.creationLocation,
data: t.data
};
});
}
addCallback(cb, timeout, updateCb) {
let timeoutId = -1;
if (timeout && timeout > 0) {
timeoutId = setTimeout(() => {
this._callbacks = this._callbacks.filter((cb2) => cb2.timeoutId !== timeoutId);
cb();
}, timeout);
}
this._callbacks.push({ doneCb: cb, timeoutId, updateCb });
}
/**
* Wait for the application to be stable with a timeout. If the timeout is reached before that
* happens, the callback receives a list of the macro tasks that were pending, otherwise null.
*
* @param doneCb The callback to invoke when Angular is stable or the timeout expires
* whichever comes first.
* @param timeout Optional. The maximum time to wait for Angular to become stable. If not
* specified, whenStable() will wait forever.
* @param updateCb Optional. If specified, this callback will be invoked whenever the set of
* pending macrotasks changes. If this callback returns true doneCb will not be invoked
* and no further updates will be issued.
*/
whenStable(doneCb, timeout, updateCb) {
if (updateCb && !this._taskTrackingZone) {
throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');
}
this.addCallback(doneCb, timeout, updateCb);
this._runCallbacksIfReady();
}
/**
* Registers an application with a testability hook so that it can be tracked.
* @param token token of application, root element
*
* @internal
*/
registerApplication(token) {
this.registry.registerApplication(token, this);
}
/**
* Unregisters an application.
* @param token token of application, root element
*
* @internal
*/
unregisterApplication(token) {
this.registry.unregisterApplication(token);
}
/**
* Find providers by name
* @param using The root element to search from
* @param provider The name of binding variable
* @param exactMatch Whether using exactMatch
*/
findProviders(using, provider, exactMatch) {
return [];
}
static \u0275fac = function Testability_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _Testability)(\u0275\u0275inject(NgZone), \u0275\u0275inject(TestabilityRegistry), \u0275\u0275inject(TESTABILITY_GETTER));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _Testability, factory: _Testability.\u0275fac });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Testability, [{
type: Injectable
}], () => [{ type: NgZone }, { type: TestabilityRegistry }, { type: void 0, decorators: [{
type: Inject,
args: [TESTABILITY_GETTER]
}] }], null);
})();
var TestabilityRegistry = class _TestabilityRegistry {
/** @internal */
_applications = /* @__PURE__ */ new Map();
/**
* Registers an application with a testability hook so that it can be tracked
* @param token token of application, root element
* @param testability Testability hook
*/
registerApplication(token, testability) {
this._applications.set(token, testability);
}
/**
* Unregisters an application.
* @param token token of application, root element
*/
unregisterApplication(token) {
this._applications.delete(token);
}
/**
* Unregisters all applications
*/
unregisterAllApplications() {
this._applications.clear();
}
/**
* Get a testability hook associated with the application
* @param elem root element
*/
getTestability(elem) {
return this._applications.get(elem) || null;
}
/**
* Get all registered testabilities
*/
getAllTestabilities() {
return Array.from(this._applications.values());
}
/**
* Get all registered applications(root elements)
*/
getAllRootElements() {
return Array.from(this._applications.keys());
}
/**
* Find testability of a node in the Tree
* @param elem node
* @param findInAncestors whether finding testability in ancestors if testability was not found in
* current node
*/
findTestabilityInTree(elem, findInAncestors = true) {
return _testabilityGetter?.findTestabilityInTree(this, elem, findInAncestors) ?? null;
}
static \u0275fac = function TestabilityRegistry_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _TestabilityRegistry)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _TestabilityRegistry, factory: _TestabilityRegistry.\u0275fac, providedIn: "platform" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TestabilityRegistry, [{
type: Injectable,
args: [{ providedIn: "platform" }]
}], null, null);
})();
function setTestabilityGetter(getter) {
_testabilityGetter = getter;
}
var _testabilityGetter;
function isPromise2(obj) {
return !!obj && typeof obj.then === "function";
}
function isSubscribable(obj) {
return !!obj && typeof obj.subscribe === "function";
}
var APP_INITIALIZER = new InjectionToken(ngDevMode ? "Application Initializer" : "");
var ApplicationInitStatus = class _ApplicationInitStatus {
// Using non null assertion, these fields are defined below
// within the `new Promise` callback (synchronously).
resolve;
reject;
initialized = false;
done = false;
donePromise = new Promise((res, rej) => {
this.resolve = res;
this.reject = rej;
});
appInits = inject2(APP_INITIALIZER, { optional: true }) ?? [];
injector = inject2(Injector);
constructor() {
if ((typeof ngDevMode === "undefined" || ngDevMode) && !Array.isArray(this.appInits)) {
throw new RuntimeError(-209, `Unexpected type of the \`APP_INITIALIZER\` token value (expected an array, but got ${typeof this.appInits}). Please check that the \`APP_INITIALIZER\` token is configured as a \`multi: true\` provider.`);
}
}
/** @internal */
runInitializers() {
if (this.initialized) {
return;
}
const asyncInitPromises = [];
for (const appInits of this.appInits) {
const initResult = runInInjectionContext(this.injector, appInits);
if (isPromise2(initResult)) {
asyncInitPromises.push(initResult);
} else if (isSubscribable(initResult)) {
const observableAsPromise = new Promise((resolve, reject) => {
initResult.subscribe({ complete: resolve, error: reject });
});
asyncInitPromises.push(observableAsPromise);
}
}
const complete = () => {
this.done = true;
this.resolve();
};
Promise.all(asyncInitPromises).then(() => {
complete();
}).catch((e) => {
this.reject(e);
});
if (asyncInitPromises.length === 0) {
complete();
}
this.initialized = true;
}
static \u0275fac = function ApplicationInitStatus_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ApplicationInitStatus)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _ApplicationInitStatus, factory: _ApplicationInitStatus.\u0275fac, providedIn: "root" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
type: Injectable,
args: [{ providedIn: "root" }]
}], () => [], null);
})();
var APP_BOOTSTRAP_LISTENER = new InjectionToken(ngDevMode ? "appBootstrapListener" : "");
function publishDefaultGlobalUtils() {
ngDevMode && publishDefaultGlobalUtils$1();
}
function publishSignalConfiguration() {
setThrowInvalidWriteToSignalError(() => {
let errorMessage = "";
if (ngDevMode) {
const activeConsumer2 = getActiveConsumer();
errorMessage = activeConsumer2 && isReactiveLViewConsumer(activeConsumer2) ? "Writing to signals is not allowed while Angular renders the template (eg. interpolations)" : "Writing to signals is not allowed in a `computed`";
}
throw new RuntimeError(600, errorMessage);
});
}
function isBoundToModule(cf) {
return cf.isBoundToModule;
}
var MAXIMUM_REFRESH_RERUNS = 10;
function optionsReducer(dst, objs) {
if (Array.isArray(objs)) {
return objs.reduce(optionsReducer, dst);
}
return __spreadValues(__spreadValues({}, dst), objs);
}
var ApplicationRef = class _ApplicationRef {
/** @internal */
_runningTick = false;
_destroyed = false;
_destroyListeners = [];
/** @internal */
_views = [];
internalErrorHandler = inject2(INTERNAL_APPLICATION_ERROR_HANDLER);
afterRenderManager = inject2(AfterRenderManager);
zonelessEnabled = inject2(ZONELESS_ENABLED);
rootEffectScheduler = inject2(EffectScheduler);
/**
* Current dirty state of the application across a number of dimensions (views, afterRender hooks,
* etc).
*
* A flag set here means that `tick()` will attempt to resolve the dirtiness when executed.
*
* @internal
*/
dirtyFlags = 0;
/**
* Most recent snapshot from the `TracingService`, if any.
*
* This snapshot attempts to capture the context when `tick()` was first
* scheduled. It then runs wrapped in this context.
*
* @internal
*/
tracingSnapshot = null;
// Needed for ComponentFixture temporarily during migration of autoDetect behavior
// Eventually the hostView of the fixture should just attach to ApplicationRef.
allTestViews = /* @__PURE__ */ new Set();
autoDetectTestViews = /* @__PURE__ */ new Set();
includeAllTestViews = false;
/** @internal */
afterTick = new Subject();
/** @internal */
get allViews() {
return [
...(this.includeAllTestViews ? this.allTestViews : this.autoDetectTestViews).keys(),
...this._views
];
}
/**
* Indicates whether this instance was destroyed.
*/
get destroyed() {
return this._destroyed;
}
/**
* Get a list of component types registered to this application.
* This list is populated even before the component is created.
*/
componentTypes = [];
/**
* Get a list of components registered to this application.
*/
components = [];
internalPendingTask = inject2(PendingTasksInternal);
/**
* Returns an Observable that indicates when the application is stable or unstable.
*/
get isStable() {
return this.internalPendingTask.hasPendingTasksObservable.pipe(map((pending) => !pending));
}
constructor() {
inject2(TracingService, { optional: true });
}
/**
* @returns A promise that resolves when the application becomes stable
*/
whenStable() {
let subscription;
return new Promise((resolve) => {
subscription = this.isStable.subscribe({
next: (stable) => {
if (stable) {
resolve();
}
}
});
}).finally(() => {
subscription.unsubscribe();
});
}
_injector = inject2(EnvironmentInjector);
_rendererFactory = null;
/**
* The `EnvironmentInjector` used to create this application.
*/
get injector() {
return this._injector;
}
/**
* Bootstrap a component onto the element identified by its selector or, optionally, to a
* specified element.
*
* @usageNotes
* ### Bootstrap process
*
* When bootstrapping a component, Angular mounts it onto a target DOM element
* and kicks off automatic change detection. The target DOM element can be
* provided using the `rootSelectorOrNode` argument.
*
* If the target DOM element is not provided, Angular tries to find one on a page
* using the `selector` of the component that is being bootstrapped
* (first matched element is used).
*
* ### Example
*
* Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,
* but it requires us to know the component while writing the application code.
*
* Imagine a situation where we have to wait for an API call to decide about the component to
* bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to
* dynamically bootstrap a component.
*
* {@example core/ts/platform/platform.ts region='componentSelector'}
*
* Optionally, a component can be mounted onto a DOM element that does not match the
* selector of the bootstrapped component.
*
* In the following example, we are providing a CSS selector to match the target element.
*
* {@example core/ts/platform/platform.ts region='cssSelector'}
*
* While in this example, we are providing reference to a DOM node.
*
* {@example core/ts/platform/platform.ts region='domNode'}
*/
bootstrap(componentOrFactory, rootSelectorOrNode) {
return this.bootstrapImpl(componentOrFactory, rootSelectorOrNode);
}
bootstrapImpl(componentOrFactory, rootSelectorOrNode, injector = Injector.NULL) {
const ngZone = this._injector.get(NgZone);
return ngZone.run(() => {
profiler(
10
/* ProfilerEvent.BootstrapComponentStart */
);
(typeof ngDevMode === "undefined" || ngDevMode) && warnIfDestroyed(this._destroyed);
const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
const initStatus = this._injector.get(ApplicationInitStatus);
if (!initStatus.done) {
let errorMessage = "";
if (typeof ngDevMode === "undefined" || ngDevMode) {
const standalone = !isComponentFactory && isStandalone(componentOrFactory);
errorMessage = "Cannot bootstrap as there are still asynchronous initializers running." + (standalone ? "" : " Bootstrap components in the `ngDoBootstrap` method of the root module.");
}
throw new RuntimeError(405, errorMessage);
}
let componentFactory;
if (isComponentFactory) {
componentFactory = componentOrFactory;
} else {
const resolver = this._injector.get(ComponentFactoryResolver$1);
componentFactory = resolver.resolveComponentFactory(componentOrFactory);
}
this.componentTypes.push(componentFactory.componentType);
const ngModule = isBoundToModule(componentFactory) ? void 0 : this._injector.get(NgModuleRef$1);
const selectorOrNode = rootSelectorOrNode || componentFactory.selector;
const compRef = componentFactory.create(injector, [], selectorOrNode, ngModule);
const nativeElement = compRef.location.nativeElement;
const testability = compRef.injector.get(TESTABILITY, null);
testability?.registerApplication(nativeElement);
compRef.onDestroy(() => {
this.detachView(compRef.hostView);
remove(this.components, compRef);
testability?.unregisterApplication(nativeElement);
});
this._loadComponent(compRef);
if (typeof ngDevMode === "undefined" || ngDevMode) {
const _console = this._injector.get(Console);
_console.log(`Angular is running in development mode.`);
}
profiler(11, compRef);
return compRef;
});
}
/**
* Invoke this method to explicitly process change detection and its side-effects.
*
* In development mode, `tick()` also performs a second change detection cycle to ensure that no
* further changes are detected. If additional changes are picked up during this second cycle,
* bindings in the app have side-effects that cannot be resolved in a single change detection
* pass.
* In this case, Angular throws an error, since an Angular application can only have one change
* detection pass during which all change detection must complete.
*/
tick() {
if (!this.zonelessEnabled) {
this.dirtyFlags |= 1;
}
this._tick();
}
/** @internal */
_tick() {
profiler(
12
/* ProfilerEvent.ChangeDetectionStart */
);
if (this.tracingSnapshot !== null) {
this.tracingSnapshot.run(TracingAction.CHANGE_DETECTION, this.tickImpl);
} else {
this.tickImpl();
}
}
tickImpl = () => {
(typeof ngDevMode === "undefined" || ngDevMode) && warnIfDestroyed(this._destroyed);
if (this._runningTick) {
throw new RuntimeError(101, ngDevMode && "ApplicationRef.tick is called recursively");
}
const prevConsumer = setActiveConsumer(null);
try {
this._runningTick = true;
this.synchronize();
if (typeof ngDevMode === "undefined" || ngDevMode) {
for (let view of this.allViews) {
view.checkNoChanges();
}
}
} finally {
this._runningTick = false;
this.tracingSnapshot?.dispose();
this.tracingSnapshot = null;
setActiveConsumer(prevConsumer);
this.afterTick.next();
profiler(
13
/* ProfilerEvent.ChangeDetectionEnd */
);
}
};
/**
* Performs the core work of synchronizing the application state with the UI, resolving any
* pending dirtiness (potentially in a loop).
*/
synchronize() {
if (this._rendererFactory === null && !this._injector.destroyed) {
this._rendererFactory = this._injector.get(RendererFactory2, null, { optional: true });
}
let runs = 0;
while (this.dirtyFlags !== 0 && runs++ < MAXIMUM_REFRESH_RERUNS) {
profiler(
14
/* ProfilerEvent.ChangeDetectionSyncStart */
);
this.synchronizeOnce();
profiler(
15
/* ProfilerEvent.ChangeDetectionSyncEnd */
);
}
if ((typeof ngDevMode === "undefined" || ngDevMode) && runs >= MAXIMUM_REFRESH_RERUNS) {
throw new RuntimeError(103, ngDevMode && "Infinite change detection while refreshing application views. Ensure views are not calling `markForCheck` on every template execution or that afterRender hooks always mark views for check.");
}
}
/**
* Perform a single synchronization pass.
*/
synchronizeOnce() {
if (this.dirtyFlags & 16) {
this.dirtyFlags &= ~16;
this.rootEffectScheduler.flush();
}
let ranDetectChanges = false;
if (this.dirtyFlags & 7) {
const useGlobalCheck = Boolean(
this.dirtyFlags & 1
/* ApplicationRefDirtyFlags.ViewTreeGlobal */
);
this.dirtyFlags &= ~7;
this.dirtyFlags |= 8;
for (let { _lView } of this.allViews) {
if (!useGlobalCheck && !requiresRefreshOrTraversal(_lView)) {
continue;
}
const mode = useGlobalCheck && !this.zonelessEnabled ? (
// Global mode includes `CheckAlways` views.
0
) : (
// Only refresh views with the `RefreshView` flag or views is a changed signal
1
);
detectChangesInternal(_lView, mode);
ranDetectChanges = true;
}
this.dirtyFlags &= ~4;
this.syncDirtyFlagsWithViews();
if (this.dirtyFlags & (7 | 16)) {
return;
}
}
if (!ranDetectChanges) {
this._rendererFactory?.begin?.();
this._rendererFactory?.end?.();
}
if (this.dirtyFlags & 8) {
this.dirtyFlags &= ~8;
this.afterRenderManager.execute();
}
this.syncDirtyFlagsWithViews();
}
/**
* Checks `allViews` for views which require refresh/traversal, and updates `dirtyFlags`
* accordingly, with two potential behaviors:
*
* 1. If any of our views require updating, then this adds the `ViewTreeTraversal` dirty flag.
* This _should_ be a no-op, since the scheduler should've added the flag at the same time the
* view was marked as needing updating.
*
* TODO(alxhub): figure out if this behavior is still needed for edge cases.
*
* 2. If none of our views require updating, then clear the view-related `dirtyFlag`s. This
* happens when the scheduler is notified of a view becoming dirty, but the view itself isn't
* reachable through traversal from our roots (e.g. it's detached from the CD tree).
*/
syncDirtyFlagsWithViews() {
if (this.allViews.some(({ _lView }) => requiresRefreshOrTraversal(_lView))) {
this.dirtyFlags |= 2;
return;
} else {
this.dirtyFlags &= ~7;
}
}
/**
* Attaches a view so that it will be dirty checked.
* The view will be automatically detached when it is destroyed.
* This will throw if the view is already attached to a ViewContainer.
*/
attachView(viewRef) {
(typeof ngDevMode === "undefined" || ngDevMode) && warnIfDestroyed(this._destroyed);
const view = viewRef;
this._views.push(view);
view.attachToAppRef(this);
}
/**
* Detaches a view from dirty checking again.
*/
detachView(viewRef) {
(typeof ngDevMode === "undefined" || ngDevMode) && warnIfDestroyed(this._destroyed);
const view = viewRef;
remove(this._views, view);
view.detachFromAppRef();
}
_loadComponent(componentRef) {
this.attachView(componentRef.hostView);
try {
this.tick();
} catch (e) {
this.internalErrorHandler(e);
}
this.components.push(componentRef);
const listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, []);
if (ngDevMode && !Array.isArray(listeners)) {
throw new RuntimeError(-209, `Unexpected type of the \`APP_BOOTSTRAP_LISTENER\` token value (expected an array, but got ${typeof listeners}). Please check that the \`APP_BOOTSTRAP_LISTENER\` token is configured as a \`multi: true\` provider.`);
}
listeners.forEach((listener) => listener(componentRef));
}
/** @internal */
ngOnDestroy() {
if (this._destroyed)
return;
try {
this._destroyListeners.forEach((listener) => listener());
this._views.slice().forEach((view) => view.destroy());
} finally {
this._destroyed = true;
this._views = [];
this._destroyListeners = [];
}
}
/**
* Registers a listener to be called when an instance is destroyed.
*
* @param callback A callback function to add as a listener.
* @returns A function which unregisters a listener.
*/
onDestroy(callback) {
(typeof ngDevMode === "undefined" || ngDevMode) && warnIfDestroyed(this._destroyed);
this._destroyListeners.push(callback);
return () => remove(this._destroyListeners, callback);
}
/**
* Destroys an Angular application represented by this `ApplicationRef`. Calling this function
* will destroy the associated environment injectors as well as all the bootstrapped components
* with their views.
*/
destroy() {
if (this._destroyed) {
throw new RuntimeError(406, ngDevMode && "This instance of the `ApplicationRef` has already been destroyed.");
}
const injector = this._injector;
if (injector.destroy && !injector.destroyed) {
injector.destroy();
}
}
/**
* Returns the number of attached views.
*/
get viewCount() {
return this._views.length;
}
static \u0275fac = function ApplicationRef_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ApplicationRef)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _ApplicationRef, factory: _ApplicationRef.\u0275fac, providedIn: "root" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
type: Injectable,
args: [{ providedIn: "root" }]
}], () => [], null);
})();
function warnIfDestroyed(destroyed) {
if (destroyed) {
console.warn(formatRuntimeError(406, "This instance of the `ApplicationRef` has already been destroyed."));
}
}
function remove(list, el) {
const index = list.indexOf(el);
if (index > -1) {
list.splice(index, 1);
}
}
function scheduleDelayedTrigger(scheduleFn) {
const lView = getLView();
const tNode = getCurrentTNode();
renderPlaceholder(lView, tNode);
if (!shouldTriggerDeferBlock(0, lView))
return;
const injector = lView[INJECTOR];
const lDetails = getLDeferBlockDetails(lView, tNode);
const cleanupFn = scheduleFn(() => triggerDeferBlock(0, lView, tNode), injector);
storeTriggerCleanupFn(0, lDetails, cleanupFn);
}
function scheduleDelayedPrefetching(scheduleFn, trigger) {
if (false)
return;
const lView = getLView();
const injector = lView[INJECTOR];
const tNode = getCurrentTNode();
const tView = lView[TVIEW];
const tDetails = getTDeferBlockDetails(tView, tNode);
if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
const lDetails = getLDeferBlockDetails(lView, tNode);
const prefetch = () => triggerPrefetching(tDetails, lView, tNode);
const cleanupFn = scheduleFn(prefetch, injector);
storeTriggerCleanupFn(1, lDetails, cleanupFn);
}
}
function scheduleDelayedHydrating(scheduleFn, lView, tNode) {
if (false)
return;
const injector = lView[INJECTOR];
const lDetails = getLDeferBlockDetails(lView, tNode);
const ssrUniqueId = lDetails[SSR_UNIQUE_ID];
ngDevMode && assertSsrIdDefined(ssrUniqueId);
const cleanupFn = scheduleFn(() => triggerHydrationFromBlockName(injector, ssrUniqueId), injector);
storeTriggerCleanupFn(2, lDetails, cleanupFn);
}
function triggerPrefetching(tDetails, lView, tNode) {
triggerResourceLoading(tDetails, lView, tNode);
}
function triggerResourceLoading(tDetails, lView, tNode) {
const injector = lView[INJECTOR];
const tView = lView[TVIEW];
if (tDetails.loadingState !== DeferDependenciesLoadingState.NOT_STARTED) {
return tDetails.loadingPromise ?? Promise.resolve();
}
const lDetails = getLDeferBlockDetails(lView, tNode);
const primaryBlockTNode = getPrimaryBlockTNode(tView, tDetails);
tDetails.loadingState = DeferDependenciesLoadingState.IN_PROGRESS;
invokeTriggerCleanupFns(1, lDetails);
let dependenciesFn = tDetails.dependencyResolverFn;
if (ngDevMode) {
const deferDependencyInterceptor = injector.get(DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, null, {
optional: true
});
if (deferDependencyInterceptor) {
dependenciesFn = deferDependencyInterceptor.intercept(dependenciesFn);
}
}
const removeTask = injector.get(PendingTasks).add();
if (!dependenciesFn) {
tDetails.loadingPromise = Promise.resolve().then(() => {
tDetails.loadingPromise = null;
tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;
removeTask();
});
return tDetails.loadingPromise;
}
tDetails.loadingPromise = Promise.allSettled(dependenciesFn()).then((results) => {
let failed = false;
const directiveDefs = [];
const pipeDefs = [];
for (const result of results) {
if (result.status === "fulfilled") {
const dependency = result.value;
const directiveDef = getComponentDef(dependency) || getDirectiveDef(dependency);
if (directiveDef) {
directiveDefs.push(directiveDef);
} else {
const pipeDef = getPipeDef(dependency);
if (pipeDef) {
pipeDefs.push(pipeDef);
}
}
} else {
failed = true;
break;
}
}
if (failed) {
tDetails.loadingState = DeferDependenciesLoadingState.FAILED;
if (tDetails.errorTmplIndex === null) {
const templateLocation = ngDevMode ? getTemplateLocationDetails(lView) : "";
const error = new RuntimeError(-750, ngDevMode && `Loading dependencies for \`@defer\` block failed, but no \`@error\` block was configured${templateLocation}. Consider using the \`@error\` block to render an error state.`);
handleUncaughtError(lView, error);
}
} else {
tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;
const primaryBlockTView = primaryBlockTNode.tView;
if (directiveDefs.length > 0) {
primaryBlockTView.directiveRegistry = addDepsToRegistry(primaryBlockTView.directiveRegistry, directiveDefs);
const directiveTypes = directiveDefs.map((def) => def.type);
const providers = internalImportProvidersFrom(false, ...directiveTypes);
tDetails.providers = providers;
}
if (pipeDefs.length > 0) {
primaryBlockTView.pipeRegistry = addDepsToRegistry(primaryBlockTView.pipeRegistry, pipeDefs);
}
}
});
return tDetails.loadingPromise.finally(() => {
tDetails.loadingPromise = null;
removeTask();
});
}
function shouldTriggerDeferBlock(triggerType, lView) {
if (triggerType === 0 && true && false) {
return false;
}
const injector = lView[INJECTOR];
const config2 = injector.get(DEFER_BLOCK_CONFIG, null, { optional: true });
if (config2?.behavior === DeferBlockBehavior.Manual) {
return false;
}
return true;
}
function triggerDeferBlock(triggerType, lView, tNode) {
const tView = lView[TVIEW];
const lContainer = lView[tNode.index];
ngDevMode && assertLContainer(lContainer);
if (!shouldTriggerDeferBlock(triggerType, lView))
return;
const lDetails = getLDeferBlockDetails(lView, tNode);
const tDetails = getTDeferBlockDetails(tView, tNode);
invokeAllTriggerCleanupFns(lDetails);
switch (tDetails.loadingState) {
case DeferDependenciesLoadingState.NOT_STARTED:
renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer);
triggerResourceLoading(tDetails, lView, tNode);
if (tDetails.loadingState === DeferDependenciesLoadingState.IN_PROGRESS) {
renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer);
}
break;
case DeferDependenciesLoadingState.IN_PROGRESS:
renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer);
renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer);
break;
case DeferDependenciesLoadingState.COMPLETE:
ngDevMode && assertDeferredDependenciesLoaded(tDetails);
renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer);
break;
case DeferDependenciesLoadingState.FAILED:
renderDeferBlockState(DeferBlockState.Error, tNode, lContainer);
break;
default:
if (ngDevMode) {
throwError2("Unknown defer block state");
}
}
}
async function triggerHydrationFromBlockName(injector, blockName, replayQueuedEventsFn) {
const dehydratedBlockRegistry = injector.get(DEHYDRATED_BLOCK_REGISTRY);
const blocksBeingHydrated = dehydratedBlockRegistry.hydrating;
if (blocksBeingHydrated.has(blockName)) {
return;
}
const { parentBlockPromise, hydrationQueue } = getParentBlockHydrationQueue(blockName, injector);
if (hydrationQueue.length === 0)
return;
if (parentBlockPromise !== null) {
hydrationQueue.shift();
}
populateHydratingStateForQueue(dehydratedBlockRegistry, hydrationQueue);
if (parentBlockPromise !== null) {
await parentBlockPromise;
}
const topmostParentBlock = hydrationQueue[0];
if (dehydratedBlockRegistry.has(topmostParentBlock)) {
await triggerHydrationForBlockQueue(injector, hydrationQueue, replayQueuedEventsFn);
} else {
dehydratedBlockRegistry.awaitParentBlock(topmostParentBlock, async () => await triggerHydrationForBlockQueue(injector, hydrationQueue, replayQueuedEventsFn));
}
}
async function triggerHydrationForBlockQueue(injector, hydrationQueue, replayQueuedEventsFn) {
const dehydratedBlockRegistry = injector.get(DEHYDRATED_BLOCK_REGISTRY);
const blocksBeingHydrated = dehydratedBlockRegistry.hydrating;
const pendingTasks = injector.get(PendingTasksInternal);
const taskId = pendingTasks.add();
for (let blockQueueIdx = 0; blockQueueIdx < hydrationQueue.length; blockQueueIdx++) {
const dehydratedBlockId = hydrationQueue[blockQueueIdx];
const dehydratedDeferBlock = dehydratedBlockRegistry.get(dehydratedBlockId);
if (dehydratedDeferBlock != null) {
await triggerResourceLoadingForHydration(dehydratedDeferBlock);
await nextRender(injector);
if (deferBlockHasErrored(dehydratedDeferBlock)) {
removeDehydratedViewList(dehydratedDeferBlock);
cleanupRemainingHydrationQueue(hydrationQueue.slice(blockQueueIdx), dehydratedBlockRegistry);
break;
}
blocksBeingHydrated.get(dehydratedBlockId).resolve();
} else {
cleanupParentContainer(blockQueueIdx, hydrationQueue, dehydratedBlockRegistry);
cleanupRemainingHydrationQueue(hydrationQueue.slice(blockQueueIdx), dehydratedBlockRegistry);
break;
}
}
const lastBlockName = hydrationQueue[hydrationQueue.length - 1];
await blocksBeingHydrated.get(lastBlockName)?.promise;
pendingTasks.remove(taskId);
if (replayQueuedEventsFn) {
replayQueuedEventsFn(hydrationQueue);
}
cleanupHydratedDeferBlocks(dehydratedBlockRegistry.get(lastBlockName), hydrationQueue, dehydratedBlockRegistry, injector.get(ApplicationRef));
}
function deferBlockHasErrored(deferBlock) {
return getLDeferBlockDetails(deferBlock.lView, deferBlock.tNode)[DEFER_BLOCK_STATE] === DeferBlockState.Error;
}
function cleanupParentContainer(currentBlockIdx, hydrationQueue, dehydratedBlockRegistry) {
const parentDeferBlockIdx = currentBlockIdx - 1;
const parentDeferBlock = parentDeferBlockIdx > -1 ? dehydratedBlockRegistry.get(hydrationQueue[parentDeferBlockIdx]) : null;
if (parentDeferBlock) {
cleanupLContainer(parentDeferBlock.lContainer);
}
}
function cleanupRemainingHydrationQueue(hydrationQueue, dehydratedBlockRegistry) {
const blocksBeingHydrated = dehydratedBlockRegistry.hydrating;
for (const dehydratedBlockId in hydrationQueue) {
blocksBeingHydrated.get(dehydratedBlockId)?.reject();
}
dehydratedBlockRegistry.cleanup(hydrationQueue);
}
function populateHydratingStateForQueue(registry2, queue) {
for (let blockId of queue) {
registry2.hydrating.set(blockId, Promise.withResolvers());
}
}
function nextRender(injector) {
return new Promise((resolveFn) => afterNextRender(resolveFn, { injector }));
}
async function triggerResourceLoadingForHydration(dehydratedBlock) {
const { tNode, lView } = dehydratedBlock;
const lDetails = getLDeferBlockDetails(lView, tNode);
return new Promise((resolve) => {
onDeferBlockCompletion(lDetails, resolve);
triggerDeferBlock(2, lView, tNode);
});
}
function onDeferBlockCompletion(lDetails, callback) {
if (!Array.isArray(lDetails[ON_COMPLETE_FNS])) {
lDetails[ON_COMPLETE_FNS] = [];
}
lDetails[ON_COMPLETE_FNS].push(callback);
}
function shouldAttachTrigger(triggerType, lView, tNode) {
if (triggerType === 0) {
return shouldAttachRegularTrigger(lView, tNode);
} else if (triggerType === 2) {
return !shouldAttachRegularTrigger(lView, tNode);
}
return true;
}
function hasHydrateTriggers(flags) {
return flags != null && (flags & 1) === 1;
}
function shouldAttachRegularTrigger(lView, tNode) {
const injector = lView[INJECTOR];
const tDetails = getTDeferBlockDetails(lView[TVIEW], tNode);
const incrementalHydrationEnabled = isIncrementalHydrationEnabled(injector);
const _hasHydrateTriggers = hasHydrateTriggers(tDetails.flags);
if (false) {
return !incrementalHydrationEnabled || !_hasHydrateTriggers;
}
const lDetails = getLDeferBlockDetails(lView, tNode);
const wasServerSideRendered = lDetails[SSR_UNIQUE_ID] !== null;
if (_hasHydrateTriggers && wasServerSideRendered && incrementalHydrationEnabled) {
return false;
}
return true;
}
function getHydrateTriggers(tView, tNode) {
const tDetails = getTDeferBlockDetails(tView, tNode);
return tDetails.hydrateTriggers ??= /* @__PURE__ */ new Map();
}
function \u0275\u0275defer(index, primaryTmplIndex, dependencyResolverFn, loadingTmplIndex, placeholderTmplIndex, errorTmplIndex, loadingConfigIndex, placeholderConfigIndex, enableTimerScheduling, flags) {
const lView = getLView();
const tView = getTView();
const adjustedIndex = index + HEADER_OFFSET;
const tNode = declareNoDirectiveHostTemplate(lView, tView, index, null, 0, 0);
const injector = lView[INJECTOR];
if (tView.firstCreatePass) {
performanceMarkFeature("NgDefer");
if (ngDevMode) {
if (false) {
logHmrWarning(injector);
}
if (hasHydrateTriggers(flags)) {
assertIncrementalHydrationIsConfigured(injector);
}
}
const tDetails = {
primaryTmplIndex,
loadingTmplIndex: loadingTmplIndex ?? null,
placeholderTmplIndex: placeholderTmplIndex ?? null,
errorTmplIndex: errorTmplIndex ?? null,
placeholderBlockConfig: null,
loadingBlockConfig: null,
dependencyResolverFn: dependencyResolverFn ?? null,
loadingState: DeferDependenciesLoadingState.NOT_STARTED,
loadingPromise: null,
providers: null,
hydrateTriggers: null,
debug: null,
flags: flags ?? 0
};
enableTimerScheduling?.(tView, tDetails, placeholderConfigIndex, loadingConfigIndex);
setTDeferBlockDetails(tView, adjustedIndex, tDetails);
}
const lContainer = lView[adjustedIndex];
populateDehydratedViewsInLContainer(lContainer, tNode, lView);
let ssrBlockState = null;
let ssrUniqueId = null;
if (lContainer[DEHYDRATED_VIEWS]?.length > 0) {
const info = lContainer[DEHYDRATED_VIEWS][0].data;
ssrUniqueId = info[DEFER_BLOCK_ID] ?? null;
ssrBlockState = info[DEFER_BLOCK_STATE$1];
}
const lDetails = [
null,
// NEXT_DEFER_BLOCK_STATE
DeferBlockInternalState.Initial,
// DEFER_BLOCK_STATE
null,
// STATE_IS_FROZEN_UNTIL
null,
// LOADING_AFTER_CLEANUP_FN
null,
// TRIGGER_CLEANUP_FNS
null,
// PREFETCH_TRIGGER_CLEANUP_FNS
ssrUniqueId,
// SSR_UNIQUE_ID
ssrBlockState,
// SSR_BLOCK_STATE
null,
// ON_COMPLETE_FNS
null
// HYDRATE_TRIGGER_CLEANUP_FNS
];
setLDeferBlockDetails(lView, adjustedIndex, lDetails);
let registry2 = null;
if (ssrUniqueId !== null) {
registry2 = injector.get(DEHYDRATED_BLOCK_REGISTRY);
registry2.add(ssrUniqueId, { lView, tNode, lContainer });
}
const onLViewDestroy = () => {
invokeAllTriggerCleanupFns(lDetails);
if (ssrUniqueId !== null) {
registry2?.cleanup([ssrUniqueId]);
}
};
storeTriggerCleanupFn(0, lDetails, () => removeLViewOnDestroy(lView, onLViewDestroy));
storeLViewOnDestroy(lView, onLViewDestroy);
}
function \u0275\u0275deferWhen(rawValue) {
const lView = getLView();
const tNode = getSelectedTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, "when <expression>");
}
if (!shouldAttachTrigger(0, lView, tNode))
return;
const bindingIndex = nextBindingIndex();
if (bindingUpdated(lView, bindingIndex, rawValue)) {
const prevConsumer = setActiveConsumer(null);
try {
const value = Boolean(rawValue);
const lDetails = getLDeferBlockDetails(lView, tNode);
const renderedState = lDetails[DEFER_BLOCK_STATE];
if (value === false && renderedState === DeferBlockInternalState.Initial) {
renderPlaceholder(lView, tNode);
} else if (value === true && (renderedState === DeferBlockInternalState.Initial || renderedState === DeferBlockState.Placeholder)) {
triggerDeferBlock(0, lView, tNode);
}
} finally {
setActiveConsumer(prevConsumer);
}
}
}
function \u0275\u0275deferPrefetchWhen(rawValue) {
const lView = getLView();
const tNode = getSelectedTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, "prefetch when <expression>");
}
if (!shouldAttachTrigger(1, lView, tNode))
return;
const bindingIndex = nextBindingIndex();
if (bindingUpdated(lView, bindingIndex, rawValue)) {
const prevConsumer = setActiveConsumer(null);
try {
const value = Boolean(rawValue);
const tView = lView[TVIEW];
const tNode2 = getSelectedTNode();
const tDetails = getTDeferBlockDetails(tView, tNode2);
if (value === true && tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
triggerPrefetching(tDetails, lView, tNode2);
}
} finally {
setActiveConsumer(prevConsumer);
}
}
}
function \u0275\u0275deferHydrateWhen(rawValue) {
const lView = getLView();
const tNode = getSelectedTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, "hydrate when <expression>");
}
if (!shouldAttachTrigger(2, lView, tNode))
return;
const bindingIndex = nextBindingIndex();
const tView = getTView();
const hydrateTriggers = getHydrateTriggers(tView, tNode);
hydrateTriggers.set(6, null);
if (bindingUpdated(lView, bindingIndex, rawValue)) {
if (false) {
triggerDeferBlock(2, lView, tNode);
} else {
const injector = lView[INJECTOR];
const prevConsumer = setActiveConsumer(null);
try {
const value = Boolean(rawValue);
if (value === true) {
const lDetails = getLDeferBlockDetails(lView, tNode);
const ssrUniqueId = lDetails[SSR_UNIQUE_ID];
ngDevMode && assertSsrIdDefined(ssrUniqueId);
triggerHydrationFromBlockName(injector, ssrUniqueId);
}
} finally {
setActiveConsumer(prevConsumer);
}
}
}
}
function \u0275\u0275deferHydrateNever() {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, "hydrate never");
}
if (!shouldAttachTrigger(2, lView, tNode))
return;
const hydrateTriggers = getHydrateTriggers(getTView(), tNode);
hydrateTriggers.set(7, null);
if (false) {
triggerDeferBlock(2, lView, tNode);
}
}
function \u0275\u0275deferOnIdle() {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, "on idle");
}
if (!shouldAttachTrigger(0, lView, tNode))
return;
scheduleDelayedTrigger(onIdle);
}
function \u0275\u0275deferPrefetchOnIdle() {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, "prefetch on idle");
}
if (!shouldAttachTrigger(1, lView, tNode))
return;
scheduleDelayedPrefetching(onIdle);
}
function \u0275\u0275deferHydrateOnIdle() {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, "hydrate on idle");
}
if (!shouldAttachTrigger(2, lView, tNode))
return;
const hydrateTriggers = getHydrateTriggers(getTView(), tNode);
hydrateTriggers.set(0, null);
if (false) {
triggerDeferBlock(2, lView, tNode);
} else {
scheduleDelayedHydrating(onIdle, lView, tNode);
}
}
function \u0275\u0275deferOnImmediate() {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, "on immediate");
}
if (!shouldAttachTrigger(0, lView, tNode))
return;
const tDetails = getTDeferBlockDetails(lView[TVIEW], tNode);
if (tDetails.loadingTmplIndex === null) {
renderPlaceholder(lView, tNode);
}
triggerDeferBlock(0, lView, tNode);
}
function \u0275\u0275deferPrefetchOnImmediate() {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, "prefetch on immediate");
}
if (!shouldAttachTrigger(1, lView, tNode))
return;
const tView = lView[TVIEW];
const tDetails = getTDeferBlockDetails(tView, tNode);
if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
triggerResourceLoading(tDetails, lView, tNode);
}
}
function \u0275\u0275deferHydrateOnImmediate() {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, "hydrate on immediate");
}
if (!shouldAttachTrigger(2, lView, tNode))
return;
const hydrateTriggers = getHydrateTriggers(getTView(), tNode);
hydrateTriggers.set(1, null);
if (false) {
triggerDeferBlock(2, lView, tNode);
} else {
const injector = lView[INJECTOR];
const lDetails = getLDeferBlockDetails(lView, tNode);
const ssrUniqueId = lDetails[SSR_UNIQUE_ID];
ngDevMode && assertSsrIdDefined(ssrUniqueId);
triggerHydrationFromBlockName(injector, ssrUniqueId);
}
}
function \u0275\u0275deferOnTimer(delay) {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, `on timer(${delay}ms)`);
}
if (!shouldAttachTrigger(0, lView, tNode))
return;
scheduleDelayedTrigger(onTimer(delay));
}
function \u0275\u0275deferPrefetchOnTimer(delay) {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, `prefetch on timer(${delay}ms)`);
}
if (!shouldAttachTrigger(1, lView, tNode))
return;
scheduleDelayedPrefetching(onTimer(delay));
}
function \u0275\u0275deferHydrateOnTimer(delay) {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, `hydrate on timer(${delay}ms)`);
}
if (!shouldAttachTrigger(2, lView, tNode))
return;
const hydrateTriggers = getHydrateTriggers(getTView(), tNode);
hydrateTriggers.set(5, { delay });
if (false) {
triggerDeferBlock(2, lView, tNode);
} else {
scheduleDelayedHydrating(onTimer(delay), lView, tNode);
}
}
function \u0275\u0275deferOnHover(triggerIndex, walkUpTimes) {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, `on hover${walkUpTimes === -1 ? "" : "(<target>)"}`);
}
if (!shouldAttachTrigger(0, lView, tNode))
return;
renderPlaceholder(lView, tNode);
if (true) {
registerDomTrigger(
lView,
tNode,
triggerIndex,
walkUpTimes,
onHover,
() => triggerDeferBlock(0, lView, tNode),
0
/* TriggerType.Regular */
);
}
}
function \u0275\u0275deferPrefetchOnHover(triggerIndex, walkUpTimes) {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, `prefetch on hover${walkUpTimes === -1 ? "" : "(<target>)"}`);
}
if (!shouldAttachTrigger(1, lView, tNode))
return;
const tView = lView[TVIEW];
const tDetails = getTDeferBlockDetails(tView, tNode);
if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
registerDomTrigger(
lView,
tNode,
triggerIndex,
walkUpTimes,
onHover,
() => triggerPrefetching(tDetails, lView, tNode),
1
/* TriggerType.Prefetch */
);
}
}
function \u0275\u0275deferHydrateOnHover() {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, "hydrate on hover");
}
if (!shouldAttachTrigger(2, lView, tNode))
return;
const hydrateTriggers = getHydrateTriggers(getTView(), tNode);
hydrateTriggers.set(4, null);
if (false) {
triggerDeferBlock(2, lView, tNode);
}
}
function \u0275\u0275deferOnInteraction(triggerIndex, walkUpTimes) {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, `on interaction${walkUpTimes === -1 ? "" : "(<target>)"}`);
}
if (!shouldAttachTrigger(0, lView, tNode))
return;
renderPlaceholder(lView, tNode);
if (true) {
registerDomTrigger(
lView,
tNode,
triggerIndex,
walkUpTimes,
onInteraction,
() => triggerDeferBlock(0, lView, tNode),
0
/* TriggerType.Regular */
);
}
}
function \u0275\u0275deferPrefetchOnInteraction(triggerIndex, walkUpTimes) {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, `prefetch on interaction${walkUpTimes === -1 ? "" : "(<target>)"}`);
}
if (!shouldAttachTrigger(1, lView, tNode))
return;
const tView = lView[TVIEW];
const tDetails = getTDeferBlockDetails(tView, tNode);
if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
registerDomTrigger(
lView,
tNode,
triggerIndex,
walkUpTimes,
onInteraction,
() => triggerPrefetching(tDetails, lView, tNode),
1
/* TriggerType.Prefetch */
);
}
}
function \u0275\u0275deferHydrateOnInteraction() {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, "hydrate on interaction");
}
if (!shouldAttachTrigger(2, lView, tNode))
return;
const hydrateTriggers = getHydrateTriggers(getTView(), tNode);
hydrateTriggers.set(3, null);
if (false) {
triggerDeferBlock(2, lView, tNode);
}
}
function \u0275\u0275deferOnViewport(triggerIndex, walkUpTimes) {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, `on viewport${walkUpTimes === -1 ? "" : "(<target>)"}`);
}
if (!shouldAttachTrigger(0, lView, tNode))
return;
renderPlaceholder(lView, tNode);
if (true) {
registerDomTrigger(
lView,
tNode,
triggerIndex,
walkUpTimes,
onViewportWrapper,
() => triggerDeferBlock(0, lView, tNode),
0
/* TriggerType.Regular */
);
}
}
function \u0275\u0275deferPrefetchOnViewport(triggerIndex, walkUpTimes) {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, `prefetch on viewport${walkUpTimes === -1 ? "" : "(<target>)"}`);
}
if (!shouldAttachTrigger(1, lView, tNode))
return;
const tView = lView[TVIEW];
const tDetails = getTDeferBlockDetails(tView, tNode);
if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
registerDomTrigger(
lView,
tNode,
triggerIndex,
walkUpTimes,
onViewportWrapper,
() => triggerPrefetching(tDetails, lView, tNode),
1
/* TriggerType.Prefetch */
);
}
}
function \u0275\u0275deferHydrateOnViewport() {
const lView = getLView();
const tNode = getCurrentTNode();
if (ngDevMode) {
trackTriggerForDebugging(lView[TVIEW], tNode, "hydrate on viewport");
}
if (!shouldAttachTrigger(2, lView, tNode))
return;
const hydrateTriggers = getHydrateTriggers(getTView(), tNode);
hydrateTriggers.set(2, null);
if (false) {
triggerDeferBlock(2, lView, tNode);
}
}
var ARIA_PREFIX = "aria";
function \u0275\u0275ariaProperty(name, value) {
const lView = getLView();
const bindingIndex = nextBindingIndex();
if (bindingUpdated(lView, bindingIndex, value)) {
const tView = getTView();
const tNode = getSelectedTNode();
const hasSetInput = setAllInputsForProperty(tNode, tView, lView, name, value);
if (hasSetInput) {
isComponentHost(tNode) && markDirtyIfOnPush(lView, tNode.index);
ngDevMode && setNgReflectProperties(lView, tView, tNode, name, value);
} else {
ngDevMode && assertTNodeType(
tNode,
2
/* TNodeType.Element */
);
const element = getNativeByTNode(tNode, lView);
const attributeName = ariaAttrName(name);
setElementAttribute(lView[RENDERER], element, null, tNode.value, attributeName, value, null);
}
ngDevMode && storePropertyBindingMetadata(tView.data, tNode, name, bindingIndex);
}
return \u0275\u0275ariaProperty;
}
function ariaAttrName(name) {
return name.charAt(ARIA_PREFIX.length) !== "-" ? ARIA_PREFIX + "-" + name.slice(ARIA_PREFIX.length).toLowerCase() : name;
}
function \u0275\u0275attribute(name, value, sanitizer, namespace) {
const lView = getLView();
const bindingIndex = nextBindingIndex();
if (bindingUpdated(lView, bindingIndex, value)) {
const tView = getTView();
const tNode = getSelectedTNode();
elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
ngDevMode && storePropertyBindingMetadata(tView.data, tNode, "attr." + name, bindingIndex);
}
return \u0275\u0275attribute;
}
var ANIMATIONS_DISABLED = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "AnimationsDisabled" : "", {
providedIn: "root",
factory: () => false
});
var MAX_ANIMATION_TIMEOUT = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "MaxAnimationTimeout" : "", {
providedIn: "root",
factory: () => MAX_ANIMATION_TIMEOUT_DEFAULT
});
var MAX_ANIMATION_TIMEOUT_DEFAULT = 4e3;
var ElementRegistry = class {
outElements = /* @__PURE__ */ new WeakMap();
remove(el) {
this.outElements.delete(el);
}
/** Used when animate.leave is only applying classes */
trackClasses(details, classes) {
const classList = getClassListFromValue(classes);
if (!classList)
return;
for (let klass of classList) {
details.classes?.add(klass);
}
}
/** Used when animate.leave is applying classes via a bound attribute
* which requires resolving the binding function at the right time
* to get the proper class list. There may be multiple resolvers due
* to composition via host bindings.
*/
trackResolver(details, resolver) {
if (!details.classFns) {
details.classFns = [resolver];
} else {
details.classFns.push(resolver);
}
}
/** Used when `animate.leave` is using the function signature and will have a
* callback function, rather than a list of classes.
*/
addCallback(el, value, animateWrapperFn) {
const details = this.outElements.get(el) ?? {
classes: null,
animateFn: () => {
}
};
details.animateFn = animateWrapperFn(el, value);
this.outElements.set(el, details);
}
/** Used when `animate.leave` is using classes. */
add(el, value, animateWrapperFn) {
const details = this.outElements.get(el) ?? {
classes: /* @__PURE__ */ new Set(),
animateFn: () => {
}
};
if (typeof value === "function") {
this.trackResolver(details, value);
} else {
this.trackClasses(details, value);
}
details.animateFn = animateWrapperFn(el, details.classes, details.classFns);
this.outElements.set(el, details);
}
has(el) {
return this.outElements.has(el);
}
/** This is called by the dom renderer to actually initiate the animation
* using the animateFn stored in the registry. The DOM renderer passes in
* the removal function to be fired off when the animation finishes.
*/
animate(el, removeFn, maxAnimationTimeout) {
if (!this.outElements.has(el))
return removeFn();
const details = this.outElements.get(el);
let timeoutId;
let called = false;
const remove2 = () => {
if (called)
return;
called = true;
clearTimeout(timeoutId);
this.remove(el);
removeFn();
};
timeoutId = setTimeout(remove2, maxAnimationTimeout);
details.animateFn(remove2);
}
};
function getClassListFromValue(value) {
const classes = typeof value === "function" ? value() : value;
let classList = Array.isArray(classes) ? classes : null;
if (typeof classes === "string") {
classList = classes.trim().split(/\s+/).filter((k) => k);
}
return classList;
}
function parseCssTimeUnitsToMs(value) {
const multiplier = value.toLowerCase().indexOf("ms") > -1 ? 1 : 1e3;
return parseFloat(value) * multiplier;
}
function parseCssPropertyValue(computedStyle, name) {
const value = computedStyle.getPropertyValue(name);
return value.split(",").map((part) => part.trim());
}
function getLongestComputedTransition(computedStyle) {
const transitionedProperties = parseCssPropertyValue(computedStyle, "transition-property");
const rawDurations = parseCssPropertyValue(computedStyle, "transition-duration");
const rawDelays = parseCssPropertyValue(computedStyle, "transition-delay");
const longest = { propertyName: "", duration: 0, animationName: void 0 };
for (let i = 0; i < transitionedProperties.length; i++) {
const duration = parseCssTimeUnitsToMs(rawDelays[i]) + parseCssTimeUnitsToMs(rawDurations[i]);
if (duration > longest.duration) {
longest.propertyName = transitionedProperties[i];
longest.duration = duration;
}
}
return longest;
}
function getLongestComputedAnimation(computedStyle) {
const rawNames = parseCssPropertyValue(computedStyle, "animation-name");
const rawDelays = parseCssPropertyValue(computedStyle, "animation-delay");
const rawDurations = parseCssPropertyValue(computedStyle, "animation-duration");
const longest = { animationName: "", propertyName: void 0, duration: 0 };
for (let i = 0; i < rawNames.length; i++) {
const duration = parseCssTimeUnitsToMs(rawDelays[i]) + parseCssTimeUnitsToMs(rawDurations[i]);
if (duration > longest.duration) {
longest.animationName = rawNames[i];
longest.duration = duration;
}
}
return longest;
}
function isShorterThanExistingAnimation(existing, longest) {
return existing !== void 0 && existing.duration > longest.duration;
}
function longestExists(longest) {
return (longest.animationName != void 0 || longest.propertyName != void 0) && longest.duration > 0;
}
function determineLongestAnimationFromComputedStyles(el, animationsMap) {
const computedStyle = getComputedStyle(el);
const longestAnimation = getLongestComputedAnimation(computedStyle);
const longestTransition = getLongestComputedTransition(computedStyle);
const longest = longestAnimation.duration > longestTransition.duration ? longestAnimation : longestTransition;
if (isShorterThanExistingAnimation(animationsMap.get(el), longest))
return;
if (longestExists(longest)) {
animationsMap.set(el, longest);
}
}
function determineLongestAnimation(el, animationsMap, areAnimationSupported2) {
if (!areAnimationSupported2)
return;
const animations = el.getAnimations();
return animations.length === 0 ? (
// fallback to computed styles if getAnimations is empty. This would happen if styles are
// currently recalculating due to a reflow happening elsewhere.
determineLongestAnimationFromComputedStyles(el, animationsMap)
) : determineLongestAnimationFromElementAnimations(el, animationsMap, animations);
}
function determineLongestAnimationFromElementAnimations(el, animationsMap, animations) {
let longest = {
animationName: void 0,
propertyName: void 0,
duration: 0
};
for (const animation of animations) {
const timing = animation.effect?.getTiming();
const animDuration = typeof timing?.duration === "number" ? timing.duration : 0;
let duration = (timing?.delay ?? 0) + animDuration;
let propertyName;
let animationName;
if (animation.animationName) {
animationName = animation.animationName;
} else {
propertyName = animation.transitionProperty;
}
if (duration >= longest.duration) {
longest = { animationName, propertyName, duration };
}
}
if (isShorterThanExistingAnimation(animationsMap.get(el), longest))
return;
if (longestExists(longest)) {
animationsMap.set(el, longest);
}
}
var DEFAULT_ANIMATIONS_DISABLED = false;
var areAnimationSupported = typeof document !== "undefined" && // tslint:disable-next-line:no-toplevel-property-access
typeof document?.documentElement?.getAnimations === "function";
function areAnimationsDisabled(lView) {
const injector = lView[INJECTOR];
return injector.get(ANIMATIONS_DISABLED, DEFAULT_ANIMATIONS_DISABLED);
}
function setupElementRegistryCleanup(elementRegistry, lView, tView, nativeElement) {
if (lView[FLAGS] & 8) {
storeCleanupWithContext(tView, lView, nativeElement, (elToClean) => {
elementRegistry.elements.remove(elToClean);
});
}
}
function cleanupEnterClassData(element) {
const elementData = enterClassMap.get(element);
if (elementData) {
for (const fn of elementData.cleanupFns) {
fn();
}
enterClassMap.delete(element);
}
longestAnimations.delete(element);
}
var noOpAnimationComplete = () => {
};
var enterClassMap = /* @__PURE__ */ new WeakMap();
var longestAnimations = /* @__PURE__ */ new WeakMap();
var leavingNodes = /* @__PURE__ */ new WeakMap();
function clearLeavingNodes(tNode) {
if (leavingNodes.get(tNode)?.length === 0) {
leavingNodes.delete(tNode);
}
}
function trackLeavingNodes(tNode, el) {
if (leavingNodes.has(tNode)) {
leavingNodes.get(tNode)?.push(el);
} else {
leavingNodes.set(tNode, [el]);
}
}
function \u0275\u0275animateEnter(value) {
performanceMarkFeature("NgAnimateEnter");
if (!areAnimationSupported) {
return \u0275\u0275animateEnter;
}
ngDevMode && assertAnimationTypes(value, "animate.enter");
const lView = getLView();
if (areAnimationsDisabled(lView)) {
return \u0275\u0275animateEnter;
}
const tNode = getCurrentTNode();
const nativeElement = getNativeByTNode(tNode, lView);
const renderer = lView[RENDERER];
const ngZone = lView[INJECTOR].get(NgZone);
const activeClasses = getClassListFromValue(value);
const cleanupFns = [];
const handleAnimationStart = (event) => {
setupAnimationCancel(event, renderer);
const eventName = event instanceof AnimationEvent ? "animationend" : "transitionend";
ngZone.runOutsideAngular(() => {
cleanupFns.push(renderer.listen(nativeElement, eventName, handleInAnimationEnd));
});
};
const handleInAnimationEnd = (event) => {
animationEnd(event, nativeElement, renderer);
};
if (activeClasses && activeClasses.length > 0) {
ngZone.runOutsideAngular(() => {
cleanupFns.push(renderer.listen(nativeElement, "animationstart", handleAnimationStart));
cleanupFns.push(renderer.listen(nativeElement, "transitionstart", handleAnimationStart));
});
leavingNodes.get(tNode)?.pop()?.dispatchEvent(new CustomEvent("animationend", { detail: { cancel: true } }));
trackEnterClasses(nativeElement, activeClasses, cleanupFns);
for (const klass of activeClasses) {
renderer.addClass(nativeElement, klass);
}
ngZone.runOutsideAngular(() => {
requestAnimationFrame(() => {
determineLongestAnimation(nativeElement, longestAnimations, areAnimationSupported);
if (!longestAnimations.has(nativeElement)) {
for (const klass of activeClasses) {
renderer.removeClass(nativeElement, klass);
}
cleanupEnterClassData(nativeElement);
}
});
});
}
return \u0275\u0275animateEnter;
}
function trackEnterClasses(el, classList, cleanupFns) {
const elementData = enterClassMap.get(el);
if (elementData) {
for (const klass of classList) {
elementData.classList.push(klass);
}
for (const fn of cleanupFns) {
elementData.cleanupFns.push(fn);
}
} else {
enterClassMap.set(el, { classList, cleanupFns });
}
}
function \u0275\u0275animateEnterListener(value) {
performanceMarkFeature("NgAnimateEnter");
if (!areAnimationSupported) {
return \u0275\u0275animateEnterListener;
}
ngDevMode && assertAnimationTypes(value, "animate.enter");
const lView = getLView();
if (areAnimationsDisabled(lView)) {
return \u0275\u0275animateEnterListener;
}
const tNode = getCurrentTNode();
const nativeElement = getNativeByTNode(tNode, lView);
leavingNodes.get(tNode)?.pop()?.dispatchEvent(new CustomEvent("animationend", { detail: { cancel: true } }));
value.call(lView[CONTEXT], { target: nativeElement, animationComplete: noOpAnimationComplete });
return \u0275\u0275animateEnterListener;
}
function \u0275\u0275animateLeave(value) {
performanceMarkFeature("NgAnimateLeave");
if (!areAnimationSupported) {
return \u0275\u0275animateLeave;
}
ngDevMode && assertAnimationTypes(value, "animate.leave");
const lView = getLView();
const animationsDisabled = areAnimationsDisabled(lView);
if (animationsDisabled) {
return \u0275\u0275animateLeave;
}
const tView = getTView();
const tNode = getCurrentTNode();
const nativeElement = getNativeByTNode(tNode, lView);
const renderer = lView[RENDERER];
const elementRegistry = getAnimationElementRemovalRegistry();
ngDevMode && assertDefined(elementRegistry.elements, "Expected `ElementRegistry` to be present in animations subsystem");
const ngZone = lView[INJECTOR].get(NgZone);
const animate = (el, value2, resolvers) => {
return (removalFn) => {
animateLeaveClassRunner(el, tNode, getClassList(value2, resolvers), removalFn, renderer, animationsDisabled, ngZone);
};
};
setupElementRegistryCleanup(elementRegistry, lView, tView, nativeElement);
elementRegistry.elements.add(nativeElement, value, animate);
return \u0275\u0275animateLeave;
}
function \u0275\u0275animateLeaveListener(value) {
performanceMarkFeature("NgAnimateLeave");
if (!areAnimationSupported) {
return \u0275\u0275animateLeaveListener;
}
ngDevMode && assertAnimationTypes(value, "animate.leave");
const lView = getLView();
const tNode = getCurrentTNode();
const tView = getTView();
const nativeElement = getNativeByTNode(tNode, lView);
if (nativeElement.nodeType !== Node.ELEMENT_NODE) {
return \u0275\u0275animateLeaveListener;
}
const elementRegistry = getAnimationElementRemovalRegistry();
ngDevMode && assertDefined(elementRegistry.elements, "Expected `ElementRegistry` to be present in animations subsystem");
const renderer = lView[RENDERER];
const animationsDisabled = areAnimationsDisabled(lView);
const ngZone = lView[INJECTOR].get(NgZone);
const animate = (_el, value2) => {
return (removeFn) => {
if (animationsDisabled) {
removeFn();
} else {
const event = {
target: nativeElement,
animationComplete: () => {
clearLeavingNodes(tNode);
removeFn();
}
};
trackLeavingNodes(tNode, _el);
ngZone.runOutsideAngular(() => {
renderer.listen(_el, "animationend", () => removeFn(), { once: true });
});
value2.call(lView[CONTEXT], event);
}
};
};
setupElementRegistryCleanup(elementRegistry, lView, tView, nativeElement);
elementRegistry.elements.addCallback(nativeElement, value, animate);
return \u0275\u0275animateLeaveListener;
}
function getClassList(value, resolvers) {
const classList = new Set(value);
if (resolvers && resolvers.length) {
for (const resolverFn of resolvers) {
const resolvedValue = resolverFn();
if (resolvedValue instanceof Array) {
for (const rv of resolvedValue) {
classList.add(rv);
}
} else {
classList.add(resolvedValue);
}
}
}
return classList;
}
function cancelAnimationsIfRunning(element, renderer) {
if (!areAnimationSupported)
return;
const elementData = enterClassMap.get(element);
if (element.getAnimations().length > 0) {
for (const animation of element.getAnimations()) {
if (animation.playState === "running") {
animation.cancel();
}
}
} else {
if (elementData) {
for (const klass of elementData.classList) {
renderer.removeClass(element, klass);
}
}
}
cleanupEnterClassData(element);
}
function setupAnimationCancel(event, renderer) {
if (!(event.target instanceof Element))
return;
const nativeElement = event.target;
if (areAnimationSupported) {
const elementData = enterClassMap.get(nativeElement);
const animations = nativeElement.getAnimations();
if (animations.length === 0)
return;
for (let animation of animations) {
animation.addEventListener("cancel", (event2) => {
if (nativeElement === event2.target && elementData?.classList) {
for (const klass of elementData.classList) {
renderer.removeClass(nativeElement, klass);
}
}
});
}
}
}
function isLongestAnimation(event, nativeElement) {
const longestAnimation = longestAnimations.get(nativeElement);
return nativeElement === event.target && longestAnimation !== void 0 && (longestAnimation.animationName !== void 0 && event.animationName === longestAnimation.animationName || longestAnimation.propertyName !== void 0 && event.propertyName === longestAnimation.propertyName);
}
function animationEnd(event, nativeElement, renderer) {
const elementData = enterClassMap.get(nativeElement);
if (!elementData)
return;
if (isLongestAnimation(event, nativeElement)) {
event.stopImmediatePropagation();
for (const klass of elementData.classList) {
renderer.removeClass(nativeElement, klass);
}
cleanupEnterClassData(nativeElement);
}
}
function assertAnimationTypes(value, instruction) {
if (value == null || typeof value !== "string" && typeof value !== "function") {
throw new RuntimeError(650, `'${instruction}' value must be a string of CSS classes or an animation function, got ${stringify(value)}`);
}
}
function animateLeaveClassRunner(el, tNode, classList, finalRemoveFn, renderer, animationsDisabled, ngZone) {
if (animationsDisabled) {
longestAnimations.delete(el);
finalRemoveFn();
return;
}
cancelAnimationsIfRunning(el, renderer);
const handleOutAnimationEnd = (event) => {
if (event instanceof CustomEvent || isLongestAnimation(event, el)) {
event.stopImmediatePropagation();
longestAnimations.delete(el);
clearLeavingNodes(tNode);
finalRemoveFn();
}
};
ngZone.runOutsideAngular(() => {
renderer.listen(el, "animationend", handleOutAnimationEnd);
renderer.listen(el, "transitionend", handleOutAnimationEnd);
});
trackLeavingNodes(tNode, el);
for (const item of classList) {
renderer.addClass(el, item);
}
ngZone.runOutsideAngular(() => {
requestAnimationFrame(() => {
determineLongestAnimation(el, longestAnimations, areAnimationSupported);
if (!longestAnimations.has(el)) {
clearLeavingNodes(tNode);
finalRemoveFn();
}
});
});
}
function \u0275\u0275componentInstance() {
const instance = getLView()[DECLARATION_COMPONENT_VIEW][CONTEXT];
ngDevMode && assertDefined(instance, "Expected component instance to be defined");
return instance;
}
var LiveCollection = class {
destroy(item) {
}
updateValue(index, value) {
}
// operations below could be implemented on top of the operations defined so far, but having
// them explicitly allow clear expression of intent and potentially more performant
// implementations
swap(index1, index2) {
const startIdx = Math.min(index1, index2);
const endIdx = Math.max(index1, index2);
const endItem = this.detach(endIdx);
if (endIdx - startIdx > 1) {
const startItem = this.detach(startIdx);
this.attach(startIdx, endItem);
this.attach(endIdx, startItem);
} else {
this.attach(startIdx, endItem);
}
}
move(prevIndex, newIdx) {
this.attach(newIdx, this.detach(prevIndex));
}
};
function valuesMatching(liveIdx, liveValue, newIdx, newValue, trackBy) {
if (liveIdx === newIdx && Object.is(liveValue, newValue)) {
return 1;
} else if (Object.is(trackBy(liveIdx, liveValue), trackBy(newIdx, newValue))) {
return -1;
}
return 0;
}
function recordDuplicateKeys(keyToIdx, key, idx) {
const idxSoFar = keyToIdx.get(key);
if (idxSoFar !== void 0) {
idxSoFar.add(idx);
} else {
keyToIdx.set(key, /* @__PURE__ */ new Set([idx]));
}
}
function reconcile(liveCollection, newCollection, trackByFn) {
let detachedItems = void 0;
let liveKeysInTheFuture = void 0;
let liveStartIdx = 0;
let liveEndIdx = liveCollection.length - 1;
const duplicateKeys = ngDevMode ? /* @__PURE__ */ new Map() : void 0;
if (Array.isArray(newCollection)) {
let newEndIdx = newCollection.length - 1;
while (liveStartIdx <= liveEndIdx && liveStartIdx <= newEndIdx) {
const liveStartValue = liveCollection.at(liveStartIdx);
const newStartValue = newCollection[liveStartIdx];
if (ngDevMode) {
recordDuplicateKeys(duplicateKeys, trackByFn(liveStartIdx, newStartValue), liveStartIdx);
}
const isStartMatching = valuesMatching(liveStartIdx, liveStartValue, liveStartIdx, newStartValue, trackByFn);
if (isStartMatching !== 0) {
if (isStartMatching < 0) {
liveCollection.updateValue(liveStartIdx, newStartValue);
}
liveStartIdx++;
continue;
}
const liveEndValue = liveCollection.at(liveEndIdx);
const newEndValue = newCollection[newEndIdx];
if (ngDevMode) {
recordDuplicateKeys(duplicateKeys, trackByFn(newEndIdx, newEndValue), newEndIdx);
}
const isEndMatching = valuesMatching(liveEndIdx, liveEndValue, newEndIdx, newEndValue, trackByFn);
if (isEndMatching !== 0) {
if (isEndMatching < 0) {
liveCollection.updateValue(liveEndIdx, newEndValue);
}
liveEndIdx--;
newEndIdx--;
continue;
}
const liveStartKey = trackByFn(liveStartIdx, liveStartValue);
const liveEndKey = trackByFn(liveEndIdx, liveEndValue);
const newStartKey = trackByFn(liveStartIdx, newStartValue);
if (Object.is(newStartKey, liveEndKey)) {
const newEndKey = trackByFn(newEndIdx, newEndValue);
if (Object.is(newEndKey, liveStartKey)) {
liveCollection.swap(liveStartIdx, liveEndIdx);
liveCollection.updateValue(liveEndIdx, newEndValue);
newEndIdx--;
liveEndIdx--;
} else {
liveCollection.move(liveEndIdx, liveStartIdx);
}
liveCollection.updateValue(liveStartIdx, newStartValue);
liveStartIdx++;
continue;
}
detachedItems ??= new UniqueValueMultiKeyMap();
liveKeysInTheFuture ??= initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);
if (attachPreviouslyDetached(liveCollection, detachedItems, liveStartIdx, newStartKey)) {
liveCollection.updateValue(liveStartIdx, newStartValue);
liveStartIdx++;
liveEndIdx++;
} else if (!liveKeysInTheFuture.has(newStartKey)) {
const newItem = liveCollection.create(liveStartIdx, newCollection[liveStartIdx]);
liveCollection.attach(liveStartIdx, newItem);
liveStartIdx++;
liveEndIdx++;
} else {
detachedItems.set(liveStartKey, liveCollection.detach(liveStartIdx));
liveEndIdx--;
}
}
while (liveStartIdx <= newEndIdx) {
createOrAttach(liveCollection, detachedItems, trackByFn, liveStartIdx, newCollection[liveStartIdx]);
liveStartIdx++;
}
} else if (newCollection != null) {
const newCollectionIterator = newCollection[Symbol.iterator]();
let newIterationResult = newCollectionIterator.next();
while (!newIterationResult.done && liveStartIdx <= liveEndIdx) {
const liveValue = liveCollection.at(liveStartIdx);
const newValue = newIterationResult.value;
if (ngDevMode) {
recordDuplicateKeys(duplicateKeys, trackByFn(liveStartIdx, newValue), liveStartIdx);
}
const isStartMatching = valuesMatching(liveStartIdx, liveValue, liveStartIdx, newValue, trackByFn);
if (isStartMatching !== 0) {
if (isStartMatching < 0) {
liveCollection.updateValue(liveStartIdx, newValue);
}
liveStartIdx++;
newIterationResult = newCollectionIterator.next();
} else {
detachedItems ??= new UniqueValueMultiKeyMap();
liveKeysInTheFuture ??= initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);
const newKey = trackByFn(liveStartIdx, newValue);
if (attachPreviouslyDetached(liveCollection, detachedItems, liveStartIdx, newKey)) {
liveCollection.updateValue(liveStartIdx, newValue);
liveStartIdx++;
liveEndIdx++;
newIterationResult = newCollectionIterator.next();
} else if (!liveKeysInTheFuture.has(newKey)) {
liveCollection.attach(liveStartIdx, liveCollection.create(liveStartIdx, newValue));
liveStartIdx++;
liveEndIdx++;
newIterationResult = newCollectionIterator.next();
} else {
const liveKey = trackByFn(liveStartIdx, liveValue);
detachedItems.set(liveKey, liveCollection.detach(liveStartIdx));
liveEndIdx--;
}
}
}
while (!newIterationResult.done) {
createOrAttach(liveCollection, detachedItems, trackByFn, liveCollection.length, newIterationResult.value);
newIterationResult = newCollectionIterator.next();
}
}
while (liveStartIdx <= liveEndIdx) {
liveCollection.destroy(liveCollection.detach(liveEndIdx--));
}
detachedItems?.forEach((item) => {
liveCollection.destroy(item);
});
if (ngDevMode) {
let duplicatedKeysMsg = [];
for (const [key, idxSet] of duplicateKeys) {
if (idxSet.size > 1) {
const idx = [...idxSet].sort((a, b) => a - b);
for (let i = 1; i < idx.length; i++) {
duplicatedKeysMsg.push(`key "${stringifyForError(key)}" at index "${idx[i - 1]}" and "${idx[i]}"`);
}
}
}
if (duplicatedKeysMsg.length > 0) {
const message = formatRuntimeError(-955, "The provided track expression resulted in duplicated keys for a given collection. Adjust the tracking expression such that it uniquely identifies all the items in the collection. Duplicated keys were: \n" + duplicatedKeysMsg.join(", \n") + ".");
console.warn(message);
}
}
}
function attachPreviouslyDetached(prevCollection, detachedItems, index, key) {
if (detachedItems !== void 0 && detachedItems.has(key)) {
prevCollection.attach(index, detachedItems.get(key));
detachedItems.delete(key);
return true;
}
return false;
}
function createOrAttach(liveCollection, detachedItems, trackByFn, index, value) {
if (!attachPreviouslyDetached(liveCollection, detachedItems, index, trackByFn(index, value))) {
const newItem = liveCollection.create(index, value);
liveCollection.attach(index, newItem);
} else {
liveCollection.updateValue(index, value);
}
}
function initLiveItemsInTheFuture(liveCollection, start, end, trackByFn) {
const keys = /* @__PURE__ */ new Set();
for (let i = start; i <= end; i++) {
keys.add(trackByFn(i, liveCollection.at(i)));
}
return keys;
}
var UniqueValueMultiKeyMap = class {
// A map from a key to the first value corresponding to this key.
kvMap = /* @__PURE__ */ new Map();
// A map that acts as a linked list of values - each value maps to the next value in this "linked
// list" (this only works if values are unique). Allocated lazily to avoid memory consumption when
// there are no duplicated values.
_vMap = void 0;
has(key) {
return this.kvMap.has(key);
}
delete(key) {
if (!this.has(key))
return false;
const value = this.kvMap.get(key);
if (this._vMap !== void 0 && this._vMap.has(value)) {
this.kvMap.set(key, this._vMap.get(value));
this._vMap.delete(value);
} else {
this.kvMap.delete(key);
}
return true;
}
get(key) {
return this.kvMap.get(key);
}
set(key, value) {
if (this.kvMap.has(key)) {
let prevValue = this.kvMap.get(key);
if (ngDevMode && prevValue === value) {
throw new Error(`Detected a duplicated value ${value} for the key ${key}`);
}
if (this._vMap === void 0) {
this._vMap = /* @__PURE__ */ new Map();
}
const vMap = this._vMap;
while (vMap.has(prevValue)) {
prevValue = vMap.get(prevValue);
}
vMap.set(prevValue, value);
} else {
this.kvMap.set(key, value);
}
}
forEach(cb) {
for (let [key, value] of this.kvMap) {
cb(value, key);
if (this._vMap !== void 0) {
const vMap = this._vMap;
while (vMap.has(value)) {
value = vMap.get(value);
cb(value, key);
}
}
}
}
};
function \u0275\u0275conditionalCreate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {
performanceMarkFeature("NgControlFlow");
const lView = getLView();
const tView = getTView();
const attrs = getConstant(tView.consts, attrsIndex);
declareNoDirectiveHostTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, 256, localRefsIndex, localRefExtractor);
return \u0275\u0275conditionalBranchCreate;
}
function \u0275\u0275conditionalBranchCreate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {
performanceMarkFeature("NgControlFlow");
const lView = getLView();
const tView = getTView();
const attrs = getConstant(tView.consts, attrsIndex);
declareNoDirectiveHostTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, 512, localRefsIndex, localRefExtractor);
return \u0275\u0275conditionalBranchCreate;
}
function \u0275\u0275conditional(matchingTemplateIndex, contextValue) {
performanceMarkFeature("NgControlFlow");
const hostLView = getLView();
const bindingIndex = nextBindingIndex();
const prevMatchingTemplateIndex = hostLView[bindingIndex] !== NO_CHANGE ? hostLView[bindingIndex] : -1;
const prevContainer = prevMatchingTemplateIndex !== -1 ? getLContainer(hostLView, HEADER_OFFSET + prevMatchingTemplateIndex) : void 0;
const viewInContainerIdx = 0;
if (bindingUpdated(hostLView, bindingIndex, matchingTemplateIndex)) {
const prevConsumer = setActiveConsumer(null);
try {
if (prevContainer !== void 0) {
removeLViewFromLContainer(prevContainer, viewInContainerIdx);
}
if (matchingTemplateIndex !== -1) {
const nextLContainerIndex = HEADER_OFFSET + matchingTemplateIndex;
const nextContainer = getLContainer(hostLView, nextLContainerIndex);
const templateTNode = getExistingTNode(hostLView[TVIEW], nextLContainerIndex);
const dehydratedView = findAndReconcileMatchingDehydratedViews(nextContainer, templateTNode, hostLView);
const embeddedLView = createAndRenderEmbeddedLView(hostLView, templateTNode, contextValue, {
dehydratedView
});
addLViewToLContainer(nextContainer, embeddedLView, viewInContainerIdx, shouldAddViewToDom(templateTNode, dehydratedView));
}
} finally {
setActiveConsumer(prevConsumer);
}
} else if (prevContainer !== void 0) {
const lView = getLViewFromLContainer(prevContainer, viewInContainerIdx);
if (lView !== void 0) {
lView[CONTEXT] = contextValue;
}
}
}
var RepeaterContext = class {
lContainer;
$implicit;
$index;
constructor(lContainer, $implicit, $index) {
this.lContainer = lContainer;
this.$implicit = $implicit;
this.$index = $index;
}
get $count() {
return this.lContainer.length - CONTAINER_HEADER_OFFSET;
}
};
function \u0275\u0275repeaterTrackByIndex(index) {
return index;
}
function \u0275\u0275repeaterTrackByIdentity(_, value) {
return value;
}
var RepeaterMetadata = class {
hasEmptyBlock;
trackByFn;
liveCollection;
constructor(hasEmptyBlock, trackByFn, liveCollection) {
this.hasEmptyBlock = hasEmptyBlock;
this.trackByFn = trackByFn;
this.liveCollection = liveCollection;
}
};
function \u0275\u0275repeaterCreate(index, templateFn, decls, vars, tagName, attrsIndex, trackByFn, trackByUsesComponentInstance, emptyTemplateFn, emptyDecls, emptyVars, emptyTagName, emptyAttrsIndex) {
performanceMarkFeature("NgControlFlow");
ngDevMode && assertFunction(trackByFn, `A track expression must be a function, was ${typeof trackByFn} instead.`);
const lView = getLView();
const tView = getTView();
const hasEmptyBlock = emptyTemplateFn !== void 0;
const hostLView = getLView();
const boundTrackBy = trackByUsesComponentInstance ? (
// We only want to bind when necessary, because it produces a
// new function. For pure functions it's not necessary.
trackByFn.bind(hostLView[DECLARATION_COMPONENT_VIEW][CONTEXT])
) : trackByFn;
const metadata = new RepeaterMetadata(hasEmptyBlock, boundTrackBy);
hostLView[HEADER_OFFSET + index] = metadata;
declareNoDirectiveHostTemplate(
lView,
tView,
index + 1,
templateFn,
decls,
vars,
tagName,
getConstant(tView.consts, attrsIndex),
256
/* TNodeFlags.isControlFlowStart */
);
if (hasEmptyBlock) {
ngDevMode && assertDefined(emptyDecls, "Missing number of declarations for the empty repeater block.");
ngDevMode && assertDefined(emptyVars, "Missing number of bindings for the empty repeater block.");
declareNoDirectiveHostTemplate(
lView,
tView,
index + 2,
emptyTemplateFn,
emptyDecls,
emptyVars,
emptyTagName,
getConstant(tView.consts, emptyAttrsIndex),
512
/* TNodeFlags.isInControlFlow */
);
}
}
function isViewExpensiveToRecreate(lView) {
return lView.length - HEADER_OFFSET > 2;
}
var OperationsCounter = class {
created = 0;
destroyed = 0;
reset() {
this.created = 0;
this.destroyed = 0;
}
recordCreate() {
this.created++;
}
recordDestroy() {
this.destroyed++;
}
/**
* A method indicating if the entire collection was re-created as part of the reconciliation pass.
* Used to warn developers about the usage of a tracking function that might result in excessive
* amount of view creation / destroy operations.
*
* @returns boolean value indicating if a live collection was re-created
*/
wasReCreated(collectionLen) {
return collectionLen > 0 && this.created === this.destroyed && this.created === collectionLen;
}
};
var LiveCollectionLContainerImpl = class extends LiveCollection {
lContainer;
hostLView;
templateTNode;
operationsCounter = ngDevMode ? new OperationsCounter() : void 0;
/**
Property indicating if indexes in the repeater context need to be updated following the live
collection changes. Index updates are necessary if and only if views are inserted / removed in
the middle of LContainer. Adds and removals at the end don't require index updates.
*/
needsIndexUpdate = false;
constructor(lContainer, hostLView, templateTNode) {
super();
this.lContainer = lContainer;
this.hostLView = hostLView;
this.templateTNode = templateTNode;
}
get length() {
return this.lContainer.length - CONTAINER_HEADER_OFFSET;
}
at(index) {
return this.getLView(index)[CONTEXT].$implicit;
}
attach(index, lView) {
const dehydratedView = lView[HYDRATION];
this.needsIndexUpdate ||= index !== this.length;
addLViewToLContainer(this.lContainer, lView, index, shouldAddViewToDom(this.templateTNode, dehydratedView));
}
detach(index) {
this.needsIndexUpdate ||= index !== this.length - 1;
return detachExistingView(this.lContainer, index);
}
create(index, value) {
const dehydratedView = findMatchingDehydratedView(this.lContainer, this.templateTNode.tView.ssrId);
const embeddedLView = createAndRenderEmbeddedLView(this.hostLView, this.templateTNode, new RepeaterContext(this.lContainer, value, index), { dehydratedView });
this.operationsCounter?.recordCreate();
return embeddedLView;
}
destroy(lView) {
destroyLView(lView[TVIEW], lView);
this.operationsCounter?.recordDestroy();
}
updateValue(index, value) {
this.getLView(index)[CONTEXT].$implicit = value;
}
reset() {
this.needsIndexUpdate = false;
this.operationsCounter?.reset();
}
updateIndexes() {
if (this.needsIndexUpdate) {
for (let i = 0; i < this.length; i++) {
this.getLView(i)[CONTEXT].$index = i;
}
}
}
getLView(index) {
return getExistingLViewFromLContainer(this.lContainer, index);
}
};
function \u0275\u0275repeater(collection) {
const prevConsumer = setActiveConsumer(null);
const metadataSlotIdx = getSelectedIndex();
try {
const hostLView = getLView();
const hostTView = hostLView[TVIEW];
const metadata = hostLView[metadataSlotIdx];
const containerIndex = metadataSlotIdx + 1;
const lContainer = getLContainer(hostLView, containerIndex);
if (metadata.liveCollection === void 0) {
const itemTemplateTNode = getExistingTNode(hostTView, containerIndex);
metadata.liveCollection = new LiveCollectionLContainerImpl(lContainer, hostLView, itemTemplateTNode);
} else {
metadata.liveCollection.reset();
}
const liveCollection = metadata.liveCollection;
reconcile(liveCollection, collection, metadata.trackByFn);
if (ngDevMode && metadata.trackByFn === \u0275\u0275repeaterTrackByIdentity && liveCollection.operationsCounter?.wasReCreated(liveCollection.length) && isViewExpensiveToRecreate(getExistingLViewFromLContainer(lContainer, 0))) {
const message = formatRuntimeError(-956, `The configured tracking expression (track by identity) caused re-creation of the entire collection of size ${liveCollection.length}. This is an expensive operation requiring destruction and subsequent creation of DOM nodes, directives, components etc. Please review the "track expression" and make sure that it uniquely identifies items in a collection.`);
console.warn(message);
}
liveCollection.updateIndexes();
if (metadata.hasEmptyBlock) {
const bindingIndex = nextBindingIndex();
const isCollectionEmpty = liveCollection.length === 0;
if (bindingUpdated(hostLView, bindingIndex, isCollectionEmpty)) {
const emptyTemplateIndex = metadataSlotIdx + 2;
const lContainerForEmpty = getLContainer(hostLView, emptyTemplateIndex);
if (isCollectionEmpty) {
const emptyTemplateTNode = getExistingTNode(hostTView, emptyTemplateIndex);
const dehydratedView = findAndReconcileMatchingDehydratedViews(lContainerForEmpty, emptyTemplateTNode, hostLView);
const embeddedLView = createAndRenderEmbeddedLView(hostLView, emptyTemplateTNode, void 0, { dehydratedView });
addLViewToLContainer(lContainerForEmpty, embeddedLView, 0, shouldAddViewToDom(emptyTemplateTNode, dehydratedView));
} else {
if (hostTView.firstUpdatePass) {
removeDehydratedViews(lContainerForEmpty);
}
removeLViewFromLContainer(lContainerForEmpty, 0);
}
}
}
} finally {
setActiveConsumer(prevConsumer);
}
}
function getLContainer(lView, index) {
const lContainer = lView[index];
ngDevMode && assertLContainer(lContainer);
return lContainer;
}
function detachExistingView(lContainer, index) {
const existingLView = detachView(lContainer, index);
ngDevMode && assertLView(existingLView);
return existingLView;
}
function getExistingLViewFromLContainer(lContainer, index) {
const existingLView = getLViewFromLContainer(lContainer, index);
ngDevMode && assertLView(existingLView);
return existingLView;
}
function getExistingTNode(tView, index) {
const tNode = getTNode(tView, index);
ngDevMode && assertTNode(tNode);
return tNode;
}
function \u0275\u0275property(propName, value, sanitizer) {
const lView = getLView();
const bindingIndex = nextBindingIndex();
if (bindingUpdated(lView, bindingIndex, value)) {
const tView = getTView();
const tNode = getSelectedTNode();
setPropertyAndInputs(tNode, lView, propName, value, lView[RENDERER], sanitizer);
ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
}
return \u0275\u0275property;
}
function setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased) {
setAllInputsForProperty(tNode, tView, lView, isClassBased ? "class" : "style", value);
}
function \u0275\u0275elementStart(index, name, attrsIndex, localRefsIndex) {
const lView = getLView();
ngDevMode && assertTNodeCreationIndex(lView, index);
const tView = lView[TVIEW];
const adjustedIndex = index + HEADER_OFFSET;
const tNode = tView.firstCreatePass ? directiveHostFirstCreatePass(adjustedIndex, lView, 2, name, findDirectiveDefMatches, getBindingsEnabled(), attrsIndex, localRefsIndex) : tView.data[adjustedIndex];
elementLikeStartShared(tNode, lView, index, name, _locateOrCreateElementNode);
if (isDirectiveHost(tNode)) {
const tView2 = lView[TVIEW];
createDirectivesInstances(tView2, lView, tNode);
executeContentQueries(tView2, tNode, lView);
}
if (localRefsIndex != null) {
saveResolvedLocalsInData(lView, tNode);
}
if (ngDevMode && lView[TVIEW].firstCreatePass) {
validateElementIsKnown(lView, tNode);
}
return \u0275\u0275elementStart;
}
function \u0275\u0275elementEnd() {
const tView = getTView();
const initialTNode = getCurrentTNode();
ngDevMode && assertDefined(initialTNode, "No parent node to close.");
const currentTNode = elementLikeEndShared(initialTNode);
ngDevMode && assertTNodeType(
currentTNode,
3
/* TNodeType.AnyRNode */
);
if (tView.firstCreatePass) {
directiveHostEndFirstCreatePass(tView, currentTNode);
}
if (isSkipHydrationRootTNode(currentTNode)) {
leaveSkipHydrationBlock();
}
decreaseElementDepthCount();
if (currentTNode.classesWithoutHost != null && hasClassInput(currentTNode)) {
setDirectiveInputsWhichShadowsStyling(tView, currentTNode, getLView(), currentTNode.classesWithoutHost, true);
}
if (currentTNode.stylesWithoutHost != null && hasStyleInput(currentTNode)) {
setDirectiveInputsWhichShadowsStyling(tView, currentTNode, getLView(), currentTNode.stylesWithoutHost, false);
}
return \u0275\u0275elementEnd;
}
function \u0275\u0275element(index, name, attrsIndex, localRefsIndex) {
\u0275\u0275elementStart(index, name, attrsIndex, localRefsIndex);
\u0275\u0275elementEnd();
return \u0275\u0275element;
}
function \u0275\u0275domElementStart(index, name, attrsIndex, localRefsIndex) {
const lView = getLView();
ngDevMode && assertTNodeCreationIndex(lView, index);
const tView = lView[TVIEW];
const adjustedIndex = index + HEADER_OFFSET;
const tNode = tView.firstCreatePass ? domOnlyFirstCreatePass(adjustedIndex, tView, 2, name, attrsIndex, localRefsIndex) : tView.data[adjustedIndex];
elementLikeStartShared(tNode, lView, index, name, _locateOrCreateElementNode);
if (localRefsIndex != null) {
saveResolvedLocalsInData(lView, tNode);
}
if (ngDevMode && lView[TVIEW].firstCreatePass) {
validateElementIsKnown(lView, tNode);
}
return \u0275\u0275domElementStart;
}
function \u0275\u0275domElementEnd() {
const initialTNode = getCurrentTNode();
ngDevMode && assertDefined(initialTNode, "No parent node to close.");
const currentTNode = elementLikeEndShared(initialTNode);
ngDevMode && assertTNodeType(
currentTNode,
3
/* TNodeType.AnyRNode */
);
if (isSkipHydrationRootTNode(currentTNode)) {
leaveSkipHydrationBlock();
}
decreaseElementDepthCount();
return \u0275\u0275domElementEnd;
}
function \u0275\u0275domElement(index, name, attrsIndex, localRefsIndex) {
\u0275\u0275domElementStart(index, name, attrsIndex, localRefsIndex);
\u0275\u0275domElementEnd();
return \u0275\u0275domElement;
}
var _locateOrCreateElementNode = (tView, lView, tNode, name, index) => {
lastNodeWasCreated(true);
return createElementNode(lView[RENDERER], name, getNamespace());
};
function \u0275\u0275elementContainerStart(index, attrsIndex, localRefsIndex) {
const lView = getLView();
ngDevMode && assertTNodeCreationIndex(lView, index);
const tView = lView[TVIEW];
const adjustedIndex = index + HEADER_OFFSET;
const tNode = tView.firstCreatePass ? directiveHostFirstCreatePass(adjustedIndex, lView, 8, "ng-container", findDirectiveDefMatches, getBindingsEnabled(), attrsIndex, localRefsIndex) : tView.data[adjustedIndex];
elementLikeStartShared(tNode, lView, index, "ng-container", _locateOrCreateElementContainerNode);
if (isDirectiveHost(tNode)) {
const tView2 = lView[TVIEW];
createDirectivesInstances(tView2, lView, tNode);
executeContentQueries(tView2, tNode, lView);
}
if (localRefsIndex != null) {
saveResolvedLocalsInData(lView, tNode);
}
return \u0275\u0275elementContainerStart;
}
function \u0275\u0275elementContainerEnd() {
const tView = getTView();
const initialTNode = getCurrentTNode();
ngDevMode && assertDefined(initialTNode, "No parent node to close.");
const currentTNode = elementLikeEndShared(initialTNode);
if (tView.firstCreatePass) {
directiveHostEndFirstCreatePass(tView, currentTNode);
}
ngDevMode && assertTNodeType(
currentTNode,
8
/* TNodeType.ElementContainer */
);
return \u0275\u0275elementContainerEnd;
}
function \u0275\u0275elementContainer(index, attrsIndex, localRefsIndex) {
\u0275\u0275elementContainerStart(index, attrsIndex, localRefsIndex);
\u0275\u0275elementContainerEnd();
return \u0275\u0275elementContainer;
}
function \u0275\u0275domElementContainerStart(index, attrsIndex, localRefsIndex) {
const lView = getLView();
ngDevMode && assertTNodeCreationIndex(lView, index);
const tView = lView[TVIEW];
const adjustedIndex = index + HEADER_OFFSET;
const tNode = tView.firstCreatePass ? domOnlyFirstCreatePass(adjustedIndex, tView, 8, "ng-container", attrsIndex, localRefsIndex) : tView.data[adjustedIndex];
elementLikeStartShared(tNode, lView, index, "ng-container", _locateOrCreateElementContainerNode);
if (localRefsIndex != null) {
saveResolvedLocalsInData(lView, tNode);
}
return \u0275\u0275domElementContainerStart;
}
function \u0275\u0275domElementContainerEnd() {
const initialTNode = getCurrentTNode();
ngDevMode && assertDefined(initialTNode, "No parent node to close.");
const currentTNode = elementLikeEndShared(initialTNode);
ngDevMode && assertTNodeType(
currentTNode,
8
/* TNodeType.ElementContainer */
);
return \u0275\u0275elementContainerEnd;
}
function \u0275\u0275domElementContainer(index, attrsIndex, localRefsIndex) {
\u0275\u0275domElementContainerStart(index, attrsIndex, localRefsIndex);
\u0275\u0275domElementContainerEnd();
return \u0275\u0275domElementContainer;
}
var _locateOrCreateElementContainerNode = (tView, lView, tNode, commentText, index) => {
lastNodeWasCreated(true);
return createCommentNode(lView[RENDERER], ngDevMode ? commentText : "");
};
function \u0275\u0275getCurrentView() {
return getLView();
}
function \u0275\u0275domProperty(propName, value, sanitizer) {
const lView = getLView();
const bindingIndex = nextBindingIndex();
if (bindingUpdated(lView, bindingIndex, value)) {
const tView = getTView();
const tNode = getSelectedTNode();
setDomProperty(tNode, lView, propName, value, lView[RENDERER], sanitizer);
ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
}
return \u0275\u0275domProperty;
}
function \u0275\u0275syntheticHostProperty(propName, value, sanitizer) {
const lView = getLView();
const bindingIndex = nextBindingIndex();
if (bindingUpdated(lView, bindingIndex, value)) {
const tView = getTView();
const tNode = getSelectedTNode();
const currentDef = getCurrentDirectiveDef(tView.data);
const renderer = loadComponentRenderer(currentDef, tNode, lView);
setDomProperty(tNode, lView, propName, value, renderer, sanitizer);
ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
}
return \u0275\u0275syntheticHostProperty;
}
var u = void 0;
function plural(val) {
const i = Math.floor(Math.abs(val)), v = val.toString().replace(/^[^.]*\.?/, "").length;
if (i === 1 && v === 0)
return 1;
return 5;
}
var localeEn = ["en", [["a", "p"], ["AM", "PM"], u], [["AM", "PM"], u, u], [["S", "M", "T", "W", "T", "F", "S"], ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]], u, [["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]], u, [["B", "A"], ["BC", "AD"], ["Before Christ", "Anno Domini"]], 0, [6, 0], ["M/d/yy", "MMM d, y", "MMMM d, y", "EEEE, MMMM d, y"], ["h:mm a", "h:mm:ss a", "h:mm:ss a z", "h:mm:ss a zzzz"], ["{1}, {0}", u, "{1} 'at' {0}", u], [".", ",", ";", "%", "+", "-", "E", "\xD7", "\u2030", "\u221E", "NaN", ":"], ["#,##0.###", "#,##0%", "\xA4#,##0.00", "#E0"], "USD", "$", "US Dollar", {}, "ltr", plural];
var LOCALE_DATA = {};
function findLocaleData(locale) {
const normalizedLocale = normalizeLocale(locale);
let match = getLocaleData(normalizedLocale);
if (match) {
return match;
}
const parentLocale = normalizedLocale.split("-")[0];
match = getLocaleData(parentLocale);
if (match) {
return match;
}
if (parentLocale === "en") {
return localeEn;
}
throw new RuntimeError(701, ngDevMode && `Missing locale data for the locale "${locale}".`);
}
function getLocalePluralCase(locale) {
const data = findLocaleData(locale);
return data[LocaleDataIndex.PluralCase];
}
function getLocaleData(normalizedLocale) {
if (!(normalizedLocale in LOCALE_DATA)) {
LOCALE_DATA[normalizedLocale] = _global.ng && _global.ng.common && _global.ng.common.locales && _global.ng.common.locales[normalizedLocale];
}
return LOCALE_DATA[normalizedLocale];
}
var LocaleDataIndex;
(function(LocaleDataIndex2) {
LocaleDataIndex2[LocaleDataIndex2["LocaleId"] = 0] = "LocaleId";
LocaleDataIndex2[LocaleDataIndex2["DayPeriodsFormat"] = 1] = "DayPeriodsFormat";
LocaleDataIndex2[LocaleDataIndex2["DayPeriodsStandalone"] = 2] = "DayPeriodsStandalone";
LocaleDataIndex2[LocaleDataIndex2["DaysFormat"] = 3] = "DaysFormat";
LocaleDataIndex2[LocaleDataIndex2["DaysStandalone"] = 4] = "DaysStandalone";
LocaleDataIndex2[LocaleDataIndex2["MonthsFormat"] = 5] = "MonthsFormat";
LocaleDataIndex2[LocaleDataIndex2["MonthsStandalone"] = 6] = "MonthsStandalone";
LocaleDataIndex2[LocaleDataIndex2["Eras"] = 7] = "Eras";
LocaleDataIndex2[LocaleDataIndex2["FirstDayOfWeek"] = 8] = "FirstDayOfWeek";
LocaleDataIndex2[LocaleDataIndex2["WeekendRange"] = 9] = "WeekendRange";
LocaleDataIndex2[LocaleDataIndex2["DateFormat"] = 10] = "DateFormat";
LocaleDataIndex2[LocaleDataIndex2["TimeFormat"] = 11] = "TimeFormat";
LocaleDataIndex2[LocaleDataIndex2["DateTimeFormat"] = 12] = "DateTimeFormat";
LocaleDataIndex2[LocaleDataIndex2["NumberSymbols"] = 13] = "NumberSymbols";
LocaleDataIndex2[LocaleDataIndex2["NumberFormats"] = 14] = "NumberFormats";
LocaleDataIndex2[LocaleDataIndex2["CurrencyCode"] = 15] = "CurrencyCode";
LocaleDataIndex2[LocaleDataIndex2["CurrencySymbol"] = 16] = "CurrencySymbol";
LocaleDataIndex2[LocaleDataIndex2["CurrencyName"] = 17] = "CurrencyName";
LocaleDataIndex2[LocaleDataIndex2["Currencies"] = 18] = "Currencies";
LocaleDataIndex2[LocaleDataIndex2["Directionality"] = 19] = "Directionality";
LocaleDataIndex2[LocaleDataIndex2["PluralCase"] = 20] = "PluralCase";
LocaleDataIndex2[LocaleDataIndex2["ExtraData"] = 21] = "ExtraData";
})(LocaleDataIndex || (LocaleDataIndex = {}));
function normalizeLocale(locale) {
return locale.toLowerCase().replace(/_/g, "-");
}
var pluralMapping = ["zero", "one", "two", "few", "many"];
function getPluralCase(value, locale) {
const plural2 = getLocalePluralCase(locale)(parseInt(value, 10));
const result = pluralMapping[plural2];
return result !== void 0 ? result : "other";
}
var DEFAULT_LOCALE_ID = "en-US";
var USD_CURRENCY_CODE = "USD";
var ELEMENT_MARKER = {
marker: "element"
};
var ICU_MARKER = {
marker: "ICU"
};
var I18nCreateOpCode;
(function(I18nCreateOpCode2) {
I18nCreateOpCode2[I18nCreateOpCode2["SHIFT"] = 2] = "SHIFT";
I18nCreateOpCode2[I18nCreateOpCode2["APPEND_EAGERLY"] = 1] = "APPEND_EAGERLY";
I18nCreateOpCode2[I18nCreateOpCode2["COMMENT"] = 2] = "COMMENT";
})(I18nCreateOpCode || (I18nCreateOpCode = {}));
var LOCALE_ID$1 = DEFAULT_LOCALE_ID;
function setLocaleId(localeId) {
ngDevMode && assertDefined(localeId, `Expected localeId to be defined`);
if (typeof localeId === "string") {
LOCALE_ID$1 = localeId.toLowerCase().replace(/_/g, "-");
}
}
function getLocaleId() {
return LOCALE_ID$1;
}
var changeMask = 0;
var changeMaskCounter = 0;
function setMaskBit(hasChange) {
if (hasChange) {
changeMask = changeMask | 1 << Math.min(changeMaskCounter, 31);
}
changeMaskCounter++;
}
function applyI18n(tView, lView, index) {
if (changeMaskCounter > 0) {
ngDevMode && assertDefined(tView, `tView should be defined`);
const tI18n = tView.data[index];
const updateOpCodes = Array.isArray(tI18n) ? tI18n : tI18n.update;
const bindingsStartIndex = getBindingIndex() - changeMaskCounter - 1;
applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask);
}
changeMask = 0;
changeMaskCounter = 0;
}
function createNodeWithoutHydration(lView, textOrName, nodeType) {
const renderer = lView[RENDERER];
switch (nodeType) {
case Node.COMMENT_NODE:
return createCommentNode(renderer, textOrName);
case Node.TEXT_NODE:
return createTextNode(renderer, textOrName);
case Node.ELEMENT_NODE:
return createElementNode(renderer, textOrName, null);
}
}
var _locateOrCreateNode = (lView, index, textOrName, nodeType) => {
lastNodeWasCreated(true);
return createNodeWithoutHydration(lView, textOrName, nodeType);
};
function applyCreateOpCodes(lView, createOpCodes, parentRNode, insertInFrontOf) {
const renderer = lView[RENDERER];
for (let i = 0; i < createOpCodes.length; i++) {
const opCode = createOpCodes[i++];
const text = createOpCodes[i];
const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;
const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;
const index = opCode >>> I18nCreateOpCode.SHIFT;
let rNode = lView[index];
let lastNodeWasCreated2 = false;
if (rNode === null) {
rNode = lView[index] = _locateOrCreateNode(lView, index, text, isComment ? Node.COMMENT_NODE : Node.TEXT_NODE);
lastNodeWasCreated2 = wasLastNodeCreated();
}
if (appendNow && parentRNode !== null && lastNodeWasCreated2) {
nativeInsertBefore(renderer, parentRNode, rNode, insertInFrontOf, false);
}
}
}
function applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {
ngDevMode && assertDomNode(anchorRNode);
const renderer = lView[RENDERER];
let rootIdx = null;
let rootRNode;
for (let i = 0; i < mutableOpCodes.length; i++) {
const opCode = mutableOpCodes[i];
if (typeof opCode == "string") {
const textNodeIndex = mutableOpCodes[++i];
if (lView[textNodeIndex] === null) {
ngDevMode && assertIndexInRange(lView, textNodeIndex);
lView[textNodeIndex] = _locateOrCreateNode(lView, textNodeIndex, opCode, Node.TEXT_NODE);
}
} else if (typeof opCode == "number") {
switch (opCode & 1) {
case 0:
const parentIdx = getParentFromIcuCreateOpCode(opCode);
if (rootIdx === null) {
rootIdx = parentIdx;
rootRNode = renderer.parentNode(anchorRNode);
}
let insertInFrontOf;
let parentRNode;
if (parentIdx === rootIdx) {
insertInFrontOf = anchorRNode;
parentRNode = rootRNode;
} else {
insertInFrontOf = null;
parentRNode = unwrapRNode(lView[parentIdx]);
}
if (parentRNode !== null) {
ngDevMode && assertDomNode(parentRNode);
const refIdx = getRefFromIcuCreateOpCode(opCode);
ngDevMode && assertGreaterThan(refIdx, HEADER_OFFSET, "Missing ref");
const child = lView[refIdx];
ngDevMode && assertDomNode(child);
nativeInsertBefore(renderer, parentRNode, child, insertInFrontOf, false);
const tIcu = getTIcu(tView, refIdx);
if (tIcu !== null && typeof tIcu === "object") {
ngDevMode && assertTIcu(tIcu);
const caseIndex = getCurrentICUCaseIndex(tIcu, lView);
if (caseIndex !== null) {
applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, lView[tIcu.anchorIdx]);
}
}
}
break;
case 1:
const elementNodeIndex = opCode >>> 1;
const attrName = mutableOpCodes[++i];
const attrValue = mutableOpCodes[++i];
setElementAttribute(renderer, getNativeByIndex(elementNodeIndex, lView), null, null, attrName, attrValue, null);
break;
default:
if (ngDevMode) {
throw new RuntimeError(700, `Unable to determine the type of mutate operation for "${opCode}"`);
}
}
} else {
switch (opCode) {
case ICU_MARKER:
const commentValue = mutableOpCodes[++i];
const commentNodeIndex = mutableOpCodes[++i];
if (lView[commentNodeIndex] === null) {
ngDevMode && assertEqual(typeof commentValue, "string", `Expected "${commentValue}" to be a comment node value`);
ngDevMode && assertIndexInExpandoRange(lView, commentNodeIndex);
const commentRNode = lView[commentNodeIndex] = _locateOrCreateNode(lView, commentNodeIndex, commentValue, Node.COMMENT_NODE);
attachPatchData(commentRNode, lView);
}
break;
case ELEMENT_MARKER:
const tagName = mutableOpCodes[++i];
const elementNodeIndex = mutableOpCodes[++i];
if (lView[elementNodeIndex] === null) {
ngDevMode && assertEqual(typeof tagName, "string", `Expected "${tagName}" to be an element node tag name`);
ngDevMode && assertIndexInExpandoRange(lView, elementNodeIndex);
const elementRNode = lView[elementNodeIndex] = _locateOrCreateNode(lView, elementNodeIndex, tagName, Node.ELEMENT_NODE);
attachPatchData(elementRNode, lView);
}
break;
default:
ngDevMode && throwError2(`Unable to determine the type of mutate operation for "${opCode}"`);
}
}
}
}
function applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask2) {
for (let i = 0; i < updateOpCodes.length; i++) {
const checkBit = updateOpCodes[i];
const skipCodes = updateOpCodes[++i];
if (checkBit & changeMask2) {
let value = "";
for (let j = i + 1; j <= i + skipCodes; j++) {
const opCode = updateOpCodes[j];
if (typeof opCode == "string") {
value += opCode;
} else if (typeof opCode == "number") {
if (opCode < 0) {
value += renderStringify(lView[bindingsStartIndex - opCode]);
} else {
const nodeIndex = opCode >>> 2;
switch (opCode & 3) {
case 1:
const propName = updateOpCodes[++j];
const sanitizeFn = updateOpCodes[++j];
const tNodeOrTagName = tView.data[nodeIndex];
ngDevMode && assertDefined(tNodeOrTagName, "Experting TNode or string");
if (typeof tNodeOrTagName === "string") {
setElementAttribute(lView[RENDERER], lView[nodeIndex], null, tNodeOrTagName, propName, value, sanitizeFn);
} else {
setPropertyAndInputs(tNodeOrTagName, lView, propName, value, lView[RENDERER], sanitizeFn);
}
break;
case 0:
const rText = lView[nodeIndex];
rText !== null && updateTextNode(lView[RENDERER], rText, value);
break;
case 2:
applyIcuSwitchCase(tView, getTIcu(tView, nodeIndex), lView, value);
break;
case 3:
applyIcuUpdateCase(tView, getTIcu(tView, nodeIndex), bindingsStartIndex, lView);
break;
}
}
}
}
} else {
const opCode = updateOpCodes[i + 1];
if (opCode > 0 && (opCode & 3) === 3) {
const nodeIndex = opCode >>> 2;
const tIcu = getTIcu(tView, nodeIndex);
const currentIndex = lView[tIcu.currentCaseLViewIndex];
if (currentIndex < 0) {
applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView);
}
}
}
i += skipCodes;
}
}
function applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView) {
ngDevMode && assertIndexInRange(lView, tIcu.currentCaseLViewIndex);
let activeCaseIndex = lView[tIcu.currentCaseLViewIndex];
if (activeCaseIndex !== null) {
let mask = changeMask;
if (activeCaseIndex < 0) {
activeCaseIndex = lView[tIcu.currentCaseLViewIndex] = ~activeCaseIndex;
mask = -1;
}
applyUpdateOpCodes(tView, lView, tIcu.update[activeCaseIndex], bindingsStartIndex, mask);
}
}
function applyIcuSwitchCase(tView, tIcu, lView, value) {
const caseIndex = getCaseIndex(tIcu, value);
let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);
if (activeCaseIndex !== caseIndex) {
applyIcuSwitchCaseRemove(tView, tIcu, lView);
lView[tIcu.currentCaseLViewIndex] = caseIndex === null ? null : ~caseIndex;
if (caseIndex !== null) {
const anchorRNode = lView[tIcu.anchorIdx];
if (anchorRNode) {
ngDevMode && assertDomNode(anchorRNode);
applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, anchorRNode);
}
claimDehydratedIcuCase(lView, tIcu.anchorIdx, caseIndex);
}
}
}
function applyIcuSwitchCaseRemove(tView, tIcu, lView) {
let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);
if (activeCaseIndex !== null) {
const removeCodes = tIcu.remove[activeCaseIndex];
for (let i = 0; i < removeCodes.length; i++) {
const nodeOrIcuIndex = removeCodes[i];
if (nodeOrIcuIndex > 0) {
const rNode = getNativeByIndex(nodeOrIcuIndex, lView);
rNode !== null && nativeRemoveNode(lView[RENDERER], rNode);
} else {
applyIcuSwitchCaseRemove(tView, getTIcu(tView, ~nodeOrIcuIndex), lView);
}
}
}
}
function getCaseIndex(icuExpression, bindingValue) {
let index = icuExpression.cases.indexOf(bindingValue);
if (index === -1) {
switch (icuExpression.type) {
case 1: {
const resolvedCase = getPluralCase(bindingValue, getLocaleId());
index = icuExpression.cases.indexOf(resolvedCase);
if (index === -1 && resolvedCase !== "other") {
index = icuExpression.cases.indexOf("other");
}
break;
}
case 0: {
index = icuExpression.cases.indexOf("other");
break;
}
}
}
return index === -1 ? null : index;
}
function i18nCreateOpCodesToString(opcodes) {
const createOpCodes = opcodes || (Array.isArray(this) ? this : []);
let lines = [];
for (let i = 0; i < createOpCodes.length; i++) {
const opCode = createOpCodes[i++];
const text = createOpCodes[i];
const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;
const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;
const index = opCode >>> I18nCreateOpCode.SHIFT;
lines.push(`lView[${index}] = document.${isComment ? "createComment" : "createText"}(${JSON.stringify(text)});`);
if (appendNow) {
lines.push(`parent.appendChild(lView[${index}]);`);
}
}
return lines;
}
function i18nUpdateOpCodesToString(opcodes) {
const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));
let lines = [];
function consumeOpCode(value) {
const ref = value >>> 2;
const opCode = value & 3;
switch (opCode) {
case 0:
return `(lView[${ref}] as Text).textContent = $$$`;
case 1:
const attrName = parser.consumeString();
const sanitizationFn = parser.consumeFunction();
const value2 = sanitizationFn ? `(${sanitizationFn})($$$)` : "$$$";
return `(lView[${ref}] as Element).setAttribute('${attrName}', ${value2})`;
case 2:
return `icuSwitchCase(${ref}, $$$)`;
case 3:
return `icuUpdateCase(${ref})`;
}
throw new Error("unexpected OpCode");
}
while (parser.hasMore()) {
let mask = parser.consumeNumber();
let size = parser.consumeNumber();
const end = parser.i + size;
const statements = [];
let statement = "";
while (parser.i < end) {
let value = parser.consumeNumberOrString();
if (typeof value === "string") {
statement += value;
} else if (value < 0) {
statement += "${lView[i" + value + "]}";
} else {
const opCodeText = consumeOpCode(value);
statements.push(opCodeText.replace("$$$", "`" + statement + "`") + ";");
statement = "";
}
}
lines.push(`if (mask & 0b${mask.toString(2)}) { ${statements.join(" ")} }`);
}
return lines;
}
function icuCreateOpCodesToString(opcodes) {
const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));
let lines = [];
function consumeOpCode(opCode) {
const parent = getParentFromIcuCreateOpCode(opCode);
const ref = getRefFromIcuCreateOpCode(opCode);
switch (getInstructionFromIcuCreateOpCode(opCode)) {
case 0:
return `(lView[${parent}] as Element).appendChild(lView[${lastRef}])`;
case 1:
return `(lView[${ref}] as Element).setAttribute("${parser.consumeString()}", "${parser.consumeString()}")`;
}
throw new Error("Unexpected OpCode: " + getInstructionFromIcuCreateOpCode(opCode));
}
let lastRef = -1;
while (parser.hasMore()) {
let value = parser.consumeNumberStringOrMarker();
if (value === ICU_MARKER) {
const text = parser.consumeString();
lastRef = parser.consumeNumber();
lines.push(`lView[${lastRef}] = document.createComment("${text}")`);
} else if (value === ELEMENT_MARKER) {
const text = parser.consumeString();
lastRef = parser.consumeNumber();
lines.push(`lView[${lastRef}] = document.createElement("${text}")`);
} else if (typeof value === "string") {
lastRef = parser.consumeNumber();
lines.push(`lView[${lastRef}] = document.createTextNode("${value}")`);
} else if (typeof value === "number") {
const line = consumeOpCode(value);
line && lines.push(line);
} else {
throw new Error("Unexpected value");
}
}
return lines;
}
function i18nRemoveOpCodesToString(opcodes) {
const removeCodes = opcodes || (Array.isArray(this) ? this : []);
let lines = [];
for (let i = 0; i < removeCodes.length; i++) {
const nodeOrIcuIndex = removeCodes[i];
if (nodeOrIcuIndex > 0) {
lines.push(`remove(lView[${nodeOrIcuIndex}])`);
} else {
lines.push(`removeNestedICU(${~nodeOrIcuIndex})`);
}
}
return lines;
}
var OpCodeParser = class {
i = 0;
codes;
constructor(codes) {
this.codes = codes;
}
hasMore() {
return this.i < this.codes.length;
}
consumeNumber() {
let value = this.codes[this.i++];
assertNumber(value, "expecting number in OpCode");
return value;
}
consumeString() {
let value = this.codes[this.i++];
assertString(value, "expecting string in OpCode");
return value;
}
consumeFunction() {
let value = this.codes[this.i++];
if (value === null || typeof value === "function") {
return value;
}
throw new Error("expecting function in OpCode");
}
consumeNumberOrString() {
let value = this.codes[this.i++];
if (typeof value === "string") {
return value;
}
assertNumber(value, "expecting number or string in OpCode");
return value;
}
consumeNumberStringOrMarker() {
let value = this.codes[this.i++];
if (typeof value === "string" || typeof value === "number" || value == ICU_MARKER || value == ELEMENT_MARKER) {
return value;
}
assertNumber(value, "expecting number, string, ICU_MARKER or ELEMENT_MARKER in OpCode");
return value;
}
};
var BINDING_REGEXP = /�(\d+):?\d*�/gi;
var ICU_REGEXP = /({\s*�\d+:?\d*�\s*,\s*\S{6}\s*,[\s\S]*})/gi;
var NESTED_ICU = /�(\d+)�/;
var ICU_BLOCK_REGEXP = /^\s*(�\d+:?\d*�)\s*,\s*(select|plural)\s*,/;
var MARKER = `\uFFFD`;
var SUBTEMPLATE_REGEXP = /�\/?\*(\d+:\d+)�/gi;
var PH_REGEXP = /�(\/?[#*]\d+):?\d*�/gi;
var NGSP_UNICODE_REGEXP = /\uE500/g;
function replaceNgsp(value) {
return value.replace(NGSP_UNICODE_REGEXP, " ");
}
function attachDebugGetter(obj, debugGetter) {
if (ngDevMode) {
Object.defineProperty(obj, "debug", { get: debugGetter, enumerable: false });
} else {
throw new Error("This method should be guarded with `ngDevMode` so that it can be tree shaken in production!");
}
}
function i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message, subTemplateIndex) {
const rootTNode = getCurrentParentTNode();
const createOpCodes = [];
const updateOpCodes = [];
const existingTNodeStack = [[]];
const astStack = [[]];
if (ngDevMode) {
attachDebugGetter(createOpCodes, i18nCreateOpCodesToString);
attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);
}
message = getTranslationForTemplate(message, subTemplateIndex);
const msgParts = replaceNgsp(message).split(PH_REGEXP);
for (let i = 0; i < msgParts.length; i++) {
let value = msgParts[i];
if ((i & 1) === 0) {
const parts = i18nParseTextIntoPartsAndICU(value);
for (let j = 0; j < parts.length; j++) {
let part = parts[j];
if ((j & 1) === 0) {
const text = part;
ngDevMode && assertString(text, "Parsed ICU part should be string");
if (text !== "") {
i18nStartFirstCreatePassProcessTextNode(astStack[0], tView, rootTNode, existingTNodeStack[0], createOpCodes, updateOpCodes, lView, text);
}
} else {
const icuExpression = part;
if (typeof icuExpression !== "object") {
throw new Error(`Unable to parse ICU expression in "${message}" message.`);
}
const icuContainerTNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodeStack[0], lView, createOpCodes, ngDevMode ? `ICU ${index}:${icuExpression.mainBinding}` : "", true);
const icuNodeIndex = icuContainerTNode.index;
ngDevMode && assertGreaterThanOrEqual(icuNodeIndex, HEADER_OFFSET, "Index must be in absolute LView offset");
icuStart(astStack[0], tView, lView, updateOpCodes, parentTNodeIndex, icuExpression, icuNodeIndex);
}
}
} else {
const isClosing = value.charCodeAt(0) === 47;
const type = value.charCodeAt(isClosing ? 1 : 0);
ngDevMode && assertOneOf(
type,
42,
35
/* CharCode.HASH */
);
const index2 = HEADER_OFFSET + Number.parseInt(value.substring(isClosing ? 2 : 1));
if (isClosing) {
existingTNodeStack.shift();
astStack.shift();
setCurrentTNode(getCurrentParentTNode(), false);
} else {
const tNode = createTNodePlaceholder(tView, existingTNodeStack[0], index2);
existingTNodeStack.unshift([]);
setCurrentTNode(tNode, true);
const placeholderNode = {
kind: 2,
index: index2,
children: [],
type: type === 35 ? 0 : 1
};
astStack[0].push(placeholderNode);
astStack.unshift(placeholderNode.children);
}
}
}
tView.data[index] = {
create: createOpCodes,
update: updateOpCodes,
ast: astStack[0],
parentTNodeIndex
};
}
function createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, text, isICU) {
const i18nNodeIdx = allocExpando(tView, lView, 1, null);
let opCode = i18nNodeIdx << I18nCreateOpCode.SHIFT;
let parentTNode = getCurrentParentTNode();
if (rootTNode === parentTNode) {
parentTNode = null;
}
if (parentTNode === null) {
opCode |= I18nCreateOpCode.APPEND_EAGERLY;
}
if (isICU) {
opCode |= I18nCreateOpCode.COMMENT;
ensureIcuContainerVisitorLoaded(loadIcuContainerVisitor);
}
createOpCodes.push(opCode, text === null ? "" : text);
const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 : 1, text === null ? ngDevMode ? "{{?}}" : "" : text, null);
addTNodeAndUpdateInsertBeforeIndex(existingTNodes, tNode);
const tNodeIdx = tNode.index;
setCurrentTNode(
tNode,
false
/* Text nodes are self closing */
);
if (parentTNode !== null && rootTNode !== parentTNode) {
setTNodeInsertBeforeIndex(parentTNode, tNodeIdx);
}
return tNode;
}
function i18nStartFirstCreatePassProcessTextNode(ast, tView, rootTNode, existingTNodes, createOpCodes, updateOpCodes, lView, text) {
const hasBinding = text.match(BINDING_REGEXP);
const tNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, hasBinding ? null : text, false);
const index = tNode.index;
if (hasBinding) {
generateBindingUpdateOpCodes(updateOpCodes, text, index, null, 0, null);
}
ast.push({ kind: 0, index });
}
function i18nAttributesFirstPass(tView, index, values) {
const previousElement = getCurrentTNode();
const previousElementIndex = previousElement.index;
const updateOpCodes = [];
if (ngDevMode) {
attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);
}
if (tView.firstCreatePass && tView.data[index] === null) {
for (let i = 0; i < values.length; i += 2) {
const attrName = values[i];
const message = values[i + 1];
if (message !== "") {
if (ICU_REGEXP.test(message)) {
throw new Error(`ICU expressions are not supported in attributes. Message: "${message}".`);
}
generateBindingUpdateOpCodes(updateOpCodes, message, previousElementIndex, attrName, countBindings(updateOpCodes), null);
}
}
tView.data[index] = updateOpCodes;
}
}
function generateBindingUpdateOpCodes(updateOpCodes, str, destinationNode, attrName, bindingStart, sanitizeFn) {
ngDevMode && assertGreaterThanOrEqual(destinationNode, HEADER_OFFSET, "Index must be in absolute LView offset");
const maskIndex = updateOpCodes.length;
const sizeIndex = maskIndex + 1;
updateOpCodes.push(null, null);
const startIndex = maskIndex + 2;
if (ngDevMode) {
attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);
}
const textParts = str.split(BINDING_REGEXP);
let mask = 0;
for (let j = 0; j < textParts.length; j++) {
const textValue = textParts[j];
if (j & 1) {
const bindingIndex = bindingStart + parseInt(textValue, 10);
updateOpCodes.push(-1 - bindingIndex);
mask = mask | toMaskBit(bindingIndex);
} else if (textValue !== "") {
updateOpCodes.push(textValue);
}
}
updateOpCodes.push(destinationNode << 2 | (attrName ? 1 : 0));
if (attrName) {
updateOpCodes.push(attrName, sanitizeFn);
}
updateOpCodes[maskIndex] = mask;
updateOpCodes[sizeIndex] = updateOpCodes.length - startIndex;
return mask;
}
function countBindings(opCodes) {
let count = 0;
for (let i = 0; i < opCodes.length; i++) {
const opCode = opCodes[i];
if (typeof opCode === "number" && opCode < 0) {
count++;
}
}
return count;
}
function toMaskBit(bindingIndex) {
return 1 << Math.min(bindingIndex, 31);
}
function removeInnerTemplateTranslation(message) {
let match;
let res = "";
let index = 0;
let inTemplate = false;
let tagMatched;
while ((match = SUBTEMPLATE_REGEXP.exec(message)) !== null) {
if (!inTemplate) {
res += message.substring(index, match.index + match[0].length);
tagMatched = match[1];
inTemplate = true;
} else {
if (match[0] === `${MARKER}/*${tagMatched}${MARKER}`) {
index = match.index;
inTemplate = false;
}
}
}
ngDevMode && assertEqual(inTemplate, false, `Tag mismatch: unable to find the end of the sub-template in the translation "${message}"`);
res += message.slice(index);
return res;
}
function getTranslationForTemplate(message, subTemplateIndex) {
if (isRootTemplateMessage(subTemplateIndex)) {
return removeInnerTemplateTranslation(message);
} else {
const start = message.indexOf(`:${subTemplateIndex}${MARKER}`) + 2 + subTemplateIndex.toString().length;
const end = message.search(new RegExp(`${MARKER}\\/\\*\\d+:${subTemplateIndex}${MARKER}`));
return removeInnerTemplateTranslation(message.substring(start, end));
}
}
function icuStart(ast, tView, lView, updateOpCodes, parentIdx, icuExpression, anchorIdx) {
ngDevMode && assertDefined(icuExpression, "ICU expression must be defined");
let bindingMask = 0;
const tIcu = {
type: icuExpression.type,
currentCaseLViewIndex: allocExpando(tView, lView, 1, null),
anchorIdx,
cases: [],
create: [],
remove: [],
update: []
};
addUpdateIcuSwitch(updateOpCodes, icuExpression, anchorIdx);
setTIcu(tView, anchorIdx, tIcu);
const values = icuExpression.values;
const cases = [];
for (let i = 0; i < values.length; i++) {
const valueArr = values[i];
const nestedIcus = [];
for (let j = 0; j < valueArr.length; j++) {
const value = valueArr[j];
if (typeof value !== "string") {
const icuIndex = nestedIcus.push(value) - 1;
valueArr[j] = `<!--\uFFFD${icuIndex}\uFFFD-->`;
}
}
const caseAst = [];
cases.push(caseAst);
bindingMask = parseIcuCase(caseAst, tView, tIcu, lView, updateOpCodes, parentIdx, icuExpression.cases[i], valueArr.join(""), nestedIcus) | bindingMask;
}
if (bindingMask) {
addUpdateIcuUpdate(updateOpCodes, bindingMask, anchorIdx);
}
ast.push({
kind: 3,
index: anchorIdx,
cases,
currentCaseLViewIndex: tIcu.currentCaseLViewIndex
});
}
function parseICUBlock(pattern) {
const cases = [];
const values = [];
let icuType = 1;
let mainBinding = 0;
pattern = pattern.replace(ICU_BLOCK_REGEXP, function(str, binding, type) {
if (type === "select") {
icuType = 0;
} else {
icuType = 1;
}
mainBinding = parseInt(binding.slice(1), 10);
return "";
});
const parts = i18nParseTextIntoPartsAndICU(pattern);
for (let pos = 0; pos < parts.length; ) {
let key = parts[pos++].trim();
if (icuType === 1) {
key = key.replace(/\s*(?:=)?(\w+)\s*/, "$1");
}
if (key.length) {
cases.push(key);
}
const blocks = i18nParseTextIntoPartsAndICU(parts[pos++]);
if (cases.length > values.length) {
values.push(blocks);
}
}
return { type: icuType, mainBinding, cases, values };
}
function i18nParseTextIntoPartsAndICU(pattern) {
if (!pattern) {
return [];
}
let prevPos = 0;
const braceStack = [];
const results = [];
const braces = /[{}]/g;
braces.lastIndex = 0;
let match;
while (match = braces.exec(pattern)) {
const pos = match.index;
if (match[0] == "}") {
braceStack.pop();
if (braceStack.length == 0) {
const block = pattern.substring(prevPos, pos);
if (ICU_BLOCK_REGEXP.test(block)) {
results.push(parseICUBlock(block));
} else {
results.push(block);
}
prevPos = pos + 1;
}
} else {
if (braceStack.length == 0) {
const substring2 = pattern.substring(prevPos, pos);
results.push(substring2);
prevPos = pos + 1;
}
braceStack.push("{");
}
}
const substring = pattern.substring(prevPos);
results.push(substring);
return results;
}
function parseIcuCase(ast, tView, tIcu, lView, updateOpCodes, parentIdx, caseName, unsafeCaseHtml, nestedIcus) {
const create = [];
const remove2 = [];
const update = [];
if (ngDevMode) {
attachDebugGetter(create, icuCreateOpCodesToString);
attachDebugGetter(remove2, i18nRemoveOpCodesToString);
attachDebugGetter(update, i18nUpdateOpCodesToString);
}
tIcu.cases.push(caseName);
tIcu.create.push(create);
tIcu.remove.push(remove2);
tIcu.update.push(update);
const inertBodyHelper2 = getInertBodyHelper(getDocument());
const inertBodyElement = inertBodyHelper2.getInertBodyElement(unsafeCaseHtml);
ngDevMode && assertDefined(inertBodyElement, "Unable to generate inert body element");
const inertRootNode = getTemplateContent(inertBodyElement) || inertBodyElement;
if (inertRootNode) {
return walkIcuTree(ast, tView, tIcu, lView, updateOpCodes, create, remove2, update, inertRootNode, parentIdx, nestedIcus, 0);
} else {
return 0;
}
}
function walkIcuTree(ast, tView, tIcu, lView, sharedUpdateOpCodes, create, remove2, update, parentNode, parentIdx, nestedIcus, depth) {
let bindingMask = 0;
let currentNode = parentNode.firstChild;
while (currentNode) {
const newIndex = allocExpando(tView, lView, 1, null);
switch (currentNode.nodeType) {
case Node.ELEMENT_NODE:
const element = currentNode;
const tagName = element.tagName.toLowerCase();
if (VALID_ELEMENTS.hasOwnProperty(tagName)) {
addCreateNodeAndAppend(create, ELEMENT_MARKER, tagName, parentIdx, newIndex);
tView.data[newIndex] = tagName;
const elAttrs = element.attributes;
for (let i = 0; i < elAttrs.length; i++) {
const attr = elAttrs.item(i);
const lowerAttrName = attr.name.toLowerCase();
const hasBinding2 = !!attr.value.match(BINDING_REGEXP);
if (hasBinding2) {
if (VALID_ATTRS.hasOwnProperty(lowerAttrName)) {
if (URI_ATTRS[lowerAttrName]) {
generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, _sanitizeUrl);
} else {
generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, null);
}
} else {
ngDevMode && console.warn(`WARNING: ignoring unsafe attribute value ${lowerAttrName} on element ${tagName} (see ${XSS_SECURITY_URL})`);
}
} else {
addCreateAttribute(create, newIndex, attr);
}
}
const elementNode = {
kind: 1,
index: newIndex,
children: []
};
ast.push(elementNode);
bindingMask = walkIcuTree(elementNode.children, tView, tIcu, lView, sharedUpdateOpCodes, create, remove2, update, currentNode, newIndex, nestedIcus, depth + 1) | bindingMask;
addRemoveNode(remove2, newIndex, depth);
}
break;
case Node.TEXT_NODE:
const value = currentNode.textContent || "";
const hasBinding = value.match(BINDING_REGEXP);
addCreateNodeAndAppend(create, null, hasBinding ? "" : value, parentIdx, newIndex);
addRemoveNode(remove2, newIndex, depth);
if (hasBinding) {
bindingMask = generateBindingUpdateOpCodes(update, value, newIndex, null, 0, null) | bindingMask;
}
ast.push({
kind: 0,
index: newIndex
});
break;
case Node.COMMENT_NODE:
const isNestedIcu = NESTED_ICU.exec(currentNode.textContent || "");
if (isNestedIcu) {
const nestedIcuIndex = parseInt(isNestedIcu[1], 10);
const icuExpression = nestedIcus[nestedIcuIndex];
addCreateNodeAndAppend(create, ICU_MARKER, ngDevMode ? `nested ICU ${nestedIcuIndex}` : "", parentIdx, newIndex);
icuStart(ast, tView, lView, sharedUpdateOpCodes, parentIdx, icuExpression, newIndex);
addRemoveNestedIcu(remove2, newIndex, depth);
}
break;
}
currentNode = currentNode.nextSibling;
}
return bindingMask;
}
function addRemoveNode(remove2, index, depth) {
if (depth === 0) {
remove2.push(index);
}
}
function addRemoveNestedIcu(remove2, index, depth) {
if (depth === 0) {
remove2.push(~index);
remove2.push(index);
}
}
function addUpdateIcuSwitch(update, icuExpression, index) {
update.push(
toMaskBit(icuExpression.mainBinding),
2,
-1 - icuExpression.mainBinding,
index << 2 | 2
/* I18nUpdateOpCode.IcuSwitch */
);
}
function addUpdateIcuUpdate(update, bindingMask, index) {
update.push(
bindingMask,
1,
index << 2 | 3
/* I18nUpdateOpCode.IcuUpdate */
);
}
function addCreateNodeAndAppend(create, marker, text, appendToParentIdx, createAtIdx) {
if (marker !== null) {
create.push(marker);
}
create.push(text, createAtIdx, icuCreateOpCode(0, appendToParentIdx, createAtIdx));
}
function addCreateAttribute(create, newIndex, attr) {
create.push(newIndex << 1 | 1, attr.name, attr.value);
}
var ROOT_TEMPLATE_ID = 0;
var PP_MULTI_VALUE_PLACEHOLDERS_REGEXP = /\[(�.+?�?)\]/;
var PP_PLACEHOLDERS_REGEXP = /\[(�.+?�?)\]|(�\/?\*\d+:\d+�)/g;
var PP_ICU_VARS_REGEXP = /({\s*)(VAR_(PLURAL|SELECT)(_\d+)?)(\s*,)/g;
var PP_ICU_PLACEHOLDERS_REGEXP = /{([A-Z0-9_]+)}/g;
var PP_ICUS_REGEXP = /�I18N_EXP_(ICU(_\d+)?)�/g;
var PP_CLOSE_TEMPLATE_REGEXP = /\/\*/;
var PP_TEMPLATE_ID_REGEXP = /\d+\:(\d+)/;
function i18nPostprocess(message, replacements = {}) {
let result = message;
if (PP_MULTI_VALUE_PLACEHOLDERS_REGEXP.test(message)) {
const matches = {};
const templateIdsStack = [ROOT_TEMPLATE_ID];
result = result.replace(PP_PLACEHOLDERS_REGEXP, (m, phs, tmpl) => {
const content = phs || tmpl;
const placeholders = matches[content] || [];
if (!placeholders.length) {
content.split("|").forEach((placeholder2) => {
const match = placeholder2.match(PP_TEMPLATE_ID_REGEXP);
const templateId2 = match ? parseInt(match[1], 10) : ROOT_TEMPLATE_ID;
const isCloseTemplateTag2 = PP_CLOSE_TEMPLATE_REGEXP.test(placeholder2);
placeholders.push([templateId2, isCloseTemplateTag2, placeholder2]);
});
matches[content] = placeholders;
}
if (!placeholders.length) {
throw new Error(`i18n postprocess: unmatched placeholder - ${content}`);
}
const currentTemplateId = templateIdsStack[templateIdsStack.length - 1];
let idx = 0;
for (let i = 0; i < placeholders.length; i++) {
if (placeholders[i][0] === currentTemplateId) {
idx = i;
break;
}
}
const [templateId, isCloseTemplateTag, placeholder] = placeholders[idx];
if (isCloseTemplateTag) {
templateIdsStack.pop();
} else if (currentTemplateId !== templateId) {
templateIdsStack.push(templateId);
}
placeholders.splice(idx, 1);
return placeholder;
});
}
if (!Object.keys(replacements).length) {
return result;
}
result = result.replace(PP_ICU_VARS_REGEXP, (match, start, key, _type, _idx, end) => {
return replacements.hasOwnProperty(key) ? `${start}${replacements[key]}${end}` : match;
});
result = result.replace(PP_ICU_PLACEHOLDERS_REGEXP, (match, key) => {
return replacements.hasOwnProperty(key) ? replacements[key] : match;
});
result = result.replace(PP_ICUS_REGEXP, (match, key) => {
if (replacements.hasOwnProperty(key)) {
const list = replacements[key];
if (!list.length) {
throw new Error(`i18n postprocess: unmatched ICU - ${match} with key: ${key}`);
}
return list.shift();
}
return match;
});
return result;
}
function \u0275\u0275i18nStart(index, messageIndex, subTemplateIndex = -1) {
const tView = getTView();
const lView = getLView();
const adjustedIndex = HEADER_OFFSET + index;
ngDevMode && assertDefined(tView, `tView should be defined`);
const message = getConstant(tView.consts, messageIndex);
const parentTNode = getCurrentParentTNode();
if (tView.firstCreatePass) {
i18nStartFirstCreatePass(tView, parentTNode === null ? 0 : parentTNode.index, lView, adjustedIndex, message, subTemplateIndex);
}
if (tView.type === 2) {
const componentLView = lView[DECLARATION_COMPONENT_VIEW];
componentLView[FLAGS] |= 32;
} else {
lView[FLAGS] |= 32;
}
const tI18n = tView.data[adjustedIndex];
const sameViewParentTNode = parentTNode === lView[T_HOST] ? null : parentTNode;
const parentRNode = getClosestRElement(tView, sameViewParentTNode, lView);
const insertInFrontOf = parentTNode && parentTNode.type & 8 ? lView[parentTNode.index] : null;
prepareI18nBlockForHydration(lView, adjustedIndex, parentTNode, subTemplateIndex);
applyCreateOpCodes(lView, tI18n.create, parentRNode, insertInFrontOf);
setInI18nBlock(true);
}
function \u0275\u0275i18nEnd() {
setInI18nBlock(false);
}
function \u0275\u0275i18n(index, messageIndex, subTemplateIndex) {
\u0275\u0275i18nStart(index, messageIndex, subTemplateIndex);
\u0275\u0275i18nEnd();
}
function \u0275\u0275i18nAttributes(index, attrsIndex) {
const tView = getTView();
ngDevMode && assertDefined(tView, `tView should be defined`);
const attrs = getConstant(tView.consts, attrsIndex);
i18nAttributesFirstPass(tView, index + HEADER_OFFSET, attrs);
}
function \u0275\u0275i18nExp(value) {
const lView = getLView();
setMaskBit(bindingUpdated(lView, nextBindingIndex(), value));
return \u0275\u0275i18nExp;
}
function \u0275\u0275i18nApply(index) {
applyI18n(getTView(), getLView(), index + HEADER_OFFSET);
}
function \u0275\u0275i18nPostprocess(message, replacements = {}) {
return i18nPostprocess(message, replacements);
}
function \u0275\u0275listener(eventName, listenerFn, eventTargetResolver) {
const lView = getLView();
const tView = getTView();
const tNode = getCurrentTNode();
listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn, eventTargetResolver);
return \u0275\u0275listener;
}
function \u0275\u0275syntheticHostListener(eventName, listenerFn) {
const tNode = getCurrentTNode();
const lView = getLView();
const tView = getTView();
const currentDef = getCurrentDirectiveDef(tView.data);
const renderer = loadComponentRenderer(currentDef, tNode, lView);
listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn);
return \u0275\u0275syntheticHostListener;
}
function \u0275\u0275domListener(eventName, listenerFn, eventTargetResolver) {
const lView = getLView();
const tView = getTView();
const tNode = getCurrentTNode();
if (tNode.type & 3 || eventTargetResolver) {
listenToDomEvent(tNode, tView, lView, eventTargetResolver, lView[RENDERER], eventName, listenerFn, wrapListener(tNode, lView, listenerFn));
}
return \u0275\u0275domListener;
}
function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, eventTargetResolver) {
ngDevMode && assertTNodeType(
tNode,
3 | 12
/* TNodeType.AnyContainer */
);
let processOutputs = true;
let wrappedListener = null;
if (tNode.type & 3 || eventTargetResolver) {
wrappedListener ??= wrapListener(tNode, lView, listenerFn);
const hasCoalescedDomEvent = listenToDomEvent(tNode, tView, lView, eventTargetResolver, renderer, eventName, listenerFn, wrappedListener);
if (hasCoalescedDomEvent) {
processOutputs = false;
}
}
if (processOutputs) {
const outputConfig = tNode.outputs?.[eventName];
const hostDirectiveOutputConfig = tNode.hostDirectiveOutputs?.[eventName];
if (hostDirectiveOutputConfig && hostDirectiveOutputConfig.length) {
for (let i = 0; i < hostDirectiveOutputConfig.length; i += 2) {
const index = hostDirectiveOutputConfig[i];
const lookupName = hostDirectiveOutputConfig[i + 1];
wrappedListener ??= wrapListener(tNode, lView, listenerFn);
listenToOutput(tNode, lView, index, lookupName, eventName, wrappedListener);
}
}
if (outputConfig && outputConfig.length) {
for (const index of outputConfig) {
wrappedListener ??= wrapListener(tNode, lView, listenerFn);
listenToOutput(tNode, lView, index, eventName, eventName, wrappedListener);
}
}
}
}
function \u0275\u0275nextContext(level = 1) {
return nextContextImpl(level);
}
function matchingProjectionSlotIndex(tNode, projectionSlots) {
let wildcardNgContentIndex = null;
const ngProjectAsAttrVal = getProjectAsAttrValue(tNode);
for (let i = 0; i < projectionSlots.length; i++) {
const slotValue = projectionSlots[i];
if (slotValue === "*") {
wildcardNgContentIndex = i;
continue;
}
if (ngProjectAsAttrVal === null ? isNodeMatchingSelectorList(
tNode,
slotValue,
/* isProjectionMode */
true
) : isSelectorInSelectorList(ngProjectAsAttrVal, slotValue)) {
return i;
}
}
return wildcardNgContentIndex;
}
function \u0275\u0275projectionDef(projectionSlots) {
const componentNode = getLView()[DECLARATION_COMPONENT_VIEW][T_HOST];
if (!componentNode.projection) {
const numProjectionSlots = projectionSlots ? projectionSlots.length : 1;
const projectionHeads = componentNode.projection = newArray(numProjectionSlots, null);
const tails = projectionHeads.slice();
let componentChild = componentNode.child;
while (componentChild !== null) {
if (componentChild.type !== 128) {
const slotIndex = projectionSlots ? matchingProjectionSlotIndex(componentChild, projectionSlots) : 0;
if (slotIndex !== null) {
if (tails[slotIndex]) {
tails[slotIndex].projectionNext = componentChild;
} else {
projectionHeads[slotIndex] = componentChild;
}
tails[slotIndex] = componentChild;
}
}
componentChild = componentChild.next;
}
}
}
function \u0275\u0275projection(nodeIndex, selectorIndex = 0, attrs, fallbackTemplateFn, fallbackDecls, fallbackVars) {
const lView = getLView();
const tView = getTView();
const fallbackIndex = fallbackTemplateFn ? nodeIndex + 1 : null;
if (fallbackIndex !== null) {
declareNoDirectiveHostTemplate(lView, tView, fallbackIndex, fallbackTemplateFn, fallbackDecls, fallbackVars, null, attrs);
}
const tProjectionNode = getOrCreateTNode(tView, HEADER_OFFSET + nodeIndex, 16, null, attrs || null);
if (tProjectionNode.projection === null) {
tProjectionNode.projection = selectorIndex;
}
setCurrentTNodeAsNotParent();
const hydrationInfo = lView[HYDRATION];
const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock();
const componentHostNode = lView[DECLARATION_COMPONENT_VIEW][T_HOST];
const isEmpty = componentHostNode.projection[tProjectionNode.projection] === null;
if (isEmpty && fallbackIndex !== null) {
insertFallbackContent(lView, tView, fallbackIndex);
} else if (isNodeCreationMode && !isDetachedByI18n(tProjectionNode)) {
applyProjection(tView, lView, tProjectionNode);
}
}
function insertFallbackContent(lView, tView, fallbackIndex) {
const adjustedIndex = HEADER_OFFSET + fallbackIndex;
const fallbackTNode = tView.data[adjustedIndex];
const fallbackLContainer = lView[adjustedIndex];
ngDevMode && assertTNode(fallbackTNode);
ngDevMode && assertLContainer(fallbackLContainer);
const dehydratedView = findMatchingDehydratedView(fallbackLContainer, fallbackTNode.tView.ssrId);
const fallbackLView = createAndRenderEmbeddedLView(lView, fallbackTNode, void 0, {
dehydratedView
});
addLViewToLContainer(fallbackLContainer, fallbackLView, 0, shouldAddViewToDom(fallbackTNode, dehydratedView));
}
function \u0275\u0275contentQuery(directiveIndex, predicate, flags, read) {
createContentQuery(directiveIndex, predicate, flags, read);
}
function \u0275\u0275viewQuery(predicate, flags, read) {
createViewQuery(predicate, flags, read);
}
function \u0275\u0275queryRefresh(queryList) {
const lView = getLView();
const tView = getTView();
const queryIndex = getCurrentQueryIndex();
setCurrentQueryIndex(queryIndex + 1);
const tQuery = getTQuery(tView, queryIndex);
if (queryList.dirty && isCreationMode(lView) === ((tQuery.metadata.flags & 2) === 2)) {
if (tQuery.matches === null) {
queryList.reset([]);
} else {
const result = getQueryResults(lView, queryIndex);
queryList.reset(result, unwrapElementRef);
queryList.notifyOnChanges();
}
return true;
}
return false;
}
function \u0275\u0275loadQuery() {
return loadQueryInternal(getLView(), getCurrentQueryIndex());
}
function \u0275\u0275contentQuerySignal(directiveIndex, target, predicate, flags, read) {
bindQueryToSignal(target, createContentQuery(directiveIndex, predicate, flags, read));
}
function \u0275\u0275viewQuerySignal(target, predicate, flags, read) {
bindQueryToSignal(target, createViewQuery(predicate, flags, read));
}
function \u0275\u0275queryAdvance(indexOffset = 1) {
setCurrentQueryIndex(getCurrentQueryIndex() + indexOffset);
}
function \u0275\u0275reference(index) {
const contextLView = getContextLView();
return load(contextLView, HEADER_OFFSET + index);
}
function toTStylingRange(prev, next) {
ngDevMode && assertNumberInRange(
prev,
0,
32767
/* StylingRange.UNSIGNED_MASK */
);
ngDevMode && assertNumberInRange(
next,
0,
32767
/* StylingRange.UNSIGNED_MASK */
);
return prev << 17 | next << 2;
}
function getTStylingRangePrev(tStylingRange) {
ngDevMode && assertNumber(tStylingRange, "expected number");
return tStylingRange >> 17 & 32767;
}
function getTStylingRangePrevDuplicate(tStylingRange) {
ngDevMode && assertNumber(tStylingRange, "expected number");
return (tStylingRange & 2) == 2;
}
function setTStylingRangePrev(tStylingRange, previous) {
ngDevMode && assertNumber(tStylingRange, "expected number");
ngDevMode && assertNumberInRange(
previous,
0,
32767
/* StylingRange.UNSIGNED_MASK */
);
return tStylingRange & ~4294836224 | previous << 17;
}
function setTStylingRangePrevDuplicate(tStylingRange) {
ngDevMode && assertNumber(tStylingRange, "expected number");
return tStylingRange | 2;
}
function getTStylingRangeNext(tStylingRange) {
ngDevMode && assertNumber(tStylingRange, "expected number");
return (tStylingRange & 131068) >> 2;
}
function setTStylingRangeNext(tStylingRange, next) {
ngDevMode && assertNumber(tStylingRange, "expected number");
ngDevMode && assertNumberInRange(
next,
0,
32767
/* StylingRange.UNSIGNED_MASK */
);
return tStylingRange & ~131068 | //
next << 2;
}
function getTStylingRangeNextDuplicate(tStylingRange) {
ngDevMode && assertNumber(tStylingRange, "expected number");
return (tStylingRange & 1) === 1;
}
function setTStylingRangeNextDuplicate(tStylingRange) {
ngDevMode && assertNumber(tStylingRange, "expected number");
return tStylingRange | 1;
}
function insertTStylingBinding(tData, tNode, tStylingKeyWithStatic, index, isHostBinding, isClassBinding) {
ngDevMode && assertFirstUpdatePass(getTView());
let tBindings = isClassBinding ? tNode.classBindings : tNode.styleBindings;
let tmplHead = getTStylingRangePrev(tBindings);
let tmplTail = getTStylingRangeNext(tBindings);
tData[index] = tStylingKeyWithStatic;
let isKeyDuplicateOfStatic = false;
let tStylingKey;
if (Array.isArray(tStylingKeyWithStatic)) {
const staticKeyValueArray = tStylingKeyWithStatic;
tStylingKey = staticKeyValueArray[1];
if (tStylingKey === null || keyValueArrayIndexOf(staticKeyValueArray, tStylingKey) > 0) {
isKeyDuplicateOfStatic = true;
}
} else {
tStylingKey = tStylingKeyWithStatic;
}
if (isHostBinding) {
const hasTemplateBindings = tmplTail !== 0;
if (hasTemplateBindings) {
const previousNode = getTStylingRangePrev(tData[tmplHead + 1]);
tData[index + 1] = toTStylingRange(previousNode, tmplHead);
if (previousNode !== 0) {
tData[previousNode + 1] = setTStylingRangeNext(tData[previousNode + 1], index);
}
tData[tmplHead + 1] = setTStylingRangePrev(tData[tmplHead + 1], index);
} else {
tData[index + 1] = toTStylingRange(tmplHead, 0);
if (tmplHead !== 0) {
tData[tmplHead + 1] = setTStylingRangeNext(tData[tmplHead + 1], index);
}
tmplHead = index;
}
} else {
tData[index + 1] = toTStylingRange(tmplTail, 0);
ngDevMode && assertEqual(tmplHead !== 0 && tmplTail === 0, false, "Adding template bindings after hostBindings is not allowed.");
if (tmplHead === 0) {
tmplHead = index;
} else {
tData[tmplTail + 1] = setTStylingRangeNext(tData[tmplTail + 1], index);
}
tmplTail = index;
}
if (isKeyDuplicateOfStatic) {
tData[index + 1] = setTStylingRangePrevDuplicate(tData[index + 1]);
}
markDuplicates(tData, tStylingKey, index, true);
markDuplicates(tData, tStylingKey, index, false);
markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding);
tBindings = toTStylingRange(tmplHead, tmplTail);
if (isClassBinding) {
tNode.classBindings = tBindings;
} else {
tNode.styleBindings = tBindings;
}
}
function markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding) {
const residual = isClassBinding ? tNode.residualClasses : tNode.residualStyles;
if (residual != null && typeof tStylingKey == "string" && keyValueArrayIndexOf(residual, tStylingKey) >= 0) {
tData[index + 1] = setTStylingRangeNextDuplicate(tData[index + 1]);
}
}
function markDuplicates(tData, tStylingKey, index, isPrevDir) {
const tStylingAtIndex = tData[index + 1];
const isMap = tStylingKey === null;
let cursor = isPrevDir ? getTStylingRangePrev(tStylingAtIndex) : getTStylingRangeNext(tStylingAtIndex);
let foundDuplicate = false;
while (cursor !== 0 && (foundDuplicate === false || isMap)) {
ngDevMode && assertIndexInRange(tData, cursor);
const tStylingValueAtCursor = tData[cursor];
const tStyleRangeAtCursor = tData[cursor + 1];
if (isStylingMatch(tStylingValueAtCursor, tStylingKey)) {
foundDuplicate = true;
tData[cursor + 1] = isPrevDir ? setTStylingRangeNextDuplicate(tStyleRangeAtCursor) : setTStylingRangePrevDuplicate(tStyleRangeAtCursor);
}
cursor = isPrevDir ? getTStylingRangePrev(tStyleRangeAtCursor) : getTStylingRangeNext(tStyleRangeAtCursor);
}
if (foundDuplicate) {
tData[index + 1] = isPrevDir ? setTStylingRangePrevDuplicate(tStylingAtIndex) : setTStylingRangeNextDuplicate(tStylingAtIndex);
}
}
function isStylingMatch(tStylingKeyCursor, tStylingKey) {
ngDevMode && assertNotEqual(Array.isArray(tStylingKey), true, "Expected that 'tStylingKey' has been unwrapped");
if (tStylingKeyCursor === null || // If the cursor is `null` it means that we have map at that
// location so we must assume that we have a match.
tStylingKey == null || // If `tStylingKey` is `null` then it is a map therefor assume that it
// contains a match.
(Array.isArray(tStylingKeyCursor) ? tStylingKeyCursor[1] : tStylingKeyCursor) === tStylingKey) {
return true;
} else if (Array.isArray(tStylingKeyCursor) && typeof tStylingKey === "string") {
return keyValueArrayIndexOf(tStylingKeyCursor, tStylingKey) >= 0;
}
return false;
}
var parserState = {
textEnd: 0,
key: 0,
keyEnd: 0,
value: 0,
valueEnd: 0
};
function getLastParsedKey(text) {
return text.substring(parserState.key, parserState.keyEnd);
}
function getLastParsedValue(text) {
return text.substring(parserState.value, parserState.valueEnd);
}
function parseClassName(text) {
resetParserState(text);
return parseClassNameNext(text, consumeWhitespace(text, 0, parserState.textEnd));
}
function parseClassNameNext(text, index) {
const end = parserState.textEnd;
if (end === index) {
return -1;
}
index = parserState.keyEnd = consumeClassToken(text, parserState.key = index, end);
return consumeWhitespace(text, index, end);
}
function parseStyle(text) {
resetParserState(text);
return parseStyleNext(text, consumeWhitespace(text, 0, parserState.textEnd));
}
function parseStyleNext(text, startIndex) {
const end = parserState.textEnd;
let index = parserState.key = consumeWhitespace(text, startIndex, end);
if (end === index) {
return -1;
}
index = parserState.keyEnd = consumeStyleKey(text, index, end);
index = consumeSeparator(
text,
index,
end,
58
/* CharCode.COLON */
);
index = parserState.value = consumeWhitespace(text, index, end);
index = parserState.valueEnd = consumeStyleValue(text, index, end);
return consumeSeparator(
text,
index,
end,
59
/* CharCode.SEMI_COLON */
);
}
function resetParserState(text) {
parserState.key = 0;
parserState.keyEnd = 0;
parserState.value = 0;
parserState.valueEnd = 0;
parserState.textEnd = text.length;
}
function consumeWhitespace(text, startIndex, endIndex) {
while (startIndex < endIndex && text.charCodeAt(startIndex) <= 32) {
startIndex++;
}
return startIndex;
}
function consumeClassToken(text, startIndex, endIndex) {
while (startIndex < endIndex && text.charCodeAt(startIndex) > 32) {
startIndex++;
}
return startIndex;
}
function consumeStyleKey(text, startIndex, endIndex) {
let ch;
while (startIndex < endIndex && ((ch = text.charCodeAt(startIndex)) === 45 || ch === 95 || (ch & -33) >= 65 && (ch & -33) <= 90 || ch >= 48 && ch <= 57)) {
startIndex++;
}
return startIndex;
}
function consumeSeparator(text, startIndex, endIndex, separator) {
startIndex = consumeWhitespace(text, startIndex, endIndex);
if (startIndex < endIndex) {
if (ngDevMode && text.charCodeAt(startIndex) !== separator) {
malformedStyleError(text, String.fromCharCode(separator), startIndex);
}
startIndex++;
}
return startIndex;
}
function consumeStyleValue(text, startIndex, endIndex) {
let ch1 = -1;
let ch2 = -1;
let ch3 = -1;
let i = startIndex;
let lastChIndex = i;
while (i < endIndex) {
const ch = text.charCodeAt(i++);
if (ch === 59) {
return lastChIndex;
} else if (ch === 34 || ch === 39) {
lastChIndex = i = consumeQuotedText(text, ch, i, endIndex);
} else if (startIndex === i - 4 && // We have seen only 4 characters so far "URL(" (Ignore "foo_URL()")
ch3 === 85 && ch2 === 82 && ch1 === 76 && ch === 40) {
lastChIndex = i = consumeQuotedText(text, 41, i, endIndex);
} else if (ch > 32) {
lastChIndex = i;
}
ch3 = ch2;
ch2 = ch1;
ch1 = ch & -33;
}
return lastChIndex;
}
function consumeQuotedText(text, quoteCharCode, startIndex, endIndex) {
let ch1 = -1;
let index = startIndex;
while (index < endIndex) {
const ch = text.charCodeAt(index++);
if (ch == quoteCharCode && ch1 !== 92) {
return index;
}
if (ch == 92 && ch1 === 92) {
ch1 = 0;
} else {
ch1 = ch;
}
}
throw ngDevMode ? malformedStyleError(text, String.fromCharCode(quoteCharCode), endIndex) : new Error();
}
function malformedStyleError(text, expecting, index) {
ngDevMode && assertEqual(typeof text === "string", true, "String expected here");
throw throwError2(`Malformed style at location ${index} in string '` + text.substring(0, index) + "[>>" + text.substring(index, index + 1) + "<<]" + text.slice(index + 1) + `'. Expecting '${expecting}'.`);
}
function \u0275\u0275styleProp(prop, value, suffix) {
checkStylingProperty(prop, value, suffix, false);
return \u0275\u0275styleProp;
}
function \u0275\u0275classProp(className, value) {
checkStylingProperty(className, value, null, true);
return \u0275\u0275classProp;
}
function \u0275\u0275styleMap(styles) {
checkStylingMap(styleKeyValueArraySet, styleStringParser, styles, false);
}
function styleStringParser(keyValueArray, text) {
for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i)) {
styleKeyValueArraySet(keyValueArray, getLastParsedKey(text), getLastParsedValue(text));
}
}
function \u0275\u0275classMap(classes) {
checkStylingMap(classKeyValueArraySet, classStringParser, classes, true);
}
function classStringParser(keyValueArray, text) {
for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {
keyValueArraySet(keyValueArray, getLastParsedKey(text), true);
}
}
function checkStylingProperty(prop, value, suffix, isClassBased) {
const lView = getLView();
const tView = getTView();
const bindingIndex = incrementBindingIndex(2);
if (tView.firstUpdatePass) {
stylingFirstUpdatePass(tView, prop, bindingIndex, isClassBased);
}
if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {
const tNode = tView.data[getSelectedIndex()];
updateStyling(tView, tNode, lView, lView[RENDERER], prop, lView[bindingIndex + 1] = normalizeSuffix(value, suffix), isClassBased, bindingIndex);
}
}
function checkStylingMap(keyValueArraySet2, stringParser, value, isClassBased) {
const tView = getTView();
const bindingIndex = incrementBindingIndex(2);
if (tView.firstUpdatePass) {
stylingFirstUpdatePass(tView, null, bindingIndex, isClassBased);
}
const lView = getLView();
if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {
const tNode = tView.data[getSelectedIndex()];
if (hasStylingInputShadow(tNode, isClassBased) && !isInHostBindings(tView, bindingIndex)) {
if (ngDevMode) {
const tStylingKey = tView.data[bindingIndex];
assertEqual(Array.isArray(tStylingKey) ? tStylingKey[1] : tStylingKey, false, "Styling linked list shadow input should be marked as 'false'");
}
let staticPrefix = isClassBased ? tNode.classesWithoutHost : tNode.stylesWithoutHost;
ngDevMode && isClassBased === false && staticPrefix !== null && assertEqual(staticPrefix.endsWith(";"), true, "Expecting static portion to end with ';'");
if (staticPrefix !== null) {
value = concatStringsWithSpace(staticPrefix, value ? value : "");
}
setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased);
} else {
updateStylingMap(tView, tNode, lView, lView[RENDERER], lView[bindingIndex + 1], lView[bindingIndex + 1] = toStylingKeyValueArray(keyValueArraySet2, stringParser, value), isClassBased, bindingIndex);
}
}
}
function isInHostBindings(tView, bindingIndex) {
return bindingIndex >= tView.expandoStartIndex;
}
function stylingFirstUpdatePass(tView, tStylingKey, bindingIndex, isClassBased) {
ngDevMode && assertFirstUpdatePass(tView);
const tData = tView.data;
if (tData[bindingIndex + 1] === null) {
const tNode = tData[getSelectedIndex()];
ngDevMode && assertDefined(tNode, "TNode expected");
const isHostBindings = isInHostBindings(tView, bindingIndex);
if (hasStylingInputShadow(tNode, isClassBased) && tStylingKey === null && !isHostBindings) {
tStylingKey = false;
}
tStylingKey = wrapInStaticStylingKey(tData, tNode, tStylingKey, isClassBased);
insertTStylingBinding(tData, tNode, tStylingKey, bindingIndex, isHostBindings, isClassBased);
}
}
function wrapInStaticStylingKey(tData, tNode, stylingKey, isClassBased) {
const hostDirectiveDef = getCurrentDirectiveDef(tData);
let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;
if (hostDirectiveDef === null) {
const isFirstStylingInstructionInTemplate = (isClassBased ? tNode.classBindings : tNode.styleBindings) === 0;
if (isFirstStylingInstructionInTemplate) {
stylingKey = collectStylingFromDirectives(null, tData, tNode, stylingKey, isClassBased);
stylingKey = collectStylingFromTAttrs(stylingKey, tNode.attrs, isClassBased);
residual = null;
}
} else {
const directiveStylingLast = tNode.directiveStylingLast;
const isFirstStylingInstructionInHostBinding = directiveStylingLast === -1 || tData[directiveStylingLast] !== hostDirectiveDef;
if (isFirstStylingInstructionInHostBinding) {
stylingKey = collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased);
if (residual === null) {
let templateStylingKey = getTemplateHeadTStylingKey(tData, tNode, isClassBased);
if (templateStylingKey !== void 0 && Array.isArray(templateStylingKey)) {
templateStylingKey = collectStylingFromDirectives(null, tData, tNode, templateStylingKey[1], isClassBased);
templateStylingKey = collectStylingFromTAttrs(templateStylingKey, tNode.attrs, isClassBased);
setTemplateHeadTStylingKey(tData, tNode, isClassBased, templateStylingKey);
}
} else {
residual = collectResidual(tData, tNode, isClassBased);
}
}
}
if (residual !== void 0) {
isClassBased ? tNode.residualClasses = residual : tNode.residualStyles = residual;
}
return stylingKey;
}
function getTemplateHeadTStylingKey(tData, tNode, isClassBased) {
const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;
if (getTStylingRangeNext(bindings) === 0) {
return void 0;
}
return tData[getTStylingRangePrev(bindings)];
}
function setTemplateHeadTStylingKey(tData, tNode, isClassBased, tStylingKey) {
const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;
ngDevMode && assertNotEqual(getTStylingRangeNext(bindings), 0, "Expecting to have at least one template styling binding.");
tData[getTStylingRangePrev(bindings)] = tStylingKey;
}
function collectResidual(tData, tNode, isClassBased) {
let residual = void 0;
const directiveEnd = tNode.directiveEnd;
ngDevMode && assertNotEqual(tNode.directiveStylingLast, -1, "By the time this function gets called at least one hostBindings-node styling instruction must have executed.");
for (let i = 1 + tNode.directiveStylingLast; i < directiveEnd; i++) {
const attrs = tData[i].hostAttrs;
residual = collectStylingFromTAttrs(residual, attrs, isClassBased);
}
return collectStylingFromTAttrs(residual, tNode.attrs, isClassBased);
}
function collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased) {
let currentDirective = null;
const directiveEnd = tNode.directiveEnd;
let directiveStylingLast = tNode.directiveStylingLast;
if (directiveStylingLast === -1) {
directiveStylingLast = tNode.directiveStart;
} else {
directiveStylingLast++;
}
while (directiveStylingLast < directiveEnd) {
currentDirective = tData[directiveStylingLast];
ngDevMode && assertDefined(currentDirective, "expected to be defined");
stylingKey = collectStylingFromTAttrs(stylingKey, currentDirective.hostAttrs, isClassBased);
if (currentDirective === hostDirectiveDef)
break;
directiveStylingLast++;
}
if (hostDirectiveDef !== null) {
tNode.directiveStylingLast = directiveStylingLast;
}
return stylingKey;
}
function collectStylingFromTAttrs(stylingKey, attrs, isClassBased) {
const desiredMarker = isClassBased ? 1 : 2;
let currentMarker = -1;
if (attrs !== null) {
for (let i = 0; i < attrs.length; i++) {
const item = attrs[i];
if (typeof item === "number") {
currentMarker = item;
} else {
if (currentMarker === desiredMarker) {
if (!Array.isArray(stylingKey)) {
stylingKey = stylingKey === void 0 ? [] : ["", stylingKey];
}
keyValueArraySet(stylingKey, item, isClassBased ? true : attrs[++i]);
}
}
}
}
return stylingKey === void 0 ? null : stylingKey;
}
function toStylingKeyValueArray(keyValueArraySet2, stringParser, value) {
if (value == null || value === "")
return EMPTY_ARRAY;
const styleKeyValueArray = [];
const unwrappedValue = unwrapSafeValue(value);
if (Array.isArray(unwrappedValue)) {
for (let i = 0; i < unwrappedValue.length; i++) {
keyValueArraySet2(styleKeyValueArray, unwrappedValue[i], true);
}
} else if (typeof unwrappedValue === "object") {
for (const key in unwrappedValue) {
if (unwrappedValue.hasOwnProperty(key)) {
keyValueArraySet2(styleKeyValueArray, key, unwrappedValue[key]);
}
}
} else if (typeof unwrappedValue === "string") {
stringParser(styleKeyValueArray, unwrappedValue);
} else {
ngDevMode && throwError2("Unsupported styling type: " + typeof unwrappedValue + " (" + unwrappedValue + ")");
}
return styleKeyValueArray;
}
function styleKeyValueArraySet(keyValueArray, key, value) {
keyValueArraySet(keyValueArray, key, unwrapSafeValue(value));
}
function classKeyValueArraySet(keyValueArray, key, value) {
const stringKey = String(key);
if (stringKey !== "" && !stringKey.includes(" ")) {
keyValueArraySet(keyValueArray, stringKey, value);
}
}
function updateStylingMap(tView, tNode, lView, renderer, oldKeyValueArray, newKeyValueArray, isClassBased, bindingIndex) {
if (oldKeyValueArray === NO_CHANGE) {
oldKeyValueArray = EMPTY_ARRAY;
}
let oldIndex = 0;
let newIndex = 0;
let oldKey = 0 < oldKeyValueArray.length ? oldKeyValueArray[0] : null;
let newKey = 0 < newKeyValueArray.length ? newKeyValueArray[0] : null;
while (oldKey !== null || newKey !== null) {
ngDevMode && assertLessThan(oldIndex, 999, "Are we stuck in infinite loop?");
ngDevMode && assertLessThan(newIndex, 999, "Are we stuck in infinite loop?");
const oldValue = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex + 1] : void 0;
const newValue = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex + 1] : void 0;
let setKey = null;
let setValue = void 0;
if (oldKey === newKey) {
oldIndex += 2;
newIndex += 2;
if (oldValue !== newValue) {
setKey = newKey;
setValue = newValue;
}
} else if (newKey === null || oldKey !== null && oldKey < newKey) {
oldIndex += 2;
setKey = oldKey;
} else {
ngDevMode && assertDefined(newKey, "Expecting to have a valid key");
newIndex += 2;
setKey = newKey;
setValue = newValue;
}
if (setKey !== null) {
updateStyling(tView, tNode, lView, renderer, setKey, setValue, isClassBased, bindingIndex);
}
oldKey = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex] : null;
newKey = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex] : null;
}
}
function updateStyling(tView, tNode, lView, renderer, prop, value, isClassBased, bindingIndex) {
if (!(tNode.type & 3)) {
return;
}
const tData = tView.data;
const tRange = tData[bindingIndex + 1];
const higherPriorityValue = getTStylingRangeNextDuplicate(tRange) ? findStylingValue(tData, tNode, lView, prop, getTStylingRangeNext(tRange), isClassBased) : void 0;
if (!isStylingValuePresent(higherPriorityValue)) {
if (!isStylingValuePresent(value)) {
if (getTStylingRangePrevDuplicate(tRange)) {
value = findStylingValue(tData, null, lView, prop, bindingIndex, isClassBased);
}
}
const rNode = getNativeByIndex(getSelectedIndex(), lView);
applyStyling(renderer, isClassBased, rNode, prop, value);
}
}
function findStylingValue(tData, tNode, lView, prop, index, isClassBased) {
const isPrevDirection = tNode === null;
let value = void 0;
while (index > 0) {
const rawKey = tData[index];
const containsStatics = Array.isArray(rawKey);
const key = containsStatics ? rawKey[1] : rawKey;
const isStylingMap = key === null;
let valueAtLViewIndex = lView[index + 1];
if (valueAtLViewIndex === NO_CHANGE) {
valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : void 0;
}
let currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) : key === prop ? valueAtLViewIndex : void 0;
if (containsStatics && !isStylingValuePresent(currentValue)) {
currentValue = keyValueArrayGet(rawKey, prop);
}
if (isStylingValuePresent(currentValue)) {
value = currentValue;
if (isPrevDirection) {
return value;
}
}
const tRange = tData[index + 1];
index = isPrevDirection ? getTStylingRangePrev(tRange) : getTStylingRangeNext(tRange);
}
if (tNode !== null) {
let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;
if (residual != null) {
value = keyValueArrayGet(residual, prop);
}
}
return value;
}
function isStylingValuePresent(value) {
return value !== void 0;
}
function normalizeSuffix(value, suffix) {
if (value == null || value === "") ;
else if (typeof suffix === "string") {
value = value + suffix;
} else if (typeof value === "object") {
value = stringify(unwrapSafeValue(value));
}
return value;
}
function hasStylingInputShadow(tNode, isClassBased) {
return (tNode.flags & (isClassBased ? 8 : 16)) !== 0;
}
function \u0275\u0275text(index, value = "") {
const lView = getLView();
const tView = getTView();
const adjustedIndex = index + HEADER_OFFSET;
ngDevMode && assertTNodeCreationIndex(lView, index);
const tNode = tView.firstCreatePass ? getOrCreateTNode(tView, adjustedIndex, 1, value, null) : tView.data[adjustedIndex];
const textNative = _locateOrCreateTextNode(tView, lView, tNode, value, index);
lView[adjustedIndex] = textNative;
if (wasLastNodeCreated()) {
appendChild(tView, lView, textNative, tNode);
}
setCurrentTNode(tNode, false);
}
var _locateOrCreateTextNode = (tView, lView, tNode, value, index) => {
lastNodeWasCreated(true);
return createTextNode(lView[RENDERER], value);
};
function interpolationV(lView, values) {
ngDevMode && assertLessThan(2, values.length, "should have at least 3 values");
let isBindingUpdated = false;
let bindingIndex = getBindingIndex();
for (let i = 1; i < values.length; i += 2) {
isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
}
setBindingIndex(bindingIndex);
if (!isBindingUpdated) {
return NO_CHANGE;
}
let content = values[0];
for (let i = 1; i < values.length; i += 2) {
content += renderStringify(values[i]) + (i + 1 !== values.length ? values[i + 1] : "");
}
return content;
}
function interpolation1(lView, prefix, v0, suffix = "") {
const different = bindingUpdated(lView, nextBindingIndex(), v0);
return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
}
function interpolation2(lView, prefix, v0, i0, v1, suffix = "") {
const bindingIndex = getBindingIndex();
const different = bindingUpdated2(lView, bindingIndex, v0, v1);
incrementBindingIndex(2);
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
}
function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix = "") {
const bindingIndex = getBindingIndex();
const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
incrementBindingIndex(3);
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix : NO_CHANGE;
}
function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix = "") {
const bindingIndex = getBindingIndex();
const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
incrementBindingIndex(4);
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + suffix : NO_CHANGE;
}
function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix = "") {
const bindingIndex = getBindingIndex();
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
incrementBindingIndex(5);
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix : NO_CHANGE;
}
function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix = "") {
const bindingIndex = getBindingIndex();
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
incrementBindingIndex(6);
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix : NO_CHANGE;
}
function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix = "") {
const bindingIndex = getBindingIndex();
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
incrementBindingIndex(7);
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + i5 + renderStringify(v6) + suffix : NO_CHANGE;
}
function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix = "") {
const bindingIndex = getBindingIndex();
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
incrementBindingIndex(8);
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix : NO_CHANGE;
}
function \u0275\u0275textInterpolate(v0) {
\u0275\u0275textInterpolate1("", v0);
return \u0275\u0275textInterpolate;
}
function \u0275\u0275textInterpolate1(prefix, v0, suffix) {
const lView = getLView();
const interpolated = interpolation1(lView, prefix, v0, suffix);
if (interpolated !== NO_CHANGE) {
textBindingInternal(lView, getSelectedIndex(), interpolated);
}
return \u0275\u0275textInterpolate1;
}
function \u0275\u0275textInterpolate2(prefix, v0, i0, v1, suffix) {
const lView = getLView();
const interpolated = interpolation2(lView, prefix, v0, i0, v1, suffix);
if (interpolated !== NO_CHANGE) {
textBindingInternal(lView, getSelectedIndex(), interpolated);
}
return \u0275\u0275textInterpolate2;
}
function \u0275\u0275textInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) {
const lView = getLView();
const interpolated = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
if (interpolated !== NO_CHANGE) {
textBindingInternal(lView, getSelectedIndex(), interpolated);
}
return \u0275\u0275textInterpolate3;
}
function \u0275\u0275textInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
const lView = getLView();
const interpolated = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
if (interpolated !== NO_CHANGE) {
textBindingInternal(lView, getSelectedIndex(), interpolated);
}
return \u0275\u0275textInterpolate4;
}
function \u0275\u0275textInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
const lView = getLView();
const interpolated = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
if (interpolated !== NO_CHANGE) {
textBindingInternal(lView, getSelectedIndex(), interpolated);
}
return \u0275\u0275textInterpolate5;
}
function \u0275\u0275textInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
const lView = getLView();
const interpolated = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
if (interpolated !== NO_CHANGE) {
textBindingInternal(lView, getSelectedIndex(), interpolated);
}
return \u0275\u0275textInterpolate6;
}
function \u0275\u0275textInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
const lView = getLView();
const interpolated = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
if (interpolated !== NO_CHANGE) {
textBindingInternal(lView, getSelectedIndex(), interpolated);
}
return \u0275\u0275textInterpolate7;
}
function \u0275\u0275textInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
const lView = getLView();
const interpolated = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
if (interpolated !== NO_CHANGE) {
textBindingInternal(lView, getSelectedIndex(), interpolated);
}
return \u0275\u0275textInterpolate8;
}
function \u0275\u0275textInterpolateV(values) {
const lView = getLView();
const interpolated = interpolationV(lView, values);
if (interpolated !== NO_CHANGE) {
textBindingInternal(lView, getSelectedIndex(), interpolated);
}
return \u0275\u0275textInterpolateV;
}
function textBindingInternal(lView, index, value) {
ngDevMode && assertString(value, "Value should be a string");
ngDevMode && assertNotSame(value, NO_CHANGE, "value should not be NO_CHANGE");
ngDevMode && assertIndexInRange(lView, index);
const element = getNativeByIndex(index, lView);
ngDevMode && assertDefined(element, "native element should exist");
updateTextNode(lView[RENDERER], element, value);
}
function \u0275\u0275twoWayProperty(propName, value, sanitizer) {
if (isWritableSignal(value)) {
value = value();
}
const lView = getLView();
const bindingIndex = nextBindingIndex();
if (bindingUpdated(lView, bindingIndex, value)) {
const tView = getTView();
const tNode = getSelectedTNode();
setPropertyAndInputs(tNode, lView, propName, value, lView[RENDERER], sanitizer);
ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
}
return \u0275\u0275twoWayProperty;
}
function \u0275\u0275twoWayBindingSet(target, value) {
const canWrite = isWritableSignal(target);
canWrite && target.set(value);
return canWrite;
}
function \u0275\u0275twoWayListener(eventName, listenerFn) {
const lView = getLView();
const tView = getTView();
const tNode = getCurrentTNode();
listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn);
return \u0275\u0275twoWayListener;
}
var UNINITIALIZED_LET = {};
function \u0275\u0275declareLet(index) {
const tView = getTView();
const lView = getLView();
const adjustedIndex = index + HEADER_OFFSET;
const tNode = getOrCreateTNode(tView, adjustedIndex, 128, null, null);
setCurrentTNode(tNode, false);
store(tView, lView, adjustedIndex, UNINITIALIZED_LET);
return \u0275\u0275declareLet;
}
function \u0275\u0275storeLet(value) {
performanceMarkFeature("NgLet");
const tView = getTView();
const lView = getLView();
const index = getSelectedIndex();
store(tView, lView, index, value);
return value;
}
function \u0275\u0275readContextLet(index) {
const contextLView = getContextLView();
const value = load(contextLView, HEADER_OFFSET + index);
if (value === UNINITIALIZED_LET) {
throw new RuntimeError(314, ngDevMode && "Attempting to access a @let declaration whose value is not available yet");
}
return value;
}
function \u0275\u0275attachSourceLocations(templatePath, locations) {
const tView = getTView();
const lView = getLView();
const renderer = lView[RENDERER];
const attributeName = "data-ng-source-location";
for (const [index, offset, line, column] of locations) {
const tNode = getTNode(tView, index + HEADER_OFFSET);
ngDevMode && assertTNodeType(
tNode,
2
/* TNodeType.Element */
);
const node = getNativeByIndex(index + HEADER_OFFSET, lView);
if (!node.hasAttribute(attributeName)) {
const attributeValue = `${templatePath}@o:${offset},l:${line},c:${column}`;
renderer.setAttribute(node, attributeName, attributeValue);
}
}
}
function \u0275\u0275interpolate(v0) {
return bindingUpdated(getLView(), nextBindingIndex(), v0) ? renderStringify(v0) : NO_CHANGE;
}
function \u0275\u0275interpolate1(prefix, v0, suffix = "") {
return interpolation1(getLView(), prefix, v0, suffix);
}
function \u0275\u0275interpolate2(prefix, v0, i0, v1, suffix = "") {
return interpolation2(getLView(), prefix, v0, i0, v1, suffix);
}
function \u0275\u0275interpolate3(prefix, v0, i0, v1, i1, v2, suffix = "") {
return interpolation3(getLView(), prefix, v0, i0, v1, i1, v2, suffix);
}
function \u0275\u0275interpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix = "") {
return interpolation4(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
}
function \u0275\u0275interpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix = "") {
return interpolation5(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
}
function \u0275\u0275interpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix = "") {
return interpolation6(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
}
function \u0275\u0275interpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix = "") {
return interpolation7(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
}
function \u0275\u0275interpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix = "") {
return interpolation8(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
}
function \u0275\u0275interpolateV(values) {
return interpolationV(getLView(), values);
}
function providersResolver(def, providers, viewProviders) {
const tView = getTView();
if (tView.firstCreatePass) {
const isComponent2 = isComponentDef(def);
resolveProvider(viewProviders, tView.data, tView.blueprint, isComponent2, true);
resolveProvider(providers, tView.data, tView.blueprint, isComponent2, false);
}
}
function resolveProvider(provider, tInjectables, lInjectablesBlueprint, isComponent2, isViewProvider) {
provider = resolveForwardRef(provider);
if (Array.isArray(provider)) {
for (let i = 0; i < provider.length; i++) {
resolveProvider(provider[i], tInjectables, lInjectablesBlueprint, isComponent2, isViewProvider);
}
} else {
const tView = getTView();
const lView = getLView();
const tNode = getCurrentTNode();
let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);
const providerFactory = providerToFactory(provider);
if (ngDevMode) {
const injector = new NodeInjector(tNode, lView);
runInInjectorProfilerContext(injector, token, () => {
emitProviderConfiguredEvent(provider, isViewProvider);
});
}
const beginIndex = tNode.providerIndexes & 1048575;
const endIndex = tNode.directiveStart;
const cptViewProvidersCount = tNode.providerIndexes >> 20;
if (isTypeProvider(provider) || !provider.multi) {
const factory = new NodeInjectorFactory(providerFactory, isViewProvider, \u0275\u0275directiveInject, ngDevMode ? providerName(provider) : null);
const existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);
if (existingFactoryIndex === -1) {
diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);
registerDestroyHooksIfSupported(tView, provider, tInjectables.length);
tInjectables.push(token);
tNode.directiveStart++;
tNode.directiveEnd++;
if (isViewProvider) {
tNode.providerIndexes += 1048576;
}
lInjectablesBlueprint.push(factory);
lView.push(factory);
} else {
lInjectablesBlueprint[existingFactoryIndex] = factory;
lView[existingFactoryIndex] = factory;
}
} else {
const existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);
const existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);
const doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 && lInjectablesBlueprint[existingProvidersFactoryIndex];
const doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 && lInjectablesBlueprint[existingViewProvidersFactoryIndex];
if (isViewProvider && !doesViewProvidersFactoryExist || !isViewProvider && !doesProvidersFactoryExist) {
diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);
const factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent2, providerFactory, provider);
if (!isViewProvider && doesViewProvidersFactoryExist) {
lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;
}
registerDestroyHooksIfSupported(tView, provider, tInjectables.length, 0);
tInjectables.push(token);
tNode.directiveStart++;
tNode.directiveEnd++;
if (isViewProvider) {
tNode.providerIndexes += 1048576;
}
lInjectablesBlueprint.push(factory);
lView.push(factory);
} else {
const indexInFactory = multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent2);
registerDestroyHooksIfSupported(tView, provider, existingProvidersFactoryIndex > -1 ? existingProvidersFactoryIndex : existingViewProvidersFactoryIndex, indexInFactory);
}
if (!isViewProvider && isComponent2 && doesViewProvidersFactoryExist) {
lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;
}
}
}
}
function registerDestroyHooksIfSupported(tView, provider, contextIndex, indexInFactory) {
const providerIsTypeProvider = isTypeProvider(provider);
const providerIsClassProvider = isClassProvider(provider);
if (providerIsTypeProvider || providerIsClassProvider) {
const classToken = providerIsClassProvider ? resolveForwardRef(provider.useClass) : provider;
const prototype = classToken.prototype;
const ngOnDestroy = prototype.ngOnDestroy;
if (ngOnDestroy) {
const hooks = tView.destroyHooks || (tView.destroyHooks = []);
if (!providerIsTypeProvider && provider.multi) {
ngDevMode && assertDefined(indexInFactory, "indexInFactory when registering multi factory destroy hook");
const existingCallbacksIndex = hooks.indexOf(contextIndex);
if (existingCallbacksIndex === -1) {
hooks.push(contextIndex, [indexInFactory, ngOnDestroy]);
} else {
hooks[existingCallbacksIndex + 1].push(indexInFactory, ngOnDestroy);
}
} else {
hooks.push(contextIndex, ngOnDestroy);
}
}
}
}
function multiFactoryAdd(multiFactory2, factory, isComponentProvider) {
if (isComponentProvider) {
multiFactory2.componentProviders++;
}
return multiFactory2.multi.push(factory) - 1;
}
function indexOf(item, arr, begin, end) {
for (let i = begin; i < end; i++) {
if (arr[i] === item)
return i;
}
return -1;
}
function multiProvidersFactoryResolver(_, flags, tData, lData, tNode) {
return multiResolve(this.multi, []);
}
function multiViewProvidersFactoryResolver(_, _flags, _tData, lView, tNode) {
const factories = this.multi;
let result;
if (this.providerFactory) {
const componentCount = this.providerFactory.componentProviders;
const multiProviders = getNodeInjectable(lView, lView[TVIEW], this.providerFactory.index, tNode);
result = multiProviders.slice(0, componentCount);
multiResolve(factories, result);
for (let i = componentCount; i < multiProviders.length; i++) {
result.push(multiProviders[i]);
}
} else {
result = [];
multiResolve(factories, result);
}
return result;
}
function multiResolve(factories, result) {
for (let i = 0; i < factories.length; i++) {
const factory = factories[i];
result.push(factory());
}
return result;
}
function multiFactory(factoryFn, index, isViewProvider, isComponent2, f, provider) {
const factory = new NodeInjectorFactory(factoryFn, isViewProvider, \u0275\u0275directiveInject, ngDevMode ? providerName(provider) : null);
factory.multi = [];
factory.index = index;
factory.componentProviders = 0;
multiFactoryAdd(factory, f, isComponent2 && !isViewProvider);
return factory;
}
function providerName(provider) {
if (Array.isArray(provider)) {
return null;
}
if (isTypeProvider(provider)) {
return provider.name;
} else if (isClassProvider(provider)) {
if (provider.provide instanceof InjectionToken) {
return `('${provider.provide.toString()}':${provider.useClass.name})`;
}
return provider.useClass.name;
} else if (provider.provide instanceof InjectionToken) {
return provider.provide.toString();
} else if (typeof provider.provide === "string") {
return provider.provide;
} else {
return null;
}
}
function \u0275\u0275ProvidersFeature(providers, viewProviders = []) {
return (definition) => {
definition.providersResolver = (def, processProvidersFn) => {
return providersResolver(
def,
//
processProvidersFn ? processProvidersFn(providers) : providers,
//
viewProviders
);
};
};
}
function \u0275\u0275ExternalStylesFeature(styleUrls) {
return (definition) => {
if (styleUrls.length < 1) {
return;
}
definition.getExternalStyles = (encapsulationId) => {
const urls = styleUrls.map((value) => value + "?ngcomp" + (encapsulationId ? "=" + encodeURIComponent(encapsulationId) : "") + "&e=" + definition.encapsulation);
return urls;
};
};
}
function \u0275\u0275AnimationsFeature() {
return () => {
setAnimationElementRemovalRegistry(new ElementRegistry());
};
}
function \u0275\u0275setComponentScope(type, directives, pipes) {
const def = type.\u0275cmp;
def.directiveDefs = extractDefListOrFactory(directives, extractDirectiveDef);
def.pipeDefs = extractDefListOrFactory(pipes, getPipeDef);
}
function \u0275\u0275setNgModuleScope(type, scope) {
return noSideEffects(() => {
const ngModuleDef = getNgModuleDefOrThrow(type);
ngModuleDef.declarations = convertToTypeArray(scope.declarations || EMPTY_ARRAY);
ngModuleDef.imports = convertToTypeArray(scope.imports || EMPTY_ARRAY);
ngModuleDef.exports = convertToTypeArray(scope.exports || EMPTY_ARRAY);
if (scope.bootstrap) {
ngModuleDef.bootstrap = convertToTypeArray(scope.bootstrap);
}
depsTracker.registerNgModule(type, scope);
});
}
function convertToTypeArray(values) {
if (typeof values === "function") {
return values;
}
const flattenValues = flatten(values);
if (flattenValues.some(isForwardRef)) {
return () => flattenValues.map(resolveForwardRef).map(maybeUnwrapModuleWithProviders);
} else {
return flattenValues.map(maybeUnwrapModuleWithProviders);
}
}
function maybeUnwrapModuleWithProviders(value) {
return isModuleWithProviders(value) ? value.ngModule : value;
}
function \u0275\u0275pureFunction0(slotOffset, pureFn, thisArg) {
const bindingIndex = getBindingRoot() + slotOffset;
const lView = getLView();
return lView[bindingIndex] === NO_CHANGE ? updateBinding(lView, bindingIndex, thisArg ? pureFn.call(thisArg) : pureFn()) : getBinding(lView, bindingIndex);
}
function \u0275\u0275pureFunction1(slotOffset, pureFn, exp, thisArg) {
return pureFunction1Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp, thisArg);
}
function \u0275\u0275pureFunction2(slotOffset, pureFn, exp1, exp2, thisArg) {
return pureFunction2Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, thisArg);
}
function \u0275\u0275pureFunction3(slotOffset, pureFn, exp1, exp2, exp3, thisArg) {
return pureFunction3Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, thisArg);
}
function \u0275\u0275pureFunction4(slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {
return pureFunction4Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg);
}
function \u0275\u0275pureFunction5(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, thisArg) {
const bindingIndex = getBindingRoot() + slotOffset;
const lView = getLView();
const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);
return bindingUpdated(lView, bindingIndex + 4, exp5) || different ? updateBinding(lView, bindingIndex + 5, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5) : pureFn(exp1, exp2, exp3, exp4, exp5)) : getBinding(lView, bindingIndex + 5);
}
function \u0275\u0275pureFunction6(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) {
const bindingIndex = getBindingRoot() + slotOffset;
const lView = getLView();
const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);
return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ? updateBinding(lView, bindingIndex + 6, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) : pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) : getBinding(lView, bindingIndex + 6);
}
function \u0275\u0275pureFunction7(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, thisArg) {
const bindingIndex = getBindingRoot() + slotOffset;
const lView = getLView();
let different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);
return bindingUpdated3(lView, bindingIndex + 4, exp5, exp6, exp7) || different ? updateBinding(lView, bindingIndex + 7, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7) : pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7)) : getBinding(lView, bindingIndex + 7);
}
function \u0275\u0275pureFunction8(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8, thisArg) {
const bindingIndex = getBindingRoot() + slotOffset;
const lView = getLView();
const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);
return bindingUpdated4(lView, bindingIndex + 4, exp5, exp6, exp7, exp8) || different ? updateBinding(lView, bindingIndex + 8, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8) : pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8)) : getBinding(lView, bindingIndex + 8);
}
function \u0275\u0275pureFunctionV(slotOffset, pureFn, exps, thisArg) {
return pureFunctionVInternal(getLView(), getBindingRoot(), slotOffset, pureFn, exps, thisArg);
}
function getPureFunctionReturnValue(lView, returnValueIndex) {
ngDevMode && assertIndexInRange(lView, returnValueIndex);
const lastReturnValue = lView[returnValueIndex];
return lastReturnValue === NO_CHANGE ? void 0 : lastReturnValue;
}
function pureFunction1Internal(lView, bindingRoot, slotOffset, pureFn, exp, thisArg) {
const bindingIndex = bindingRoot + slotOffset;
return bindingUpdated(lView, bindingIndex, exp) ? updateBinding(lView, bindingIndex + 1, thisArg ? pureFn.call(thisArg, exp) : pureFn(exp)) : getPureFunctionReturnValue(lView, bindingIndex + 1);
}
function pureFunction2Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, thisArg) {
const bindingIndex = bindingRoot + slotOffset;
return bindingUpdated2(lView, bindingIndex, exp1, exp2) ? updateBinding(lView, bindingIndex + 2, thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2)) : getPureFunctionReturnValue(lView, bindingIndex + 2);
}
function pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {
const bindingIndex = bindingRoot + slotOffset;
return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ? updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) : getPureFunctionReturnValue(lView, bindingIndex + 3);
}
function pureFunction4Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {
const bindingIndex = bindingRoot + slotOffset;
return bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) ? updateBinding(lView, bindingIndex + 4, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4)) : getPureFunctionReturnValue(lView, bindingIndex + 4);
}
function pureFunctionVInternal(lView, bindingRoot, slotOffset, pureFn, exps, thisArg) {
let bindingIndex = bindingRoot + slotOffset;
let different = false;
for (let i = 0; i < exps.length; i++) {
bindingUpdated(lView, bindingIndex++, exps[i]) && (different = true);
}
return different ? updateBinding(lView, bindingIndex, pureFn.apply(thisArg, exps)) : getPureFunctionReturnValue(lView, bindingIndex);
}
function \u0275\u0275pipe(index, pipeName) {
const tView = getTView();
let pipeDef;
const adjustedIndex = index + HEADER_OFFSET;
if (tView.firstCreatePass) {
pipeDef = getPipeDef2(pipeName, tView.pipeRegistry);
tView.data[adjustedIndex] = pipeDef;
if (pipeDef.onDestroy) {
(tView.destroyHooks ??= []).push(adjustedIndex, pipeDef.onDestroy);
}
} else {
pipeDef = tView.data[adjustedIndex];
}
const pipeFactory = pipeDef.factory || (pipeDef.factory = getFactoryDef(pipeDef.type, true));
let previousInjectorProfilerContext;
if (ngDevMode) {
previousInjectorProfilerContext = setInjectorProfilerContext({
injector: new NodeInjector(getCurrentTNode(), getLView()),
token: pipeDef.type
});
}
const previousInjectImplementation = setInjectImplementation(\u0275\u0275directiveInject);
try {
const previousIncludeViewProviders = setIncludeViewProviders(false);
const pipeInstance = pipeFactory();
setIncludeViewProviders(previousIncludeViewProviders);
store(tView, getLView(), adjustedIndex, pipeInstance);
return pipeInstance;
} finally {
setInjectImplementation(previousInjectImplementation);
ngDevMode && setInjectorProfilerContext(previousInjectorProfilerContext);
}
}
function getPipeDef2(name, registry2) {
if (registry2) {
if (ngDevMode) {
const pipes = registry2.filter((pipe) => pipe.name === name);
if (pipes.length > 1) {
console.warn(formatRuntimeError(313, getMultipleMatchingPipesMessage(name)));
}
}
for (let i = registry2.length - 1; i >= 0; i--) {
const pipeDef = registry2[i];
if (name === pipeDef.name) {
return pipeDef;
}
}
}
if (ngDevMode) {
throw new RuntimeError(-302, getPipeNotFoundErrorMessage(name));
}
return;
}
function getMultipleMatchingPipesMessage(name) {
const lView = getLView();
const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
const context2 = declarationLView[CONTEXT];
const hostIsStandalone = isHostComponentStandalone(lView);
const componentInfoMessage = context2 ? ` in the '${context2.constructor.name}' component` : "";
const verifyMessage = `check ${hostIsStandalone ? "'@Component.imports' of this component" : "the imports of this module"}`;
const errorMessage = `Multiple pipes match the name \`${name}\`${componentInfoMessage}. ${verifyMessage}`;
return errorMessage;
}
function getPipeNotFoundErrorMessage(name) {
const lView = getLView();
const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
const context2 = declarationLView[CONTEXT];
const hostIsStandalone = isHostComponentStandalone(lView);
const componentInfoMessage = context2 ? ` in the '${context2.constructor.name}' component` : "";
const verifyMessage = `Verify that it is ${hostIsStandalone ? "included in the '@Component.imports' of this component" : "declared or imported in this module"}`;
const errorMessage = `The pipe '${name}' could not be found${componentInfoMessage}. ${verifyMessage}`;
return errorMessage;
}
function \u0275\u0275pipeBind1(index, offset, v1) {
const adjustedIndex = index + HEADER_OFFSET;
const lView = getLView();
const pipeInstance = load(lView, adjustedIndex);
return isPure(lView, adjustedIndex) ? pureFunction1Internal(lView, getBindingRoot(), offset, pipeInstance.transform, v1, pipeInstance) : pipeInstance.transform(v1);
}
function \u0275\u0275pipeBind2(index, slotOffset, v1, v2) {
const adjustedIndex = index + HEADER_OFFSET;
const lView = getLView();
const pipeInstance = load(lView, adjustedIndex);
return isPure(lView, adjustedIndex) ? pureFunction2Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, pipeInstance) : pipeInstance.transform(v1, v2);
}
function \u0275\u0275pipeBind3(index, slotOffset, v1, v2, v3) {
const adjustedIndex = index + HEADER_OFFSET;
const lView = getLView();
const pipeInstance = load(lView, adjustedIndex);
return isPure(lView, adjustedIndex) ? pureFunction3Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, pipeInstance) : pipeInstance.transform(v1, v2, v3);
}
function \u0275\u0275pipeBind4(index, slotOffset, v1, v2, v3, v4) {
const adjustedIndex = index + HEADER_OFFSET;
const lView = getLView();
const pipeInstance = load(lView, adjustedIndex);
return isPure(lView, adjustedIndex) ? pureFunction4Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, v4, pipeInstance) : pipeInstance.transform(v1, v2, v3, v4);
}
function \u0275\u0275pipeBindV(index, slotOffset, values) {
const adjustedIndex = index + HEADER_OFFSET;
const lView = getLView();
const pipeInstance = load(lView, adjustedIndex);
return isPure(lView, adjustedIndex) ? pureFunctionVInternal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, values, pipeInstance) : pipeInstance.transform.apply(pipeInstance, values);
}
function isPure(lView, index) {
return lView[TVIEW].data[index].pure;
}
function \u0275\u0275templateRefExtractor(tNode, lView) {
return createTemplateRef(tNode, lView);
}
function \u0275\u0275getComponentDepsFactory(type, rawImports) {
return () => {
try {
return depsTracker.getComponentDependencies(type, rawImports).dependencies;
} catch (e) {
console.error(`Computing dependencies in local compilation mode for the component "${type.name}" failed with the exception:`, e);
throw e;
}
};
}
function \u0275setClassDebugInfo(type, debugInfo) {
const def = getComponentDef(type);
if (def !== null) {
def.debugInfo = debugInfo;
}
}
function \u0275\u0275getReplaceMetadataURL(id, timestamp, base) {
const url = `./@ng/component?c=${id}&t=${encodeURIComponent(timestamp)}`;
return new URL(url, base).href;
}
function \u0275\u0275replaceMetadata(type, applyMetadata, namespaces, locals, importMeta = null, id = null) {
ngDevMode && assertComponentDef(type);
const currentDef = getComponentDef(type);
applyMetadata.apply(null, [type, namespaces, ...locals]);
const { newDef, oldDef } = mergeWithExistingDefinition(currentDef, getComponentDef(type));
type[NG_COMP_DEF] = newDef;
if (oldDef.tView) {
const trackedViews = getTrackedLViews().values();
for (const root of trackedViews) {
if (isRootView(root) && root[PARENT] === null) {
recreateMatchingLViews(importMeta, id, newDef, oldDef, root);
}
}
}
}
function mergeWithExistingDefinition(currentDef, newDef) {
const clone = __spreadValues({}, currentDef);
const replacement = Object.assign(currentDef, newDef, {
// We need to keep the existing directive and pipe defs, because they can get patched on
// by a call to `setComponentScope` from a module file. That call won't make it into the
// HMR replacement function, because it lives in an entirely different file.
directiveDefs: clone.directiveDefs,
pipeDefs: clone.pipeDefs,
// Preserve the old `setInput` function, because it has some state.
// This is fine, because the component instance is preserved as well.
setInput: clone.setInput,
// Externally this is redundant since we redeclare the definition using the original type.
// Internally we may receive a definition with an alternate, but identical, type so we have
// to ensure that the original one is preserved.
type: clone.type
});
ngDevMode && assertEqual(replacement, currentDef, "Expected definition to be merged in place");
return { newDef: replacement, oldDef: clone };
}
function recreateMatchingLViews(importMeta, id, newDef, oldDef, rootLView) {
ngDevMode && assertDefined(oldDef.tView, "Expected a component definition that has been instantiated at least once");
const tView = rootLView[TVIEW];
if (tView === oldDef.tView) {
ngDevMode && assertComponentDef(oldDef.type);
recreateLView(importMeta, id, newDef, oldDef, rootLView);
return;
}
for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {
const current = rootLView[i];
if (isLContainer(current)) {
if (isLView(current[HOST])) {
recreateMatchingLViews(importMeta, id, newDef, oldDef, current[HOST]);
}
for (let j = CONTAINER_HEADER_OFFSET; j < current.length; j++) {
recreateMatchingLViews(importMeta, id, newDef, oldDef, current[j]);
}
} else if (isLView(current)) {
recreateMatchingLViews(importMeta, id, newDef, oldDef, current);
}
}
}
function clearRendererCache(factory, def) {
factory.componentReplaced?.(def.id);
}
function recreateLView(importMeta, id, newDef, oldDef, lView) {
const instance = lView[CONTEXT];
let host = lView[HOST];
const parentLView = lView[PARENT];
ngDevMode && assertLView(parentLView);
const tNode = lView[T_HOST];
ngDevMode && assertTNodeType(
tNode,
2
/* TNodeType.Element */
);
ngDevMode && assertNotEqual(newDef, oldDef, "Expected different component definition");
const zone = lView[INJECTOR].get(NgZone, null);
const recreate = () => {
if (oldDef.encapsulation === ViewEncapsulation.ShadowDom) {
const newHost = host.cloneNode(false);
host.replaceWith(newHost);
host = newHost;
}
const newTView = getOrCreateComponentTView(newDef);
const newLView = createLView(
parentLView,
newTView,
instance,
getInitialLViewFlagsFromDef(newDef),
host,
tNode,
null,
null,
// The renderer will be created a bit further down once the old one is destroyed.
null,
null,
null
);
replaceLViewInTree(parentLView, lView, newLView, tNode.index);
destroyLView(lView[TVIEW], lView);
const rendererFactory = lView[ENVIRONMENT].rendererFactory;
clearRendererCache(rendererFactory, oldDef);
newLView[RENDERER] = rendererFactory.createRenderer(host, newDef);
removeViewFromDOM(lView[TVIEW], lView);
resetProjectionState(tNode);
renderView(newTView, newLView, instance);
refreshView(newTView, newLView, newTView.template, instance);
};
if (zone === null) {
executeWithInvalidateFallback(importMeta, id, recreate);
} else {
zone.run(() => executeWithInvalidateFallback(importMeta, id, recreate));
}
}
function executeWithInvalidateFallback(importMeta, id, callback) {
try {
callback();
} catch (e) {
const error = e;
if (id !== null && error.message) {
const toLog = error.message + (error.stack ? "\n" + error.stack : "");
importMeta?.hot?.send?.("angular:invalidate", { id, message: toLog, error: true });
}
throw e;
}
}
function replaceLViewInTree(parentLView, oldLView, newLView, index) {
for (let i = HEADER_OFFSET; i < parentLView[TVIEW].bindingStartIndex; i++) {
const current = parentLView[i];
if ((isLView(current) || isLContainer(current)) && current[NEXT] === oldLView) {
current[NEXT] = newLView;
break;
}
}
if (parentLView[CHILD_HEAD] === oldLView) {
parentLView[CHILD_HEAD] = newLView;
}
if (parentLView[CHILD_TAIL] === oldLView) {
parentLView[CHILD_TAIL] = newLView;
}
newLView[NEXT] = oldLView[NEXT];
oldLView[NEXT] = null;
parentLView[index] = newLView;
}
function resetProjectionState(tNode) {
if (tNode.projection !== null) {
for (const current of tNode.projection) {
if (isTNodeShape(current)) {
current.projectionNext = null;
current.flags &= ~2;
}
}
tNode.projection = null;
}
}
var angularCoreEnv = /* @__PURE__ */ (() => ({
"\u0275\u0275animateEnter": \u0275\u0275animateEnter,
"\u0275\u0275animateEnterListener": \u0275\u0275animateEnterListener,
"\u0275\u0275animateLeave": \u0275\u0275animateLeave,
"\u0275\u0275animateLeaveListener": \u0275\u0275animateLeaveListener,
"\u0275\u0275attribute": \u0275\u0275attribute,
"\u0275\u0275defineComponent": \u0275\u0275defineComponent,
"\u0275\u0275defineDirective": \u0275\u0275defineDirective,
"\u0275\u0275defineInjectable": \u0275\u0275defineInjectable,
"\u0275\u0275defineInjector": \u0275\u0275defineInjector,
"\u0275\u0275defineNgModule": \u0275\u0275defineNgModule,
"\u0275\u0275definePipe": \u0275\u0275definePipe,
"\u0275\u0275directiveInject": \u0275\u0275directiveInject,
"\u0275\u0275getInheritedFactory": \u0275\u0275getInheritedFactory,
"\u0275\u0275inject": \u0275\u0275inject,
"\u0275\u0275injectAttribute": \u0275\u0275injectAttribute,
"\u0275\u0275invalidFactory": \u0275\u0275invalidFactory,
"\u0275\u0275invalidFactoryDep": \u0275\u0275invalidFactoryDep,
"\u0275\u0275templateRefExtractor": \u0275\u0275templateRefExtractor,
"\u0275\u0275resetView": \u0275\u0275resetView,
"\u0275\u0275HostDirectivesFeature": \u0275\u0275HostDirectivesFeature,
"\u0275\u0275NgOnChangesFeature": \u0275\u0275NgOnChangesFeature,
"\u0275\u0275ProvidersFeature": \u0275\u0275ProvidersFeature,
"\u0275\u0275CopyDefinitionFeature": \u0275\u0275CopyDefinitionFeature,
"\u0275\u0275InheritDefinitionFeature": \u0275\u0275InheritDefinitionFeature,
"\u0275\u0275ExternalStylesFeature": \u0275\u0275ExternalStylesFeature,
"\u0275\u0275AnimationsFeature": \u0275\u0275AnimationsFeature,
"\u0275\u0275nextContext": \u0275\u0275nextContext,
"\u0275\u0275namespaceHTML": \u0275\u0275namespaceHTML,
"\u0275\u0275namespaceMathML": \u0275\u0275namespaceMathML,
"\u0275\u0275namespaceSVG": \u0275\u0275namespaceSVG,
"\u0275\u0275enableBindings": \u0275\u0275enableBindings,
"\u0275\u0275disableBindings": \u0275\u0275disableBindings,
"\u0275\u0275elementStart": \u0275\u0275elementStart,
"\u0275\u0275elementEnd": \u0275\u0275elementEnd,
"\u0275\u0275element": \u0275\u0275element,
"\u0275\u0275elementContainerStart": \u0275\u0275elementContainerStart,
"\u0275\u0275elementContainerEnd": \u0275\u0275elementContainerEnd,
"\u0275\u0275domElement": \u0275\u0275domElement,
"\u0275\u0275domElementStart": \u0275\u0275domElementStart,
"\u0275\u0275domElementEnd": \u0275\u0275domElementEnd,
"\u0275\u0275domElementContainer": \u0275\u0275domElementContainer,
"\u0275\u0275domElementContainerStart": \u0275\u0275domElementContainerStart,
"\u0275\u0275domElementContainerEnd": \u0275\u0275domElementContainerEnd,
"\u0275\u0275domTemplate": \u0275\u0275domTemplate,
"\u0275\u0275domListener": \u0275\u0275domListener,
"\u0275\u0275elementContainer": \u0275\u0275elementContainer,
"\u0275\u0275pureFunction0": \u0275\u0275pureFunction0,
"\u0275\u0275pureFunction1": \u0275\u0275pureFunction1,
"\u0275\u0275pureFunction2": \u0275\u0275pureFunction2,
"\u0275\u0275pureFunction3": \u0275\u0275pureFunction3,
"\u0275\u0275pureFunction4": \u0275\u0275pureFunction4,
"\u0275\u0275pureFunction5": \u0275\u0275pureFunction5,
"\u0275\u0275pureFunction6": \u0275\u0275pureFunction6,
"\u0275\u0275pureFunction7": \u0275\u0275pureFunction7,
"\u0275\u0275pureFunction8": \u0275\u0275pureFunction8,
"\u0275\u0275pureFunctionV": \u0275\u0275pureFunctionV,
"\u0275\u0275getCurrentView": \u0275\u0275getCurrentView,
"\u0275\u0275restoreView": \u0275\u0275restoreView,
"\u0275\u0275listener": \u0275\u0275listener,
"\u0275\u0275projection": \u0275\u0275projection,
"\u0275\u0275syntheticHostProperty": \u0275\u0275syntheticHostProperty,
"\u0275\u0275syntheticHostListener": \u0275\u0275syntheticHostListener,
"\u0275\u0275pipeBind1": \u0275\u0275pipeBind1,
"\u0275\u0275pipeBind2": \u0275\u0275pipeBind2,
"\u0275\u0275pipeBind3": \u0275\u0275pipeBind3,
"\u0275\u0275pipeBind4": \u0275\u0275pipeBind4,
"\u0275\u0275pipeBindV": \u0275\u0275pipeBindV,
"\u0275\u0275projectionDef": \u0275\u0275projectionDef,
"\u0275\u0275domProperty": \u0275\u0275domProperty,
"\u0275\u0275ariaProperty": \u0275\u0275ariaProperty,
"\u0275\u0275property": \u0275\u0275property,
"\u0275\u0275pipe": \u0275\u0275pipe,
"\u0275\u0275queryRefresh": \u0275\u0275queryRefresh,
"\u0275\u0275queryAdvance": \u0275\u0275queryAdvance,
"\u0275\u0275viewQuery": \u0275\u0275viewQuery,
"\u0275\u0275viewQuerySignal": \u0275\u0275viewQuerySignal,
"\u0275\u0275loadQuery": \u0275\u0275loadQuery,
"\u0275\u0275contentQuery": \u0275\u0275contentQuery,
"\u0275\u0275contentQuerySignal": \u0275\u0275contentQuerySignal,
"\u0275\u0275reference": \u0275\u0275reference,
"\u0275\u0275classMap": \u0275\u0275classMap,
"\u0275\u0275styleMap": \u0275\u0275styleMap,
"\u0275\u0275styleProp": \u0275\u0275styleProp,
"\u0275\u0275classProp": \u0275\u0275classProp,
"\u0275\u0275advance": \u0275\u0275advance,
"\u0275\u0275template": \u0275\u0275template,
"\u0275\u0275conditional": \u0275\u0275conditional,
"\u0275\u0275conditionalCreate": \u0275\u0275conditionalCreate,
"\u0275\u0275conditionalBranchCreate": \u0275\u0275conditionalBranchCreate,
"\u0275\u0275defer": \u0275\u0275defer,
"\u0275\u0275deferWhen": \u0275\u0275deferWhen,
"\u0275\u0275deferOnIdle": \u0275\u0275deferOnIdle,
"\u0275\u0275deferOnImmediate": \u0275\u0275deferOnImmediate,
"\u0275\u0275deferOnTimer": \u0275\u0275deferOnTimer,
"\u0275\u0275deferOnHover": \u0275\u0275deferOnHover,
"\u0275\u0275deferOnInteraction": \u0275\u0275deferOnInteraction,
"\u0275\u0275deferOnViewport": \u0275\u0275deferOnViewport,
"\u0275\u0275deferPrefetchWhen": \u0275\u0275deferPrefetchWhen,
"\u0275\u0275deferPrefetchOnIdle": \u0275\u0275deferPrefetchOnIdle,
"\u0275\u0275deferPrefetchOnImmediate": \u0275\u0275deferPrefetchOnImmediate,
"\u0275\u0275deferPrefetchOnTimer": \u0275\u0275deferPrefetchOnTimer,
"\u0275\u0275deferPrefetchOnHover": \u0275\u0275deferPrefetchOnHover,
"\u0275\u0275deferPrefetchOnInteraction": \u0275\u0275deferPrefetchOnInteraction,
"\u0275\u0275deferPrefetchOnViewport": \u0275\u0275deferPrefetchOnViewport,
"\u0275\u0275deferHydrateWhen": \u0275\u0275deferHydrateWhen,
"\u0275\u0275deferHydrateNever": \u0275\u0275deferHydrateNever,
"\u0275\u0275deferHydrateOnIdle": \u0275\u0275deferHydrateOnIdle,
"\u0275\u0275deferHydrateOnImmediate": \u0275\u0275deferHydrateOnImmediate,
"\u0275\u0275deferHydrateOnTimer": \u0275\u0275deferHydrateOnTimer,
"\u0275\u0275deferHydrateOnHover": \u0275\u0275deferHydrateOnHover,
"\u0275\u0275deferHydrateOnInteraction": \u0275\u0275deferHydrateOnInteraction,
"\u0275\u0275deferHydrateOnViewport": \u0275\u0275deferHydrateOnViewport,
"\u0275\u0275deferEnableTimerScheduling": \u0275\u0275deferEnableTimerScheduling,
"\u0275\u0275repeater": \u0275\u0275repeater,
"\u0275\u0275repeaterCreate": \u0275\u0275repeaterCreate,
"\u0275\u0275repeaterTrackByIndex": \u0275\u0275repeaterTrackByIndex,
"\u0275\u0275repeaterTrackByIdentity": \u0275\u0275repeaterTrackByIdentity,
"\u0275\u0275componentInstance": \u0275\u0275componentInstance,
"\u0275\u0275text": \u0275\u0275text,
"\u0275\u0275textInterpolate": \u0275\u0275textInterpolate,
"\u0275\u0275textInterpolate1": \u0275\u0275textInterpolate1,
"\u0275\u0275textInterpolate2": \u0275\u0275textInterpolate2,
"\u0275\u0275textInterpolate3": \u0275\u0275textInterpolate3,
"\u0275\u0275textInterpolate4": \u0275\u0275textInterpolate4,
"\u0275\u0275textInterpolate5": \u0275\u0275textInterpolate5,
"\u0275\u0275textInterpolate6": \u0275\u0275textInterpolate6,
"\u0275\u0275textInterpolate7": \u0275\u0275textInterpolate7,
"\u0275\u0275textInterpolate8": \u0275\u0275textInterpolate8,
"\u0275\u0275textInterpolateV": \u0275\u0275textInterpolateV,
"\u0275\u0275i18n": \u0275\u0275i18n,
"\u0275\u0275i18nAttributes": \u0275\u0275i18nAttributes,
"\u0275\u0275i18nExp": \u0275\u0275i18nExp,
"\u0275\u0275i18nStart": \u0275\u0275i18nStart,
"\u0275\u0275i18nEnd": \u0275\u0275i18nEnd,
"\u0275\u0275i18nApply": \u0275\u0275i18nApply,
"\u0275\u0275i18nPostprocess": \u0275\u0275i18nPostprocess,
"\u0275\u0275resolveWindow": \u0275\u0275resolveWindow,
"\u0275\u0275resolveDocument": \u0275\u0275resolveDocument,
"\u0275\u0275resolveBody": \u0275\u0275resolveBody,
"\u0275\u0275setComponentScope": \u0275\u0275setComponentScope,
"\u0275\u0275setNgModuleScope": \u0275\u0275setNgModuleScope,
"\u0275\u0275registerNgModuleType": registerNgModuleType,
"\u0275\u0275getComponentDepsFactory": \u0275\u0275getComponentDepsFactory,
"\u0275setClassDebugInfo": \u0275setClassDebugInfo,
"\u0275\u0275declareLet": \u0275\u0275declareLet,
"\u0275\u0275storeLet": \u0275\u0275storeLet,
"\u0275\u0275readContextLet": \u0275\u0275readContextLet,
"\u0275\u0275attachSourceLocations": \u0275\u0275attachSourceLocations,
"\u0275\u0275interpolate": \u0275\u0275interpolate,
"\u0275\u0275interpolate1": \u0275\u0275interpolate1,
"\u0275\u0275interpolate2": \u0275\u0275interpolate2,
"\u0275\u0275interpolate3": \u0275\u0275interpolate3,
"\u0275\u0275interpolate4": \u0275\u0275interpolate4,
"\u0275\u0275interpolate5": \u0275\u0275interpolate5,
"\u0275\u0275interpolate6": \u0275\u0275interpolate6,
"\u0275\u0275interpolate7": \u0275\u0275interpolate7,
"\u0275\u0275interpolate8": \u0275\u0275interpolate8,
"\u0275\u0275interpolateV": \u0275\u0275interpolateV,
"\u0275\u0275sanitizeHtml": \u0275\u0275sanitizeHtml,
"\u0275\u0275sanitizeStyle": \u0275\u0275sanitizeStyle,
"\u0275\u0275sanitizeResourceUrl": \u0275\u0275sanitizeResourceUrl,
"\u0275\u0275sanitizeScript": \u0275\u0275sanitizeScript,
"\u0275\u0275sanitizeUrl": \u0275\u0275sanitizeUrl,
"\u0275\u0275sanitizeUrlOrResourceUrl": \u0275\u0275sanitizeUrlOrResourceUrl,
"\u0275\u0275trustConstantHtml": \u0275\u0275trustConstantHtml,
"\u0275\u0275trustConstantResourceUrl": \u0275\u0275trustConstantResourceUrl,
"\u0275\u0275validateIframeAttribute": \u0275\u0275validateIframeAttribute,
"forwardRef": forwardRef,
"resolveForwardRef": resolveForwardRef,
"\u0275\u0275twoWayProperty": \u0275\u0275twoWayProperty,
"\u0275\u0275twoWayBindingSet": \u0275\u0275twoWayBindingSet,
"\u0275\u0275twoWayListener": \u0275\u0275twoWayListener,
"\u0275\u0275replaceMetadata": \u0275\u0275replaceMetadata,
"\u0275\u0275getReplaceMetadataURL": \u0275\u0275getReplaceMetadataURL
}))();
var jitOptions = null;
function setJitOptions(options) {
if (jitOptions !== null) {
if (options.defaultEncapsulation !== jitOptions.defaultEncapsulation) {
ngDevMode && console.error("Provided value for `defaultEncapsulation` can not be changed once it has been set.");
return;
}
if (options.preserveWhitespaces !== jitOptions.preserveWhitespaces) {
ngDevMode && console.error("Provided value for `preserveWhitespaces` can not be changed once it has been set.");
return;
}
}
jitOptions = options;
}
function getJitOptions() {
return jitOptions;
}
var moduleQueue = [];
function enqueueModuleForDelayedScoping(moduleType, ngModule) {
moduleQueue.push({ moduleType, ngModule });
}
var flushingModuleQueue = false;
function flushModuleScopingQueueAsMuchAsPossible() {
if (!flushingModuleQueue) {
flushingModuleQueue = true;
try {
for (let i = moduleQueue.length - 1; i >= 0; i--) {
const { moduleType, ngModule } = moduleQueue[i];
if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {
moduleQueue.splice(i, 1);
setScopeOnDeclaredComponents(moduleType, ngModule);
}
}
} finally {
flushingModuleQueue = false;
}
}
}
function isResolvedDeclaration(declaration) {
if (Array.isArray(declaration)) {
return declaration.every(isResolvedDeclaration);
}
return !!resolveForwardRef(declaration);
}
function compileNgModule(moduleType, ngModule = {}) {
compileNgModuleDefs(moduleType, ngModule);
if (ngModule.id !== void 0) {
registerNgModuleType(moduleType, ngModule.id);
}
enqueueModuleForDelayedScoping(moduleType, ngModule);
}
function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInRoot = false) {
ngDevMode && assertDefined(moduleType, "Required value moduleType");
ngDevMode && assertDefined(ngModule, "Required value ngModule");
const declarations = flatten(ngModule.declarations || EMPTY_ARRAY);
let ngModuleDef = null;
Object.defineProperty(moduleType, NG_MOD_DEF, {
configurable: true,
get: () => {
if (ngModuleDef === null) {
if (ngDevMode && ngModule.imports && ngModule.imports.indexOf(moduleType) > -1) {
throw new Error(`'${stringifyForError(moduleType)}' module can't import itself`);
}
const compiler = getCompilerFacade({
usage: 0,
kind: "NgModule",
type: moduleType
});
ngModuleDef = compiler.compileNgModule(angularCoreEnv, `ng:///${moduleType.name}/\u0275mod.js`, {
type: moduleType,
bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY).map(resolveForwardRef),
declarations: declarations.map(resolveForwardRef),
imports: flatten(ngModule.imports || EMPTY_ARRAY).map(resolveForwardRef).map(expandModuleWithProviders),
exports: flatten(ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef).map(expandModuleWithProviders),
schemas: ngModule.schemas ? flatten(ngModule.schemas) : null,
id: ngModule.id || null
});
if (!ngModuleDef.schemas) {
ngModuleDef.schemas = [];
}
}
return ngModuleDef;
}
});
let ngFactoryDef = null;
Object.defineProperty(moduleType, NG_FACTORY_DEF, {
get: () => {
if (ngFactoryDef === null) {
const compiler = getCompilerFacade({
usage: 0,
kind: "NgModule",
type: moduleType
});
ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${moduleType.name}/\u0275fac.js`, {
name: moduleType.name,
type: moduleType,
deps: reflectDependencies(moduleType),
target: compiler.FactoryTarget.NgModule,
typeArgumentCount: 0
});
}
return ngFactoryDef;
},
// Make the property configurable in dev mode to allow overriding in tests
configurable: !!ngDevMode
});
let ngInjectorDef = null;
Object.defineProperty(moduleType, NG_INJ_DEF, {
get: () => {
if (ngInjectorDef === null) {
ngDevMode && verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot);
const meta = {
name: moduleType.name,
type: moduleType,
providers: ngModule.providers || EMPTY_ARRAY,
imports: [
(ngModule.imports || EMPTY_ARRAY).map(resolveForwardRef),
(ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef)
]
};
const compiler = getCompilerFacade({
usage: 0,
kind: "NgModule",
type: moduleType
});
ngInjectorDef = compiler.compileInjector(angularCoreEnv, `ng:///${moduleType.name}/\u0275inj.js`, meta);
}
return ngInjectorDef;
},
// Make the property configurable in dev mode to allow overriding in tests
configurable: !!ngDevMode
});
}
function generateStandaloneInDeclarationsError(type, location2) {
const prefix = `Unexpected "${stringifyForError(type)}" found in the "declarations" array of the`;
const suffix = `"${stringifyForError(type)}" is marked as standalone and can't be declared in any NgModule - did you intend to import it instead (by adding it to the "imports" array)?`;
return `${prefix} ${location2}, ${suffix}`;
}
function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot, importingModule) {
if (verifiedNgModule.get(moduleType))
return;
if (isStandalone(moduleType))
return;
verifiedNgModule.set(moduleType, true);
moduleType = resolveForwardRef(moduleType);
let ngModuleDef;
if (importingModule) {
ngModuleDef = getNgModuleDef(moduleType);
if (!ngModuleDef) {
throw new Error(`Unexpected value '${moduleType.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);
}
} else {
ngModuleDef = getNgModuleDefOrThrow(moduleType);
}
const errors = [];
const declarations = maybeUnwrapFn(ngModuleDef.declarations);
const imports = maybeUnwrapFn(ngModuleDef.imports);
flatten(imports).map(unwrapModuleWithProvidersImports).forEach((modOrStandaloneCmpt) => {
verifySemanticsOfNgModuleImport(modOrStandaloneCmpt, moduleType);
verifySemanticsOfNgModuleDef(modOrStandaloneCmpt, false, moduleType);
});
const exports = maybeUnwrapFn(ngModuleDef.exports);
declarations.forEach(verifyDeclarationsHaveDefinitions);
declarations.forEach(verifyDirectivesHaveSelector);
declarations.forEach((declarationType) => verifyNotStandalone(declarationType, moduleType));
const combinedDeclarations = [
...declarations.map(resolveForwardRef),
...flatten(imports.map(computeCombinedExports)).map(resolveForwardRef)
];
exports.forEach(verifyExportsAreDeclaredOrReExported);
declarations.forEach((decl) => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot));
const ngModule = getAnnotation(moduleType, "NgModule");
if (ngModule) {
ngModule.imports && flatten(ngModule.imports).map(unwrapModuleWithProvidersImports).forEach((mod) => {
verifySemanticsOfNgModuleImport(mod, moduleType);
verifySemanticsOfNgModuleDef(mod, false, moduleType);
});
ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyCorrectBootstrapType);
ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyComponentIsPartOfNgModule);
}
if (errors.length) {
throw new Error(errors.join("\n"));
}
function verifyDeclarationsHaveDefinitions(type) {
type = resolveForwardRef(type);
const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef(type);
if (!def) {
errors.push(`Unexpected value '${stringifyForError(type)}' declared by the module '${stringifyForError(moduleType)}'. Please add a @Pipe/@Directive/@Component annotation.`);
}
}
function verifyDirectivesHaveSelector(type) {
type = resolveForwardRef(type);
const def = getDirectiveDef(type);
if (!getComponentDef(type) && def && def.selectors.length == 0) {
errors.push(`Directive ${stringifyForError(type)} has no selector, please add it!`);
}
}
function verifyNotStandalone(type, moduleType2) {
type = resolveForwardRef(type);
const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef(type);
if (def?.standalone) {
const location2 = `"${stringifyForError(moduleType2)}" NgModule`;
errors.push(generateStandaloneInDeclarationsError(type, location2));
}
}
function verifyExportsAreDeclaredOrReExported(type) {
type = resolveForwardRef(type);
const kind = getComponentDef(type) && "component" || getDirectiveDef(type) && "directive" || getPipeDef(type) && "pipe";
if (kind) {
if (combinedDeclarations.lastIndexOf(type) === -1) {
errors.push(`Can't export ${kind} ${stringifyForError(type)} from ${stringifyForError(moduleType)} as it was neither declared nor imported!`);
}
}
}
function verifyDeclarationIsUnique(type, suppressErrors) {
type = resolveForwardRef(type);
const existingModule = ownerNgModule.get(type);
if (existingModule && existingModule !== moduleType) {
if (!suppressErrors) {
const modules2 = [existingModule, moduleType].map(stringifyForError).sort();
errors.push(`Type ${stringifyForError(type)} is part of the declarations of 2 modules: ${modules2[0]} and ${modules2[1]}! Please consider moving ${stringifyForError(type)} to a higher module that imports ${modules2[0]} and ${modules2[1]}. You can also create a new NgModule that exports and includes ${stringifyForError(type)} then import that NgModule in ${modules2[0]} and ${modules2[1]}.`);
}
} else {
ownerNgModule.set(type, moduleType);
}
}
function verifyComponentIsPartOfNgModule(type) {
type = resolveForwardRef(type);
const existingModule = ownerNgModule.get(type);
if (!existingModule && !isStandalone(type)) {
errors.push(`Component ${stringifyForError(type)} is not part of any NgModule or the module has not been imported into your module.`);
}
}
function verifyCorrectBootstrapType(type) {
type = resolveForwardRef(type);
if (!getComponentDef(type)) {
errors.push(`${stringifyForError(type)} cannot be used as an entry component.`);
}
if (isStandalone(type)) {
errors.push(`The \`${stringifyForError(type)}\` class is a standalone component, which can not be used in the \`@NgModule.bootstrap\` array. Use the \`bootstrapApplication\` function for bootstrap instead.`);
}
}
function verifySemanticsOfNgModuleImport(type, importingModule2) {
type = resolveForwardRef(type);
const directiveDef = getComponentDef(type) || getDirectiveDef(type);
if (directiveDef !== null && !directiveDef.standalone) {
throw new Error(`Unexpected directive '${type.name}' imported by the module '${importingModule2.name}'. Please add an @NgModule annotation.`);
}
const pipeDef = getPipeDef(type);
if (pipeDef !== null && !pipeDef.standalone) {
throw new Error(`Unexpected pipe '${type.name}' imported by the module '${importingModule2.name}'. Please add an @NgModule annotation.`);
}
}
}
function unwrapModuleWithProvidersImports(typeOrWithProviders) {
typeOrWithProviders = resolveForwardRef(typeOrWithProviders);
return typeOrWithProviders.ngModule || typeOrWithProviders;
}
function getAnnotation(type, name) {
let annotation = null;
collect(type.__annotations__);
collect(type.decorators);
return annotation;
function collect(annotations) {
if (annotations) {
annotations.forEach(readAnnotation);
}
}
function readAnnotation(decorator) {
if (!annotation) {
const proto = Object.getPrototypeOf(decorator);
if (proto.ngMetadataName == name) {
annotation = decorator;
} else if (decorator.type) {
const proto2 = Object.getPrototypeOf(decorator.type);
if (proto2.ngMetadataName == name) {
annotation = decorator.args[0];
}
}
}
}
}
var ownerNgModule = /* @__PURE__ */ new WeakMap();
var verifiedNgModule = /* @__PURE__ */ new WeakMap();
function computeCombinedExports(type) {
type = resolveForwardRef(type);
const ngModuleDef = getNgModuleDef(type);
if (ngModuleDef === null) {
return [type];
}
return flatten(maybeUnwrapFn(ngModuleDef.exports).map((type2) => {
const ngModuleDef2 = getNgModuleDef(type2);
if (ngModuleDef2) {
verifySemanticsOfNgModuleDef(type2, false);
return computeCombinedExports(type2);
} else {
return type2;
}
}));
}
function setScopeOnDeclaredComponents(moduleType, ngModule) {
const declarations = flatten(ngModule.declarations || EMPTY_ARRAY);
const transitiveScopes = transitiveScopesFor(moduleType);
declarations.forEach((declaration) => {
declaration = resolveForwardRef(declaration);
if (declaration.hasOwnProperty(NG_COMP_DEF)) {
const component = declaration;
const componentDef = getComponentDef(component);
patchComponentDefWithScope(componentDef, transitiveScopes);
} else if (!declaration.hasOwnProperty(NG_DIR_DEF) && !declaration.hasOwnProperty(NG_PIPE_DEF)) {
declaration.ngSelectorScope = moduleType;
}
});
}
function patchComponentDefWithScope(componentDef, transitiveScopes) {
componentDef.directiveDefs = () => Array.from(transitiveScopes.compilation.directives).map((dir) => dir.hasOwnProperty(NG_COMP_DEF) ? getComponentDef(dir) : getDirectiveDef(dir)).filter((def) => !!def);
componentDef.pipeDefs = () => Array.from(transitiveScopes.compilation.pipes).map((pipe) => getPipeDef(pipe));
componentDef.schemas = transitiveScopes.schemas;
componentDef.tView = null;
}
function transitiveScopesFor(type) {
if (isNgModule(type)) {
const scope = depsTracker.getNgModuleScope(type);
const def = getNgModuleDefOrThrow(type);
return __spreadValues({
schemas: def.schemas || null
}, scope);
} else if (isStandalone(type)) {
const directiveDef = getComponentDef(type) || getDirectiveDef(type);
if (directiveDef !== null) {
return {
schemas: null,
compilation: {
directives: /* @__PURE__ */ new Set(),
pipes: /* @__PURE__ */ new Set()
},
exported: {
directives: /* @__PURE__ */ new Set([type]),
pipes: /* @__PURE__ */ new Set()
}
};
}
const pipeDef = getPipeDef(type);
if (pipeDef !== null) {
return {
schemas: null,
compilation: {
directives: /* @__PURE__ */ new Set(),
pipes: /* @__PURE__ */ new Set()
},
exported: {
directives: /* @__PURE__ */ new Set(),
pipes: /* @__PURE__ */ new Set([type])
}
};
}
}
throw new Error(`${type.name} does not have a module def (\u0275mod property)`);
}
function expandModuleWithProviders(value) {
if (isModuleWithProviders(value)) {
return value.ngModule;
}
return value;
}
var compilationDepth = 0;
function compileComponent(type, metadata) {
(typeof ngDevMode === "undefined" || ngDevMode) && initNgDevMode();
let ngComponentDef = null;
maybeQueueResolutionOfComponentResources(type, metadata);
addDirectiveFactoryDef(type, metadata);
Object.defineProperty(type, NG_COMP_DEF, {
get: () => {
if (ngComponentDef === null) {
const compiler = getCompilerFacade({
usage: 0,
kind: "component",
type
});
if (componentNeedsResolution(metadata)) {
const error = [`Component '${type.name}' is not resolved:`];
if (metadata.templateUrl) {
error.push(` - templateUrl: ${metadata.templateUrl}`);
}
if (metadata.styleUrls && metadata.styleUrls.length) {
error.push(` - styleUrls: ${JSON.stringify(metadata.styleUrls)}`);
}
if (metadata.styleUrl) {
error.push(` - styleUrl: ${metadata.styleUrl}`);
}
error.push(`Did you run and wait for 'resolveComponentResources()'?`);
throw new Error(error.join("\n"));
}
const options = getJitOptions();
let preserveWhitespaces = metadata.preserveWhitespaces;
if (preserveWhitespaces === void 0) {
if (options !== null && options.preserveWhitespaces !== void 0) {
preserveWhitespaces = options.preserveWhitespaces;
} else {
preserveWhitespaces = false;
}
}
let encapsulation = metadata.encapsulation;
if (encapsulation === void 0) {
if (options !== null && options.defaultEncapsulation !== void 0) {
encapsulation = options.defaultEncapsulation;
} else {
encapsulation = ViewEncapsulation.Emulated;
}
}
const templateUrl = metadata.templateUrl || `ng:///${type.name}/template.html`;
const baseMeta = directiveMetadata(type, metadata);
const meta = __spreadProps(__spreadValues({}, baseMeta), {
typeSourceSpan: compiler.createParseSourceSpan("Component", type.name, templateUrl),
template: metadata.template || "",
preserveWhitespaces,
styles: typeof metadata.styles === "string" ? [metadata.styles] : metadata.styles || EMPTY_ARRAY,
animations: metadata.animations,
// JIT components are always compiled against an empty set of `declarations`. Instead, the
// `directiveDefs` and `pipeDefs` are updated at a later point:
// * for NgModule-based components, they're set when the NgModule which declares the
// component resolves in the module scoping queue
// * for standalone components, they're set just below, after `compileComponent`.
declarations: [],
changeDetection: metadata.changeDetection,
encapsulation,
interpolation: metadata.interpolation,
viewProviders: metadata.viewProviders || null,
// We can't inspect whether any of the dependencies are actually directives, because they
// get patched on after compilation. That's why in JIT mode we consider that any
// dependency might be a directive dependency.
hasDirectiveDependencies: !baseMeta.isStandalone || metadata.imports != null && metadata.imports.length > 0
});
compilationDepth++;
try {
if (meta.usesInheritance) {
addDirectiveDefToUndecoratedParents(type);
}
ngComponentDef = compiler.compileComponent(angularCoreEnv, templateUrl, meta);
if (meta.isStandalone) {
const imports = flatten(metadata.imports || EMPTY_ARRAY);
const { directiveDefs, pipeDefs } = getStandaloneDefFunctions(type, imports);
ngComponentDef.directiveDefs = directiveDefs;
ngComponentDef.pipeDefs = pipeDefs;
ngComponentDef.dependencies = () => imports.map(resolveForwardRef);
}
} finally {
compilationDepth--;
}
if (compilationDepth === 0) {
flushModuleScopingQueueAsMuchAsPossible();
}
if (hasSelectorScope(type)) {
const scopes = transitiveScopesFor(type.ngSelectorScope);
patchComponentDefWithScope(ngComponentDef, scopes);
}
if (metadata.schemas) {
if (meta.isStandalone) {
ngComponentDef.schemas = metadata.schemas;
} else {
throw new Error(`The 'schemas' was specified for the ${stringifyForError(type)} but is only valid on a component that is standalone.`);
}
} else if (meta.isStandalone) {
ngComponentDef.schemas = [];
}
}
return ngComponentDef;
},
set: (def) => {
ngComponentDef = def;
},
// Make the property configurable in dev mode to allow overriding in tests
configurable: !!ngDevMode
});
}
function getStandaloneDefFunctions(type, imports) {
const directiveDefs = () => {
if (ngDevMode) {
for (const rawDep of imports) {
verifyStandaloneImport(rawDep, type);
}
}
if (!isComponent(type)) {
return [];
}
const scope = depsTracker.getStandaloneComponentScope(type, imports);
return [...scope.compilation.directives].map((p) => getComponentDef(p) || getDirectiveDef(p)).filter((d) => d !== null);
};
const pipeDefs = () => {
if (ngDevMode) {
for (const rawDep of imports) {
verifyStandaloneImport(rawDep, type);
}
}
if (!isComponent(type)) {
return [];
}
const scope = depsTracker.getStandaloneComponentScope(type, imports);
return [...scope.compilation.pipes].map((p) => getPipeDef(p)).filter((d) => d !== null);
};
return {
directiveDefs,
pipeDefs
};
}
function hasSelectorScope(component) {
return component.ngSelectorScope !== void 0;
}
function compileDirective(type, directive) {
let ngDirectiveDef = null;
addDirectiveFactoryDef(type, directive || {});
Object.defineProperty(type, NG_DIR_DEF, {
get: () => {
if (ngDirectiveDef === null) {
const meta = getDirectiveMetadata(type, directive || {});
const compiler = getCompilerFacade({
usage: 0,
kind: "directive",
type
});
ngDirectiveDef = compiler.compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata);
}
return ngDirectiveDef;
},
// Make the property configurable in dev mode to allow overriding in tests
configurable: !!ngDevMode
});
}
function getDirectiveMetadata(type, metadata) {
const name = type && type.name;
const sourceMapUrl = `ng:///${name}/\u0275dir.js`;
const compiler = getCompilerFacade({ usage: 0, kind: "directive", type });
const facade = directiveMetadata(type, metadata);
facade.typeSourceSpan = compiler.createParseSourceSpan("Directive", name, sourceMapUrl);
if (facade.usesInheritance) {
addDirectiveDefToUndecoratedParents(type);
}
return { metadata: facade, sourceMapUrl };
}
function addDirectiveFactoryDef(type, metadata) {
let ngFactoryDef = null;
Object.defineProperty(type, NG_FACTORY_DEF, {
get: () => {
if (ngFactoryDef === null) {
const meta = getDirectiveMetadata(type, metadata);
const compiler = getCompilerFacade({
usage: 0,
kind: "directive",
type
});
ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${type.name}/\u0275fac.js`, {
name: meta.metadata.name,
type: meta.metadata.type,
typeArgumentCount: 0,
deps: reflectDependencies(type),
target: compiler.FactoryTarget.Directive
});
}
return ngFactoryDef;
},
// Make the property configurable in dev mode to allow overriding in tests
configurable: !!ngDevMode
});
}
function extendsDirectlyFromObject(type) {
return Object.getPrototypeOf(type.prototype) === Object.prototype;
}
function directiveMetadata(type, metadata) {
const reflect = getReflect();
const propMetadata = reflect.ownPropMetadata(type);
return {
name: type.name,
type,
selector: metadata.selector !== void 0 ? metadata.selector : null,
host: metadata.host || EMPTY_OBJ,
propMetadata,
inputs: metadata.inputs || EMPTY_ARRAY,
outputs: metadata.outputs || EMPTY_ARRAY,
queries: extractQueriesMetadata(type, propMetadata, isContentQuery),
lifecycle: { usesOnChanges: reflect.hasLifecycleHook(type, "ngOnChanges") },
typeSourceSpan: null,
usesInheritance: !extendsDirectlyFromObject(type),
exportAs: extractExportAs(metadata.exportAs),
providers: metadata.providers || null,
viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery),
isStandalone: metadata.standalone === void 0 ? true : !!metadata.standalone,
isSignal: !!metadata.signals,
hostDirectives: metadata.hostDirectives?.map((directive) => typeof directive === "function" ? { directive } : directive) || null
};
}
function addDirectiveDefToUndecoratedParents(type) {
const objPrototype = Object.prototype;
let parent = Object.getPrototypeOf(type.prototype).constructor;
while (parent && parent !== objPrototype) {
if (!getDirectiveDef(parent) && !getComponentDef(parent) && shouldAddAbstractDirective(parent)) {
compileDirective(parent, null);
}
parent = Object.getPrototypeOf(parent);
}
}
function convertToR3QueryPredicate(selector) {
return typeof selector === "string" ? splitByComma(selector) : resolveForwardRef(selector);
}
function convertToR3QueryMetadata(propertyName, ann) {
return {
propertyName,
predicate: convertToR3QueryPredicate(ann.selector),
descendants: ann.descendants,
first: ann.first,
read: ann.read ? ann.read : null,
static: !!ann.static,
emitDistinctChangesOnly: !!ann.emitDistinctChangesOnly,
isSignal: !!ann.isSignal
};
}
function extractQueriesMetadata(type, propMetadata, isQueryAnn) {
const queriesMeta = [];
for (const field in propMetadata) {
if (propMetadata.hasOwnProperty(field)) {
const annotations = propMetadata[field];
annotations.forEach((ann) => {
if (isQueryAnn(ann)) {
if (!ann.selector) {
throw new Error(`Can't construct a query for the property "${field}" of "${stringifyForError(type)}" since the query selector wasn't defined.`);
}
if (annotations.some(isInputAnnotation)) {
throw new Error(`Cannot combine @Input decorators with query decorators`);
}
queriesMeta.push(convertToR3QueryMetadata(field, ann));
}
});
}
}
return queriesMeta;
}
function extractExportAs(exportAs) {
return exportAs === void 0 ? null : splitByComma(exportAs);
}
function isContentQuery(value) {
const name = value.ngMetadataName;
return name === "ContentChild" || name === "ContentChildren";
}
function isViewQuery(value) {
const name = value.ngMetadataName;
return name === "ViewChild" || name === "ViewChildren";
}
function isInputAnnotation(value) {
return value.ngMetadataName === "Input";
}
function splitByComma(value) {
return value.split(",").map((piece) => piece.trim());
}
var LIFECYCLE_HOOKS = [
"ngOnChanges",
"ngOnInit",
"ngOnDestroy",
"ngDoCheck",
"ngAfterViewInit",
"ngAfterViewChecked",
"ngAfterContentInit",
"ngAfterContentChecked"
];
function shouldAddAbstractDirective(type) {
const reflect = getReflect();
if (LIFECYCLE_HOOKS.some((hookName) => reflect.hasLifecycleHook(type, hookName))) {
return true;
}
const propMetadata = reflect.propMetadata(type);
for (const field in propMetadata) {
const annotations = propMetadata[field];
for (let i = 0; i < annotations.length; i++) {
const current = annotations[i];
const metadataName = current.ngMetadataName;
if (isInputAnnotation(current) || isContentQuery(current) || isViewQuery(current) || metadataName === "Output" || metadataName === "HostBinding" || metadataName === "HostListener") {
return true;
}
}
}
return false;
}
function compilePipe(type, meta) {
let ngPipeDef = null;
let ngFactoryDef = null;
Object.defineProperty(type, NG_FACTORY_DEF, {
get: () => {
if (ngFactoryDef === null) {
const metadata = getPipeMetadata(type, meta);
const compiler = getCompilerFacade({
usage: 0,
kind: "pipe",
type: metadata.type
});
ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${metadata.name}/\u0275fac.js`, {
name: metadata.name,
type: metadata.type,
typeArgumentCount: 0,
deps: reflectDependencies(type),
target: compiler.FactoryTarget.Pipe
});
}
return ngFactoryDef;
},
// Make the property configurable in dev mode to allow overriding in tests
configurable: !!ngDevMode
});
Object.defineProperty(type, NG_PIPE_DEF, {
get: () => {
if (ngPipeDef === null) {
const metadata = getPipeMetadata(type, meta);
const compiler = getCompilerFacade({
usage: 0,
kind: "pipe",
type: metadata.type
});
ngPipeDef = compiler.compilePipe(angularCoreEnv, `ng:///${metadata.name}/\u0275pipe.js`, metadata);
}
return ngPipeDef;
},
// Make the property configurable in dev mode to allow overriding in tests
configurable: !!ngDevMode
});
}
function getPipeMetadata(type, meta) {
return {
type,
name: type.name,
pipeName: meta.name,
pure: meta.pure !== void 0 ? meta.pure : true,
isStandalone: meta.standalone === void 0 ? true : !!meta.standalone
};
}
var Directive = makeDecorator("Directive", (dir = {}) => dir, void 0, void 0, (type, meta) => compileDirective(type, meta));
var Component = makeDecorator("Component", (c = {}) => __spreadValues({ changeDetection: ChangeDetectionStrategy.Default }, c), Directive, void 0, (type, meta) => compileComponent(type, meta));
var Pipe = makeDecorator("Pipe", (p) => __spreadValues({ pure: true }, p), void 0, void 0, (type, meta) => compilePipe(type, meta));
var Input = makePropDecorator("Input", (arg) => {
if (!arg) {
return {};
}
return typeof arg === "string" ? { alias: arg } : arg;
});
var Output = makePropDecorator("Output", (alias) => ({ alias }));
var HostBinding = makePropDecorator("HostBinding", (hostPropertyName) => ({ hostPropertyName }));
var HostListener = makePropDecorator("HostListener", (eventName, args) => ({ eventName, args }));
var NgModule = makeDecorator(
"NgModule",
(ngModule) => ngModule,
void 0,
void 0,
/**
* Decorator that marks the following class as an NgModule, and supplies
* configuration metadata for it.
*
* * The `declarations` option configures the compiler
* with information about what belongs to the NgModule.
* * The `providers` options configures the NgModule's injector to provide
* dependencies the NgModule members.
* * The `imports` and `exports` options bring in members from other modules, and make
* this module's members available to others.
*/
(type, meta) => compileNgModule(type, meta)
);
var ModuleWithComponentFactories = class {
ngModuleFactory;
componentFactories;
constructor(ngModuleFactory, componentFactories) {
this.ngModuleFactory = ngModuleFactory;
this.componentFactories = componentFactories;
}
};
var Compiler = class _Compiler {
/**
* Compiles the given NgModule and all of its components. All templates of the components
* have to be inlined.
*/
compileModuleSync(moduleType) {
return new NgModuleFactory2(moduleType);
}
/**
* Compiles the given NgModule and all of its components
*/
compileModuleAsync(moduleType) {
return Promise.resolve(this.compileModuleSync(moduleType));
}
/**
* Same as {@link Compiler#compileModuleSync compileModuleSync} but also creates ComponentFactories for all components.
*/
compileModuleAndAllComponentsSync(moduleType) {
const ngModuleFactory = this.compileModuleSync(moduleType);
const moduleDef = getNgModuleDef(moduleType);
const componentFactories = maybeUnwrapFn(moduleDef.declarations).reduce((factories, declaration) => {
const componentDef = getComponentDef(declaration);
componentDef && factories.push(new ComponentFactory2(componentDef));
return factories;
}, []);
return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);
}
/**
* Same as {@link Compiler#compileModuleAsync compileModuleAsync} but also creates ComponentFactories for all components.
*/
compileModuleAndAllComponentsAsync(moduleType) {
return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));
}
/**
* Clears all caches.
*/
clearCache() {
}
/**
* Clears the cache for the given component/ngModule.
*/
clearCacheFor(type) {
}
/**
* Returns the id for a given NgModule, if one is defined and known to the compiler.
*/
getModuleId(moduleType) {
return void 0;
}
static \u0275fac = function Compiler_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _Compiler)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _Compiler, factory: _Compiler.\u0275fac, providedIn: "root" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Compiler, [{
type: Injectable,
args: [{ providedIn: "root" }]
}], null, null);
})();
var COMPILER_OPTIONS = new InjectionToken(ngDevMode ? "compilerOptions" : "");
var NgZoneChangeDetectionScheduler = class _NgZoneChangeDetectionScheduler {
zone = inject2(NgZone);
changeDetectionScheduler = inject2(ChangeDetectionScheduler);
applicationRef = inject2(ApplicationRef);
applicationErrorHandler = inject2(INTERNAL_APPLICATION_ERROR_HANDLER);
_onMicrotaskEmptySubscription;
initialize() {
if (this._onMicrotaskEmptySubscription) {
return;
}
this._onMicrotaskEmptySubscription = this.zone.onMicrotaskEmpty.subscribe({
next: () => {
if (this.changeDetectionScheduler.runningTick) {
return;
}
this.zone.run(() => {
try {
this.applicationRef.dirtyFlags |= 1;
this.applicationRef._tick();
} catch (e) {
this.applicationErrorHandler(e);
}
});
}
});
}
ngOnDestroy() {
this._onMicrotaskEmptySubscription?.unsubscribe();
}
static \u0275fac = function NgZoneChangeDetectionScheduler_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgZoneChangeDetectionScheduler)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _NgZoneChangeDetectionScheduler, factory: _NgZoneChangeDetectionScheduler.\u0275fac, providedIn: "root" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgZoneChangeDetectionScheduler, [{
type: Injectable,
args: [{ providedIn: "root" }]
}], null, null);
})();
var PROVIDED_NG_ZONE = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "provideZoneChangeDetection token" : "", { factory: () => false });
function internalProvideZoneChangeDetection({ ngZoneFactory, ignoreChangesOutsideZone, scheduleInRootZone }) {
ngZoneFactory ??= () => new NgZone(__spreadProps(__spreadValues({}, getNgZoneOptions()), { scheduleInRootZone }));
return [
{ provide: NgZone, useFactory: ngZoneFactory },
{
provide: ENVIRONMENT_INITIALIZER,
multi: true,
useFactory: () => {
const ngZoneChangeDetectionScheduler = inject2(NgZoneChangeDetectionScheduler, {
optional: true
});
if ((typeof ngDevMode === "undefined" || ngDevMode) && ngZoneChangeDetectionScheduler === null) {
throw new RuntimeError(402, `A required Injectable was not found in the dependency injection tree. If you are bootstrapping an NgModule, make sure that the \`BrowserModule\` is imported.`);
}
return () => ngZoneChangeDetectionScheduler.initialize();
}
},
{
provide: ENVIRONMENT_INITIALIZER,
multi: true,
useFactory: () => {
const service = inject2(ZoneStablePendingTask);
return () => {
service.initialize();
};
}
},
// Always disable scheduler whenever explicitly disabled, even if another place called
// `provideZoneChangeDetection` without the 'ignore' option.
ignoreChangesOutsideZone === true ? { provide: ZONELESS_SCHEDULER_DISABLED, useValue: true } : [],
{
provide: SCHEDULE_IN_ROOT_ZONE,
useValue: scheduleInRootZone ?? SCHEDULE_IN_ROOT_ZONE_DEFAULT
},
{
provide: INTERNAL_APPLICATION_ERROR_HANDLER,
useFactory: () => {
const zone = inject2(NgZone);
const injector = inject2(EnvironmentInjector);
let userErrorHandler;
return (e) => {
zone.runOutsideAngular(() => {
if (injector.destroyed && !userErrorHandler) {
setTimeout(() => {
throw e;
});
} else {
userErrorHandler ??= injector.get(ErrorHandler);
userErrorHandler.handleError(e);
}
});
};
}
}
];
}
function getNgZoneOptions(options) {
return {
enableLongStackTrace: typeof ngDevMode === "undefined" ? false : !!ngDevMode,
shouldCoalesceEventChangeDetection: options?.eventCoalescing ?? false,
shouldCoalesceRunChangeDetection: options?.runCoalescing ?? false
};
}
var ZoneStablePendingTask = class _ZoneStablePendingTask {
subscription = new Subscription();
initialized = false;
zone = inject2(NgZone);
pendingTasks = inject2(PendingTasksInternal);
initialize() {
if (this.initialized) {
return;
}
this.initialized = true;
let task = null;
if (!this.zone.isStable && !this.zone.hasPendingMacrotasks && !this.zone.hasPendingMicrotasks) {
task = this.pendingTasks.add();
}
this.zone.runOutsideAngular(() => {
this.subscription.add(this.zone.onStable.subscribe(() => {
NgZone.assertNotInAngularZone();
queueMicrotask(() => {
if (task !== null && !this.zone.hasPendingMacrotasks && !this.zone.hasPendingMicrotasks) {
this.pendingTasks.remove(task);
task = null;
}
});
}));
});
this.subscription.add(this.zone.onUnstable.subscribe(() => {
NgZone.assertInAngularZone();
task ??= this.pendingTasks.add();
}));
}
ngOnDestroy() {
this.subscription.unsubscribe();
}
static \u0275fac = function ZoneStablePendingTask_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ZoneStablePendingTask)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _ZoneStablePendingTask, factory: _ZoneStablePendingTask.\u0275fac, providedIn: "root" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ZoneStablePendingTask, [{
type: Injectable,
args: [{ providedIn: "root" }]
}], null, null);
})();
var CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT = 100;
var consecutiveMicrotaskNotifications = 0;
var stackFromLastFewNotifications = [];
function trackMicrotaskNotificationForDebugging() {
consecutiveMicrotaskNotifications++;
if (CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT - consecutiveMicrotaskNotifications < 5) {
const stack = new Error().stack;
if (stack) {
stackFromLastFewNotifications.push(stack);
}
}
if (consecutiveMicrotaskNotifications === CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT) {
throw new RuntimeError(103, "Angular could not stabilize because there were endless change notifications within the browser event loop. The stack from the last several notifications: \n" + stackFromLastFewNotifications.join("\n"));
}
}
var ChangeDetectionSchedulerImpl = class _ChangeDetectionSchedulerImpl {
applicationErrorHandler = inject2(INTERNAL_APPLICATION_ERROR_HANDLER);
appRef = inject2(ApplicationRef);
taskService = inject2(PendingTasksInternal);
ngZone = inject2(NgZone);
zonelessEnabled = inject2(ZONELESS_ENABLED);
tracing = inject2(TracingService, { optional: true });
disableScheduling = inject2(ZONELESS_SCHEDULER_DISABLED, { optional: true }) ?? false;
zoneIsDefined = typeof Zone !== "undefined" && !!Zone.root.run;
schedulerTickApplyArgs = [{ data: { "__scheduler_tick__": true } }];
subscriptions = new Subscription();
angularZoneId = this.zoneIsDefined ? this.ngZone._inner?.get(angularZoneInstanceIdProperty) : null;
scheduleInRootZone = !this.zonelessEnabled && this.zoneIsDefined && (inject2(SCHEDULE_IN_ROOT_ZONE, { optional: true }) ?? false);
cancelScheduledCallback = null;
useMicrotaskScheduler = false;
runningTick = false;
pendingRenderTaskId = null;
constructor() {
this.subscriptions.add(this.appRef.afterTick.subscribe(() => {
if (!this.runningTick) {
this.cleanup();
}
}));
this.subscriptions.add(this.ngZone.onUnstable.subscribe(() => {
if (!this.runningTick) {
this.cleanup();
}
}));
this.disableScheduling ||= !this.zonelessEnabled && // NoopNgZone without enabling zoneless means no scheduling whatsoever
(this.ngZone instanceof NoopNgZone || // The same goes for the lack of Zone without enabling zoneless scheduling
!this.zoneIsDefined);
}
notify(source) {
if (!this.zonelessEnabled && source === 5) {
return;
}
let force = false;
switch (source) {
case 0: {
this.appRef.dirtyFlags |= 2;
break;
}
case 3:
case 2:
case 4:
case 5:
case 1: {
this.appRef.dirtyFlags |= 4;
break;
}
case 6: {
this.appRef.dirtyFlags |= 2;
force = true;
break;
}
case 12: {
this.appRef.dirtyFlags |= 16;
force = true;
break;
}
case 13: {
this.appRef.dirtyFlags |= 2;
force = true;
break;
}
case 11: {
force = true;
break;
}
case 9:
case 8:
case 7:
case 10:
default: {
this.appRef.dirtyFlags |= 8;
}
}
this.appRef.tracingSnapshot = this.tracing?.snapshot(this.appRef.tracingSnapshot) ?? null;
if (!this.shouldScheduleTick(force)) {
return;
}
if (typeof ngDevMode === "undefined" || ngDevMode) {
if (this.useMicrotaskScheduler) {
trackMicrotaskNotificationForDebugging();
} else {
consecutiveMicrotaskNotifications = 0;
stackFromLastFewNotifications.length = 0;
}
}
const scheduleCallback = this.useMicrotaskScheduler ? scheduleCallbackWithMicrotask : scheduleCallbackWithRafRace;
this.pendingRenderTaskId = this.taskService.add();
if (this.scheduleInRootZone) {
this.cancelScheduledCallback = Zone.root.run(() => scheduleCallback(() => this.tick()));
} else {
this.cancelScheduledCallback = this.ngZone.runOutsideAngular(() => scheduleCallback(() => this.tick()));
}
}
shouldScheduleTick(force) {
if (this.disableScheduling && !force || this.appRef.destroyed) {
return false;
}
if (this.pendingRenderTaskId !== null || this.runningTick || this.appRef._runningTick) {
return false;
}
if (!this.zonelessEnabled && this.zoneIsDefined && Zone.current.get(angularZoneInstanceIdProperty + this.angularZoneId)) {
return false;
}
return true;
}
/**
* Calls ApplicationRef._tick inside the `NgZone`.
*
* Calling `tick` directly runs change detection and cancels any change detection that had been
* scheduled previously.
*
* @param shouldRefreshViews Passed directly to `ApplicationRef._tick` and skips straight to
* render hooks when `false`.
*/
tick() {
if (this.runningTick || this.appRef.destroyed) {
return;
}
if (this.appRef.dirtyFlags === 0) {
this.cleanup();
return;
}
if (!this.zonelessEnabled && this.appRef.dirtyFlags & 7) {
this.appRef.dirtyFlags |= 1;
}
const task = this.taskService.add();
try {
this.ngZone.run(() => {
this.runningTick = true;
this.appRef._tick();
}, void 0, this.schedulerTickApplyArgs);
} catch (e) {
this.taskService.remove(task);
this.applicationErrorHandler(e);
} finally {
this.cleanup();
}
this.useMicrotaskScheduler = true;
scheduleCallbackWithMicrotask(() => {
this.useMicrotaskScheduler = false;
this.taskService.remove(task);
});
}
ngOnDestroy() {
this.subscriptions.unsubscribe();
this.cleanup();
}
cleanup() {
this.runningTick = false;
this.cancelScheduledCallback?.();
this.cancelScheduledCallback = null;
if (this.pendingRenderTaskId !== null) {
const taskId = this.pendingRenderTaskId;
this.pendingRenderTaskId = null;
this.taskService.remove(taskId);
}
}
static \u0275fac = function ChangeDetectionSchedulerImpl_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ChangeDetectionSchedulerImpl)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _ChangeDetectionSchedulerImpl, factory: _ChangeDetectionSchedulerImpl.\u0275fac, providedIn: "root" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ChangeDetectionSchedulerImpl, [{
type: Injectable,
args: [{ providedIn: "root" }]
}], () => [], null);
})();
function provideZonelessChangeDetection() {
performanceMarkFeature("NgZoneless");
if ((typeof ngDevMode === "undefined" || ngDevMode) && typeof Zone !== "undefined" && Zone) {
const message = formatRuntimeError(914, `The application is using zoneless change detection, but is still loading Zone.js. Consider removing Zone.js to get the full benefits of zoneless. In applications using the Angular CLI, Zone.js is typically included in the "polyfills" section of the angular.json file.`);
console.warn(message);
}
return makeEnvironmentProviders([
{ provide: ChangeDetectionScheduler, useExisting: ChangeDetectionSchedulerImpl },
{ provide: NgZone, useClass: NoopNgZone },
{ provide: ZONELESS_ENABLED, useValue: true },
{ provide: SCHEDULE_IN_ROOT_ZONE, useValue: false },
typeof ngDevMode === "undefined" || ngDevMode ? [{ provide: PROVIDED_ZONELESS, useValue: true }] : []
]);
}
function getGlobalLocale() {
if (false) {
return goog.LOCALE;
} else {
return typeof $localize !== "undefined" && $localize.locale || DEFAULT_LOCALE_ID;
}
}
var LOCALE_ID = new InjectionToken(ngDevMode ? "LocaleId" : "", {
providedIn: "root",
factory: () => inject2(LOCALE_ID, { optional: true, skipSelf: true }) || getGlobalLocale()
});
var DEFAULT_CURRENCY_CODE = new InjectionToken(ngDevMode ? "DefaultCurrencyCode" : "", {
providedIn: "root",
factory: () => USD_CURRENCY_CODE
});
var TRANSLATIONS = new InjectionToken(ngDevMode ? "Translations" : "");
var TRANSLATIONS_FORMAT = new InjectionToken(ngDevMode ? "TranslationsFormat" : "");
var MissingTranslationStrategy;
(function(MissingTranslationStrategy2) {
MissingTranslationStrategy2[MissingTranslationStrategy2["Error"] = 0] = "Error";
MissingTranslationStrategy2[MissingTranslationStrategy2["Warning"] = 1] = "Warning";
MissingTranslationStrategy2[MissingTranslationStrategy2["Ignore"] = 2] = "Ignore";
})(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
// node_modules/.pnpm/@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs@7.8.2/node_modules/@angular/core/fesm2022/resource.mjs
var OutputEmitterRef = class {
destroyed = false;
listeners = null;
errorHandler = inject2(ErrorHandler, { optional: true });
/** @internal */
destroyRef = inject2(DestroyRef);
constructor() {
this.destroyRef.onDestroy(() => {
this.destroyed = true;
this.listeners = null;
});
}
subscribe(callback) {
if (this.destroyed) {
throw new RuntimeError(953, ngDevMode && "Unexpected subscription to destroyed `OutputRef`. The owning directive/component is destroyed.");
}
(this.listeners ??= []).push(callback);
return {
unsubscribe: () => {
const idx = this.listeners?.indexOf(callback);
if (idx !== void 0 && idx !== -1) {
this.listeners?.splice(idx, 1);
}
}
};
}
/** Emits a new value to the output. */
emit(value) {
if (this.destroyed) {
console.warn(formatRuntimeError(953, ngDevMode && "Unexpected emit for destroyed `OutputRef`. The owning directive/component is destroyed."));
return;
}
if (this.listeners === null) {
return;
}
const previousConsumer = setActiveConsumer(null);
try {
for (const listenerFn of this.listeners) {
try {
listenerFn(value);
} catch (err) {
this.errorHandler?.handleError(err);
}
}
} finally {
setActiveConsumer(previousConsumer);
}
}
};
function untracked2(nonReactiveReadsFn) {
return untracked(nonReactiveReadsFn);
}
function computed(computation, options) {
const getter = createComputed(computation, options?.equal);
if (ngDevMode) {
getter.toString = () => `[Computed: ${getter()}]`;
getter[SIGNAL].debugName = options?.debugName;
}
return getter;
}
var EffectRefImpl = class {
[SIGNAL];
constructor(node) {
this[SIGNAL] = node;
}
destroy() {
this[SIGNAL].destroy();
}
};
function effect(effectFn, options) {
ngDevMode && assertNotInReactiveContext(effect, "Call `effect` outside of a reactive context. For example, schedule the effect inside the component constructor.");
if (ngDevMode && !options?.injector) {
assertInInjectionContext(effect);
}
if (ngDevMode && options?.allowSignalWrites !== void 0) {
console.warn(`The 'allowSignalWrites' flag is deprecated and no longer impacts effect() (writes are always allowed)`);
}
const injector = options?.injector ?? inject2(Injector);
let destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;
let node;
const viewContext = injector.get(ViewContext, null, { optional: true });
const notifier = injector.get(ChangeDetectionScheduler);
if (viewContext !== null) {
node = createViewEffect(viewContext.view, notifier, effectFn);
if (destroyRef instanceof NodeInjectorDestroyRef && destroyRef._lView === viewContext.view) {
destroyRef = null;
}
} else {
node = createRootEffect(effectFn, injector.get(EffectScheduler), notifier);
}
node.injector = injector;
if (destroyRef !== null) {
node.onDestroyFn = destroyRef.onDestroy(() => node.destroy());
}
const effectRef = new EffectRefImpl(node);
if (ngDevMode) {
node.debugName = options?.debugName ?? "";
const prevInjectorProfilerContext = setInjectorProfilerContext({ injector, token: null });
try {
emitEffectCreatedEvent(effectRef);
} finally {
setInjectorProfilerContext(prevInjectorProfilerContext);
}
}
return effectRef;
}
var BASE_EFFECT_NODE = /* @__PURE__ */ (() => __spreadProps(__spreadValues({}, REACTIVE_NODE), {
consumerIsAlwaysLive: true,
consumerAllowSignalWrites: true,
dirty: true,
hasRun: false,
cleanupFns: void 0,
zone: null,
kind: "effect",
onDestroyFn: noop2,
run() {
this.dirty = false;
if (ngDevMode && isInNotificationPhase()) {
throw new Error(`Schedulers cannot synchronously execute watches while scheduling.`);
}
if (this.hasRun && !consumerPollProducersForChange(this)) {
return;
}
this.hasRun = true;
const registerCleanupFn = (cleanupFn) => (this.cleanupFns ??= []).push(cleanupFn);
const prevNode = consumerBeforeComputation(this);
const prevRefreshingViews = setIsRefreshingViews(false);
try {
this.maybeCleanup();
this.fn(registerCleanupFn);
} finally {
setIsRefreshingViews(prevRefreshingViews);
consumerAfterComputation(this, prevNode);
}
},
maybeCleanup() {
if (!this.cleanupFns?.length) {
return;
}
const prevConsumer = setActiveConsumer(null);
try {
while (this.cleanupFns.length) {
this.cleanupFns.pop()();
}
} finally {
this.cleanupFns = [];
setActiveConsumer(prevConsumer);
}
}
}))();
var ROOT_EFFECT_NODE = /* @__PURE__ */ (() => __spreadProps(__spreadValues({}, BASE_EFFECT_NODE), {
consumerMarkedDirty() {
this.scheduler.schedule(this);
this.notifier.notify(
12
/* NotificationSource.RootEffect */
);
},
destroy() {
consumerDestroy(this);
this.onDestroyFn();
this.maybeCleanup();
this.scheduler.remove(this);
}
}))();
var VIEW_EFFECT_NODE = /* @__PURE__ */ (() => __spreadProps(__spreadValues({}, BASE_EFFECT_NODE), {
consumerMarkedDirty() {
this.view[FLAGS] |= 8192;
markAncestorsForTraversal(this.view);
this.notifier.notify(
13
/* NotificationSource.ViewEffect */
);
},
destroy() {
consumerDestroy(this);
this.onDestroyFn();
this.maybeCleanup();
this.view[EFFECTS]?.delete(this);
}
}))();
function createViewEffect(view, notifier, fn) {
const node = Object.create(VIEW_EFFECT_NODE);
node.view = view;
node.zone = typeof Zone !== "undefined" ? Zone.current : null;
node.notifier = notifier;
node.fn = fn;
view[EFFECTS] ??= /* @__PURE__ */ new Set();
view[EFFECTS].add(node);
node.consumerMarkedDirty(node);
return node;
}
function createRootEffect(fn, scheduler, notifier) {
const node = Object.create(ROOT_EFFECT_NODE);
node.fn = fn;
node.scheduler = scheduler;
node.notifier = notifier;
node.zone = typeof Zone !== "undefined" ? Zone.current : null;
node.scheduler.add(node);
node.notifier.notify(
12
/* NotificationSource.RootEffect */
);
return node;
}
var identityFn = (v) => v;
function linkedSignal(optionsOrComputation, options) {
if (typeof optionsOrComputation === "function") {
const getter = createLinkedSignal(optionsOrComputation, identityFn, options?.equal);
return upgradeLinkedSignalGetter(getter);
} else {
const getter = createLinkedSignal(optionsOrComputation.source, optionsOrComputation.computation, optionsOrComputation.equal);
return upgradeLinkedSignalGetter(getter);
}
}
function upgradeLinkedSignalGetter(getter) {
if (ngDevMode) {
getter.toString = () => `[LinkedSignal: ${getter()}]`;
}
const node = getter[SIGNAL];
const upgradedGetter = getter;
upgradedGetter.set = (newValue) => linkedSignalSetFn(node, newValue);
upgradedGetter.update = (updateFn) => linkedSignalUpdateFn(node, updateFn);
upgradedGetter.asReadonly = signalAsReadonlyFn.bind(getter);
return upgradedGetter;
}
var RESOURCE_VALUE_THROWS_ERRORS_DEFAULT = true;
var BaseWritableResource = class {
value;
constructor(value) {
this.value = value;
this.value.set = this.set.bind(this);
this.value.update = this.update.bind(this);
this.value.asReadonly = signalAsReadonlyFn;
}
isError = computed(() => this.status() === "error");
update(updateFn) {
this.set(updateFn(untracked2(this.value)));
}
isLoading = computed(() => this.status() === "loading" || this.status() === "reloading");
// Use a computed here to avoid triggering reactive consumers if the value changes while staying
// either defined or undefined.
isValueDefined = computed(() => {
if (this.isError()) {
return false;
}
return this.value() !== void 0;
});
hasValue() {
return this.isValueDefined();
}
asReadonly() {
return this;
}
};
var ResourceImpl = class extends BaseWritableResource {
loaderFn;
equal;
pendingTasks;
/**
* The current state of the resource. Status, value, and error are derived from this.
*/
state;
/**
* Combines the current request with a reload counter which allows the resource to be reloaded on
* imperative command.
*/
extRequest;
effectRef;
pendingController;
resolvePendingTask = void 0;
destroyed = false;
unregisterOnDestroy;
constructor(request, loaderFn, defaultValue, equal, injector, throwErrorsFromValue = RESOURCE_VALUE_THROWS_ERRORS_DEFAULT) {
super(
// Feed a computed signal for the value to `BaseWritableResource`, which will upgrade it to a
// `WritableSignal` that delegates to `ResourceImpl.set`.
computed(() => {
const streamValue = this.state().stream?.();
if (!streamValue) {
return defaultValue;
}
if (this.state().status === "loading" && this.error()) {
return defaultValue;
}
if (!isResolved(streamValue)) {
if (throwErrorsFromValue) {
throw new ResourceValueError(this.error());
} else {
return defaultValue;
}
}
return streamValue.value;
}, { equal })
);
this.loaderFn = loaderFn;
this.equal = equal;
this.extRequest = linkedSignal({
source: request,
computation: (request2) => ({ request: request2, reload: 0 })
});
this.state = linkedSignal({
// Whenever the request changes,
source: this.extRequest,
// Compute the state of the resource given a change in status.
computation: (extRequest, previous) => {
const status = extRequest.request === void 0 ? "idle" : "loading";
if (!previous) {
return {
extRequest,
status,
previousStatus: "idle",
stream: void 0
};
} else {
return {
extRequest,
status,
previousStatus: projectStatusOfState(previous.value),
// If the request hasn't changed, keep the previous stream.
stream: previous.value.extRequest.request === extRequest.request ? previous.value.stream : void 0
};
}
}
});
this.effectRef = effect(this.loadEffect.bind(this), {
injector,
manualCleanup: true
});
this.pendingTasks = injector.get(PendingTasks);
this.unregisterOnDestroy = injector.get(DestroyRef).onDestroy(() => this.destroy());
}
status = computed(() => projectStatusOfState(this.state()));
error = computed(() => {
const stream = this.state().stream?.();
return stream && !isResolved(stream) ? stream.error : void 0;
});
/**
* Called either directly via `WritableResource.set` or via `.value.set()`.
*/
set(value) {
if (this.destroyed) {
return;
}
const error = untracked2(this.error);
const state = untracked2(this.state);
if (!error) {
const current = untracked2(this.value);
if (state.status === "local" && (this.equal ? this.equal(current, value) : current === value)) {
return;
}
}
this.state.set({
extRequest: state.extRequest,
status: "local",
previousStatus: "local",
stream: signal({ value })
});
this.abortInProgressLoad();
}
reload() {
const { status } = untracked2(this.state);
if (status === "idle" || status === "loading") {
return false;
}
this.extRequest.update(({ request, reload }) => ({ request, reload: reload + 1 }));
return true;
}
destroy() {
this.destroyed = true;
this.unregisterOnDestroy();
this.effectRef.destroy();
this.abortInProgressLoad();
this.state.set({
extRequest: { request: void 0, reload: 0 },
status: "idle",
previousStatus: "idle",
stream: void 0
});
}
async loadEffect() {
const extRequest = this.extRequest();
const { status: currentStatus, previousStatus } = untracked2(this.state);
if (extRequest.request === void 0) {
return;
} else if (currentStatus !== "loading") {
return;
}
this.abortInProgressLoad();
let resolvePendingTask = this.resolvePendingTask = this.pendingTasks.add();
const { signal: abortSignal } = this.pendingController = new AbortController();
try {
const stream = await untracked2(() => {
return this.loaderFn({
params: extRequest.request,
// TODO(alxhub): cleanup after g3 removal of `request` alias.
request: extRequest.request,
abortSignal,
previous: {
status: previousStatus
}
});
});
if (abortSignal.aborted || untracked2(this.extRequest) !== extRequest) {
return;
}
this.state.set({
extRequest,
status: "resolved",
previousStatus: "resolved",
stream
});
} catch (err) {
if (abortSignal.aborted || untracked2(this.extRequest) !== extRequest) {
return;
}
this.state.set({
extRequest,
status: "resolved",
previousStatus: "error",
stream: signal({ error: encapsulateResourceError(err) })
});
} finally {
resolvePendingTask?.();
resolvePendingTask = void 0;
}
}
abortInProgressLoad() {
untracked2(() => this.pendingController?.abort());
this.pendingController = void 0;
this.resolvePendingTask?.();
this.resolvePendingTask = void 0;
}
};
function projectStatusOfState(state) {
switch (state.status) {
case "loading":
return state.extRequest.reload === 0 ? "loading" : "reloading";
case "resolved":
return isResolved(state.stream()) ? "resolved" : "error";
default:
return state.status;
}
}
function isResolved(state) {
return state.error === void 0;
}
function encapsulateResourceError(error) {
if (error instanceof Error) {
return error;
}
return new ResourceWrappedError(error);
}
var ResourceValueError = class extends Error {
constructor(error) {
super(ngDevMode ? `Resource is currently in an error state (see Error.cause for details): ${error.message}` : error.message, { cause: error });
}
};
var ResourceWrappedError = class extends Error {
constructor(error) {
super(ngDevMode ? `Resource returned an error that's not an Error instance: ${String(error)}. Check this error's .cause for the actual error.` : String(error), { cause: error });
}
};
// node_modules/.pnpm/@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs@7.8.2/node_modules/@angular/core/fesm2022/core.mjs
var REQUIRED_UNSET_VALUE = /* @__PURE__ */ Symbol("InputSignalNode#UNSET");
var INPUT_SIGNAL_NODE = /* @__PURE__ */ (() => {
return __spreadProps(__spreadValues({}, SIGNAL_NODE), {
transformFn: void 0,
applyValueToInputSignal(node, value) {
signalSetFn(node, value);
}
});
})();
function createInputSignal(initialValue, options) {
const node = Object.create(INPUT_SIGNAL_NODE);
node.value = initialValue;
node.transformFn = options?.transform;
function inputValueFn() {
producerAccessed(node);
if (node.value === REQUIRED_UNSET_VALUE) {
let message = null;
if (ngDevMode) {
const name = options?.debugName ?? options?.alias;
message = `Input${name ? ` "${name}"` : ""} is required but no value is available yet.`;
}
throw new RuntimeError(-950, message);
}
return node.value;
}
inputValueFn[SIGNAL] = node;
if (ngDevMode) {
inputValueFn.toString = () => `[Input Signal: ${inputValueFn()}]`;
node.debugName = options?.debugName;
}
return inputValueFn;
}
var FactoryTarget;
(function(FactoryTarget2) {
FactoryTarget2[FactoryTarget2["Directive"] = 0] = "Directive";
FactoryTarget2[FactoryTarget2["Component"] = 1] = "Component";
FactoryTarget2[FactoryTarget2["Injectable"] = 2] = "Injectable";
FactoryTarget2[FactoryTarget2["Pipe"] = 3] = "Pipe";
FactoryTarget2[FactoryTarget2["NgModule"] = 4] = "NgModule";
})(FactoryTarget || (FactoryTarget = {}));
var R3TemplateDependencyKind;
(function(R3TemplateDependencyKind2) {
R3TemplateDependencyKind2[R3TemplateDependencyKind2["Directive"] = 0] = "Directive";
R3TemplateDependencyKind2[R3TemplateDependencyKind2["Pipe"] = 1] = "Pipe";
R3TemplateDependencyKind2[R3TemplateDependencyKind2["NgModule"] = 2] = "NgModule";
})(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
var ViewEncapsulation2;
(function(ViewEncapsulation3) {
ViewEncapsulation3[ViewEncapsulation3["Emulated"] = 0] = "Emulated";
ViewEncapsulation3[ViewEncapsulation3["None"] = 2] = "None";
ViewEncapsulation3[ViewEncapsulation3["ShadowDom"] = 3] = "ShadowDom";
})(ViewEncapsulation2 || (ViewEncapsulation2 = {}));
var HostAttributeToken = class {
attributeName;
constructor(attributeName) {
this.attributeName = attributeName;
}
/** @internal */
__NG_ELEMENT_ID__ = () => \u0275\u0275injectAttribute(this.attributeName);
toString() {
return `HostAttributeToken ${this.attributeName}`;
}
};
var HOST_TAG_NAME = new InjectionToken(ngDevMode ? "HOST_TAG_NAME" : "");
HOST_TAG_NAME.__NG_ELEMENT_ID__ = (flags) => {
const tNode = getCurrentTNode();
if (tNode === null) {
throw new RuntimeError(204, ngDevMode && "HOST_TAG_NAME can only be injected in directives and components during construction time (in a class constructor or as a class field initializer)");
}
if (tNode.type & 2) {
return tNode.value;
}
if (flags & 8) {
return null;
}
throw new RuntimeError(204, ngDevMode && `HOST_TAG_NAME was used on ${getDevModeNodeName(tNode)} which doesn't have an underlying element in the DOM. This is invalid, and so the dependency should be marked as optional.`);
};
function getDevModeNodeName(tNode) {
if (tNode.type & 8) {
return "an <ng-container>";
} else if (tNode.type & 4) {
return "an <ng-template>";
} else if (tNode.type & 128) {
return "an @let declaration";
} else {
return "a node";
}
}
function inputFunction(initialValue, opts) {
ngDevMode && assertInInjectionContext(input);
return createInputSignal(initialValue, opts);
}
function inputRequiredFunction(opts) {
ngDevMode && assertInInjectionContext(input);
return createInputSignal(REQUIRED_UNSET_VALUE, opts);
}
var input = (() => {
inputFunction.required = inputRequiredFunction;
return inputFunction;
})();
function viewChildFn(locator, opts) {
ngDevMode && assertInInjectionContext(viewChild);
return createSingleResultOptionalQuerySignalFn(opts);
}
function viewChildRequiredFn(locator, opts) {
ngDevMode && assertInInjectionContext(viewChild);
return createSingleResultRequiredQuerySignalFn(opts);
}
var viewChild = (() => {
viewChildFn.required = viewChildRequiredFn;
return viewChildFn;
})();
function contentChildFn(locator, opts) {
ngDevMode && assertInInjectionContext(contentChild);
return createSingleResultOptionalQuerySignalFn(opts);
}
function contentChildRequiredFn(locator, opts) {
ngDevMode && assertInInjectionContext(contentChildren);
return createSingleResultRequiredQuerySignalFn(opts);
}
var contentChild = (() => {
contentChildFn.required = contentChildRequiredFn;
return contentChildFn;
})();
function contentChildren(locator, opts) {
return createMultiResultQuerySignalFn(opts);
}
function createModelSignal(initialValue, opts) {
const node = Object.create(INPUT_SIGNAL_NODE);
const emitterRef = new OutputEmitterRef();
node.value = initialValue;
function getter() {
producerAccessed(node);
assertModelSet(node.value);
return node.value;
}
getter[SIGNAL] = node;
getter.asReadonly = signalAsReadonlyFn.bind(getter);
getter.set = (newValue) => {
if (!node.equal(node.value, newValue)) {
signalSetFn(node, newValue);
emitterRef.emit(newValue);
}
};
getter.update = (updateFn) => {
assertModelSet(node.value);
getter.set(updateFn(node.value));
};
getter.subscribe = emitterRef.subscribe.bind(emitterRef);
getter.destroyRef = emitterRef.destroyRef;
if (ngDevMode) {
getter.toString = () => `[Model Signal: ${getter()}]`;
node.debugName = opts?.debugName;
}
return getter;
}
function assertModelSet(value) {
if (value === REQUIRED_UNSET_VALUE) {
throw new RuntimeError(952, ngDevMode && "Model is required but no value is available yet.");
}
}
function modelFunction(initialValue, opts) {
ngDevMode && assertInInjectionContext(model);
return createModelSignal(initialValue, opts);
}
function modelRequiredFunction(opts) {
ngDevMode && assertInInjectionContext(model);
return createModelSignal(REQUIRED_UNSET_VALUE, opts);
}
var model = (() => {
modelFunction.required = modelRequiredFunction;
return modelFunction;
})();
var emitDistinctChangesOnlyDefaultValue = true;
var Query = class {
};
var ContentChildren = makePropDecorator("ContentChildren", (selector, opts = {}) => __spreadValues({
selector,
first: false,
isViewQuery: false,
descendants: false,
emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue
}, opts), Query);
var ContentChild = makePropDecorator("ContentChild", (selector, opts = {}) => __spreadValues({
selector,
first: true,
isViewQuery: false,
descendants: true
}, opts), Query);
var ViewChildren = makePropDecorator("ViewChildren", (selector, opts = {}) => __spreadValues({
selector,
first: false,
isViewQuery: true,
descendants: true,
emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue
}, opts), Query);
var ViewChild = makePropDecorator("ViewChild", (selector, opts) => __spreadValues({
selector,
first: true,
isViewQuery: true,
descendants: true
}, opts), Query);
var Version = class {
full;
major;
minor;
patch;
constructor(full) {
this.full = full;
const parts = full.split(".");
this.major = parts[0];
this.minor = parts[1];
this.patch = parts.slice(2).join(".");
}
};
var VERSION = new Version("20.2.1");
function compileNgModuleFactory(injector, options, moduleType) {
ngDevMode && assertNgModuleType(moduleType);
const moduleFactory = new NgModuleFactory2(moduleType);
if (true) {
return Promise.resolve(moduleFactory);
}
const compilerOptions = injector.get(COMPILER_OPTIONS, []).concat(options);
setJitOptions({
defaultEncapsulation: _lastDefined(compilerOptions.map((opts) => opts.defaultEncapsulation)),
preserveWhitespaces: _lastDefined(compilerOptions.map((opts) => opts.preserveWhitespaces))
});
if (isComponentResourceResolutionQueueEmpty()) {
return Promise.resolve(moduleFactory);
}
const compilerProviders = compilerOptions.flatMap((option) => option.providers ?? []);
if (compilerProviders.length === 0) {
return Promise.resolve(moduleFactory);
}
const compiler = getCompilerFacade({
usage: 0,
kind: "NgModule",
type: moduleType
});
const compilerInjector = Injector.create({ providers: compilerProviders });
const resourceLoader = compilerInjector.get(compiler.ResourceLoader);
return resolveComponentResources((url) => Promise.resolve(resourceLoader.get(url))).then(() => moduleFactory);
}
function _lastDefined(args) {
for (let i = args.length - 1; i >= 0; i--) {
if (args[i] !== void 0) {
return args[i];
}
}
return void 0;
}
var SCAN_DELAY = 200;
var OVERSIZED_IMAGE_TOLERANCE = 1200;
var ImagePerformanceWarning = class _ImagePerformanceWarning {
// Map of full image URLs -> original `ngSrc` values.
window = null;
observer = null;
options = inject2(IMAGE_CONFIG);
lcpImageUrl;
start() {
if (typeof PerformanceObserver === "undefined" || this.options?.disableImageSizeWarning && this.options?.disableImageLazyLoadWarning) {
return;
}
this.observer = this.initPerformanceObserver();
const doc = getDocument();
const win = doc.defaultView;
if (win) {
this.window = win;
const waitToScan = () => {
setTimeout(this.scanImages.bind(this), SCAN_DELAY);
};
const setup = () => {
if (doc.readyState === "complete") {
waitToScan();
} else {
this.window?.addEventListener("load", waitToScan, { once: true });
}
};
if (typeof Zone !== "undefined") {
Zone.root.run(() => setup());
} else {
setup();
}
}
}
ngOnDestroy() {
this.observer?.disconnect();
}
initPerformanceObserver() {
if (typeof PerformanceObserver === "undefined") {
return null;
}
const observer = new PerformanceObserver((entryList) => {
const entries = entryList.getEntries();
if (entries.length === 0)
return;
const lcpElement = entries[entries.length - 1];
const imgSrc = lcpElement.element?.src ?? "";
if (imgSrc.startsWith("data:") || imgSrc.startsWith("blob:"))
return;
this.lcpImageUrl = imgSrc;
});
observer.observe({ type: "largest-contentful-paint", buffered: true });
return observer;
}
scanImages() {
const images = getDocument().querySelectorAll("img");
let lcpElementFound, lcpElementLoadedCorrectly = false;
for (let index = 0; index < images.length; index++) {
const image = images[index];
if (!image) {
continue;
}
if (!this.options?.disableImageSizeWarning) {
if (!image.getAttribute("ng-img") && this.isOversized(image)) {
logOversizedImageWarning(image.src);
}
}
if (!this.options?.disableImageLazyLoadWarning && this.lcpImageUrl) {
if (image.src === this.lcpImageUrl) {
lcpElementFound = true;
if (image.loading !== "lazy" || image.getAttribute("ng-img")) {
lcpElementLoadedCorrectly = true;
}
}
}
}
if (lcpElementFound && !lcpElementLoadedCorrectly && this.lcpImageUrl && !this.options?.disableImageLazyLoadWarning) {
logLazyLCPWarning(this.lcpImageUrl);
}
}
isOversized(image) {
if (!this.window) {
return false;
}
const nonOversizedImageExtentions = [
// SVG images are vector-based, which means they can scale
// to any size without losing quality.
".svg"
];
const imageSource = (image.src || "").toLowerCase();
if (nonOversizedImageExtentions.some((extension) => imageSource.endsWith(extension))) {
return false;
}
const computedStyle = this.window.getComputedStyle(image);
let renderedWidth = parseFloat(computedStyle.getPropertyValue("width"));
let renderedHeight = parseFloat(computedStyle.getPropertyValue("height"));
const boxSizing = computedStyle.getPropertyValue("box-sizing");
const objectFit = computedStyle.getPropertyValue("object-fit");
if (objectFit === `cover`) {
return false;
}
if (boxSizing === "border-box") {
const paddingTop = computedStyle.getPropertyValue("padding-top");
const paddingRight = computedStyle.getPropertyValue("padding-right");
const paddingBottom = computedStyle.getPropertyValue("padding-bottom");
const paddingLeft = computedStyle.getPropertyValue("padding-left");
renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
}
const intrinsicWidth = image.naturalWidth;
const intrinsicHeight = image.naturalHeight;
const recommendedWidth = this.window.devicePixelRatio * renderedWidth;
const recommendedHeight = this.window.devicePixelRatio * renderedHeight;
const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE;
const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE;
return oversizedWidth || oversizedHeight;
}
static \u0275fac = function ImagePerformanceWarning_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ImagePerformanceWarning)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _ImagePerformanceWarning, factory: _ImagePerformanceWarning.\u0275fac, providedIn: "root" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ImagePerformanceWarning, [{
type: Injectable,
args: [{ providedIn: "root" }]
}], null, null);
})();
function logLazyLCPWarning(src) {
console.warn(formatRuntimeError(-913, `An image with src ${src} is the Largest Contentful Paint (LCP) element but was given a "loading" value of "lazy", which can negatively impact application loading performance. This warning can be addressed by changing the loading value of the LCP image to "eager", or by using the NgOptimizedImage directive's prioritization utilities. For more information about addressing or disabling this warning, see https://angular.dev/errors/NG0913`));
}
function logOversizedImageWarning(src) {
console.warn(formatRuntimeError(-913, `An image with src ${src} has intrinsic file dimensions much larger than its rendered size. This can negatively impact application loading performance. For more information about addressing or disabling this warning, see https://angular.dev/errors/NG0913`));
}
var PLATFORM_DESTROY_LISTENERS = new InjectionToken(ngDevMode ? "PlatformDestroyListeners" : "");
var ENABLE_ROOT_COMPONENT_BOOTSTRAP = new InjectionToken(ngDevMode ? "ENABLE_ROOT_COMPONENT_BOOTSTRAP" : "");
function isApplicationBootstrapConfig(config2) {
return !config2.moduleRef;
}
function bootstrap(config2) {
const envInjector = isApplicationBootstrapConfig(config2) ? config2.r3Injector : config2.moduleRef.injector;
const ngZone = envInjector.get(NgZone);
return ngZone.run(() => {
if (isApplicationBootstrapConfig(config2)) {
config2.r3Injector.resolveInjectorInitializers();
} else {
config2.moduleRef.resolveInjectorInitializers();
}
const exceptionHandler = envInjector.get(INTERNAL_APPLICATION_ERROR_HANDLER);
if (typeof ngDevMode === "undefined" || ngDevMode) {
if (envInjector.get(PROVIDED_ZONELESS) && envInjector.get(PROVIDED_NG_ZONE)) {
throw new RuntimeError(408, "Invalid change detection configuration: provideZoneChangeDetection and provideZonelessChangeDetection cannot be used together.");
}
}
let onErrorSubscription;
ngZone.runOutsideAngular(() => {
onErrorSubscription = ngZone.onError.subscribe({
next: exceptionHandler
});
});
if (isApplicationBootstrapConfig(config2)) {
const destroyListener = () => envInjector.destroy();
const onPlatformDestroyListeners = config2.platformInjector.get(PLATFORM_DESTROY_LISTENERS);
onPlatformDestroyListeners.add(destroyListener);
envInjector.onDestroy(() => {
onErrorSubscription.unsubscribe();
onPlatformDestroyListeners.delete(destroyListener);
});
} else {
const destroyListener = () => config2.moduleRef.destroy();
const onPlatformDestroyListeners = config2.platformInjector.get(PLATFORM_DESTROY_LISTENERS);
onPlatformDestroyListeners.add(destroyListener);
config2.moduleRef.onDestroy(() => {
remove(config2.allPlatformModules, config2.moduleRef);
onErrorSubscription.unsubscribe();
onPlatformDestroyListeners.delete(destroyListener);
});
}
return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
const pendingTasks = envInjector.get(PendingTasksInternal);
const taskId = pendingTasks.add();
const initStatus = envInjector.get(ApplicationInitStatus);
initStatus.runInitializers();
return initStatus.donePromise.then(() => {
const localeId = envInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
setLocaleId(localeId || DEFAULT_LOCALE_ID);
const enableRootComponentBoostrap = envInjector.get(ENABLE_ROOT_COMPONENT_BOOTSTRAP, true);
if (!enableRootComponentBoostrap) {
if (isApplicationBootstrapConfig(config2)) {
return envInjector.get(ApplicationRef);
}
config2.allPlatformModules.push(config2.moduleRef);
return config2.moduleRef;
}
if (typeof ngDevMode === "undefined" || ngDevMode) {
const imagePerformanceService = envInjector.get(ImagePerformanceWarning);
imagePerformanceService.start();
}
if (isApplicationBootstrapConfig(config2)) {
const appRef = envInjector.get(ApplicationRef);
if (config2.rootComponent !== void 0) {
appRef.bootstrap(config2.rootComponent);
}
return appRef;
} else {
moduleBootstrapImpl?.(config2.moduleRef, config2.allPlatformModules);
return config2.moduleRef;
}
}).finally(() => void pendingTasks.remove(taskId));
});
});
}
var moduleBootstrapImpl;
function setModuleBootstrapImpl() {
moduleBootstrapImpl = _moduleDoBootstrap;
}
function _moduleDoBootstrap(moduleRef, allPlatformModules) {
const appRef = moduleRef.injector.get(ApplicationRef);
if (moduleRef._bootstrapComponents.length > 0) {
moduleRef._bootstrapComponents.forEach((f) => appRef.bootstrap(f));
} else if (moduleRef.instance.ngDoBootstrap) {
moduleRef.instance.ngDoBootstrap(appRef);
} else {
throw new RuntimeError(-403, ngDevMode && `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);
}
allPlatformModules.push(moduleRef);
}
function _callAndReportToErrorHandler(errorHandler2, ngZone, callback) {
try {
const result = callback();
if (isPromise2(result)) {
return result.catch((e) => {
ngZone.runOutsideAngular(() => errorHandler2(e));
throw e;
});
}
return result;
} catch (e) {
ngZone.runOutsideAngular(() => errorHandler2(e));
throw e;
}
}
var PlatformRef = class _PlatformRef {
_injector;
_modules = [];
_destroyListeners = [];
_destroyed = false;
/** @internal */
constructor(_injector) {
this._injector = _injector;
}
/**
* Creates an instance of an `@NgModule` for the given platform.
*
* @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function
* argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.
*/
bootstrapModuleFactory(moduleFactory, options) {
const scheduleInRootZone = options?.scheduleInRootZone;
const ngZoneFactory = () => getNgZone(options?.ngZone, __spreadProps(__spreadValues({}, getNgZoneOptions({
eventCoalescing: options?.ngZoneEventCoalescing,
runCoalescing: options?.ngZoneRunCoalescing
})), {
scheduleInRootZone
}));
const ignoreChangesOutsideZone = options?.ignoreChangesOutsideZone;
const allAppProviders = [
internalProvideZoneChangeDetection({
ngZoneFactory,
ignoreChangesOutsideZone
}),
{ provide: ChangeDetectionScheduler, useExisting: ChangeDetectionSchedulerImpl },
errorHandlerEnvironmentInitializer
];
const moduleRef = createNgModuleRefWithProviders(moduleFactory.moduleType, this.injector, allAppProviders);
setModuleBootstrapImpl();
return bootstrap({
moduleRef,
allPlatformModules: this._modules,
platformInjector: this.injector
});
}
/**
* Creates an instance of an `@NgModule` for a given platform.
*
* @usageNotes
* ### Simple Example
*
* ```ts
* @NgModule({
* imports: [BrowserModule]
* })
* class MyModule {}
*
* let moduleRef = platformBrowser().bootstrapModule(MyModule);
* ```
*
*/
bootstrapModule(moduleType, compilerOptions = []) {
const options = optionsReducer({}, compilerOptions);
setModuleBootstrapImpl();
return compileNgModuleFactory(this.injector, options, moduleType).then((moduleFactory) => this.bootstrapModuleFactory(moduleFactory, options));
}
/**
* Registers a listener to be called when the platform is destroyed.
*/
onDestroy(callback) {
this._destroyListeners.push(callback);
}
/**
* Retrieves the platform {@link Injector}, which is the parent injector for
* every Angular application on the page and provides singleton providers.
*/
get injector() {
return this._injector;
}
/**
* Destroys the current Angular platform and all Angular applications on the page.
* Destroys all modules and listeners registered with the platform.
*/
destroy() {
if (this._destroyed) {
throw new RuntimeError(404, ngDevMode && "The platform has already been destroyed!");
}
this._modules.slice().forEach((module) => module.destroy());
this._destroyListeners.forEach((listener) => listener());
const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
if (destroyListeners) {
destroyListeners.forEach((listener) => listener());
destroyListeners.clear();
}
this._destroyed = true;
}
/**
* Indicates whether this instance was destroyed.
*/
get destroyed() {
return this._destroyed;
}
static \u0275fac = function PlatformRef_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _PlatformRef)(\u0275\u0275inject(Injector));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _PlatformRef, factory: _PlatformRef.\u0275fac, providedIn: "platform" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
type: Injectable,
args: [{ providedIn: "platform" }]
}], () => [{ type: Injector }], null);
})();
var _platformInjector = null;
var ALLOW_MULTIPLE_PLATFORMS = new InjectionToken(ngDevMode ? "AllowMultipleToken" : "");
function createPlatform(injector) {
if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
throw new RuntimeError(400, ngDevMode && "There can be only one platform. Destroy the previous one to create a new one.");
}
publishDefaultGlobalUtils();
publishSignalConfiguration();
_platformInjector = injector;
const platform = injector.get(PlatformRef);
runPlatformInitializers(injector);
return platform;
}
function createPlatformFactory(parentPlatformFactory, name, providers = []) {
const desc = `Platform: ${name}`;
const marker = new InjectionToken(desc);
return (extraProviders = []) => {
let platform = getPlatform();
if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
const platformProviders = [
...providers,
...extraProviders,
{ provide: marker, useValue: true }
];
if (parentPlatformFactory) {
parentPlatformFactory(platformProviders);
} else {
createPlatform(createPlatformInjector(platformProviders, desc));
}
}
return assertPlatform(marker);
};
}
function createPlatformInjector(providers = [], name) {
return Injector.create({
name,
providers: [
{ provide: INJECTOR_SCOPE, useValue: "platform" },
{ provide: PLATFORM_DESTROY_LISTENERS, useValue: /* @__PURE__ */ new Set([() => _platformInjector = null]) },
...providers
]
});
}
function assertPlatform(requiredToken) {
const platform = getPlatform();
if (!platform) {
throw new RuntimeError(401, ngDevMode && "No platform exists!");
}
if ((typeof ngDevMode === "undefined" || ngDevMode) && !platform.injector.get(requiredToken, null)) {
throw new RuntimeError(400, "A platform with a different configuration has been created. Please destroy it first.");
}
return platform;
}
function getPlatform() {
return _platformInjector?.get(PlatformRef) ?? null;
}
function createOrReusePlatformInjector(providers = []) {
if (_platformInjector)
return _platformInjector;
publishDefaultGlobalUtils();
const injector = createPlatformInjector(providers);
_platformInjector = injector;
publishSignalConfiguration();
runPlatformInitializers(injector);
return injector;
}
function runPlatformInitializers(injector) {
const inits = injector.get(PLATFORM_INITIALIZER, null);
runInInjectionContext(injector, () => {
inits?.forEach((init) => init());
});
}
var ChangeDetectorRef = class {
/**
* @internal
* @nocollapse
*/
static __NG_ELEMENT_ID__ = injectChangeDetectorRef;
};
function injectChangeDetectorRef(flags) {
return createViewRef(
getCurrentTNode(),
getLView(),
(flags & 16) === 16
/* InternalInjectFlags.ForPipe */
);
}
function createViewRef(tNode, lView, isPipe2) {
if (isComponentHost(tNode) && !isPipe2) {
const componentView = getComponentLViewByIndex(tNode.index, lView);
return new ViewRef(componentView, componentView);
} else if (tNode.type & (3 | 12 | 32 | 128)) {
const hostComponentView = lView[DECLARATION_COMPONENT_VIEW];
return new ViewRef(hostComponentView, lView);
}
return null;
}
var DefaultIterableDifferFactory = class {
constructor() {
}
supports(obj) {
return isListLikeIterable(obj);
}
create(trackByFn) {
return new DefaultIterableDiffer(trackByFn);
}
};
var trackByIdentity = (index, item) => item;
var DefaultIterableDiffer = class {
length = 0;
// TODO: confirm the usage of `collection` as it's unused, readonly and on a non public API.
collection;
// Keeps track of the used records at any point in time (during & across `_check()` calls)
_linkedRecords = null;
// Keeps track of the removed records at any point in time during `_check()` calls.
_unlinkedRecords = null;
_previousItHead = null;
_itHead = null;
_itTail = null;
_additionsHead = null;
_additionsTail = null;
_movesHead = null;
_movesTail = null;
_removalsHead = null;
_removalsTail = null;
// Keeps track of records where custom track by is the same, but item identity has changed
_identityChangesHead = null;
_identityChangesTail = null;
_trackByFn;
constructor(trackByFn) {
this._trackByFn = trackByFn || trackByIdentity;
}
forEachItem(fn) {
let record;
for (record = this._itHead; record !== null; record = record._next) {
fn(record);
}
}
forEachOperation(fn) {
let nextIt = this._itHead;
let nextRemove = this._removalsHead;
let addRemoveOffset = 0;
let moveOffsets = null;
while (nextIt || nextRemove) {
const record = !nextRemove || nextIt && nextIt.currentIndex < getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ? nextIt : nextRemove;
const adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);
const currentIndex = record.currentIndex;
if (record === nextRemove) {
addRemoveOffset--;
nextRemove = nextRemove._nextRemoved;
} else {
nextIt = nextIt._next;
if (record.previousIndex == null) {
addRemoveOffset++;
} else {
if (!moveOffsets)
moveOffsets = [];
const localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;
const localCurrentIndex = currentIndex - addRemoveOffset;
if (localMovePreviousIndex != localCurrentIndex) {
for (let i = 0; i < localMovePreviousIndex; i++) {
const offset = i < moveOffsets.length ? moveOffsets[i] : moveOffsets[i] = 0;
const index = offset + i;
if (localCurrentIndex <= index && index < localMovePreviousIndex) {
moveOffsets[i] = offset + 1;
}
}
const previousIndex = record.previousIndex;
moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex;
}
}
}
if (adjPreviousIndex !== currentIndex) {
fn(record, adjPreviousIndex, currentIndex);
}
}
}
forEachPreviousItem(fn) {
let record;
for (record = this._previousItHead; record !== null; record = record._nextPrevious) {
fn(record);
}
}
forEachAddedItem(fn) {
let record;
for (record = this._additionsHead; record !== null; record = record._nextAdded) {
fn(record);
}
}
forEachMovedItem(fn) {
let record;
for (record = this._movesHead; record !== null; record = record._nextMoved) {
fn(record);
}
}
forEachRemovedItem(fn) {
let record;
for (record = this._removalsHead; record !== null; record = record._nextRemoved) {
fn(record);
}
}
forEachIdentityChange(fn) {
let record;
for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {
fn(record);
}
}
diff(collection) {
if (collection == null)
collection = [];
if (!isListLikeIterable(collection)) {
throw new RuntimeError(900, ngDevMode && `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);
}
if (this.check(collection)) {
return this;
} else {
return null;
}
}
onDestroy() {
}
check(collection) {
this._reset();
let record = this._itHead;
let mayBeDirty = false;
let index;
let item;
let itemTrackBy;
if (Array.isArray(collection)) {
this.length = collection.length;
for (let index2 = 0; index2 < this.length; index2++) {
item = collection[index2];
itemTrackBy = this._trackByFn(index2, item);
if (record === null || !Object.is(record.trackById, itemTrackBy)) {
record = this._mismatch(record, item, itemTrackBy, index2);
mayBeDirty = true;
} else {
if (mayBeDirty) {
record = this._verifyReinsertion(record, item, itemTrackBy, index2);
}
if (!Object.is(record.item, item))
this._addIdentityChange(record, item);
}
record = record._next;
}
} else {
index = 0;
iterateListLike(collection, (item2) => {
itemTrackBy = this._trackByFn(index, item2);
if (record === null || !Object.is(record.trackById, itemTrackBy)) {
record = this._mismatch(record, item2, itemTrackBy, index);
mayBeDirty = true;
} else {
if (mayBeDirty) {
record = this._verifyReinsertion(record, item2, itemTrackBy, index);
}
if (!Object.is(record.item, item2))
this._addIdentityChange(record, item2);
}
record = record._next;
index++;
});
this.length = index;
}
this._truncate(record);
this.collection = collection;
return this.isDirty;
}
/* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity
* changes.
*/
get isDirty() {
return this._additionsHead !== null || this._movesHead !== null || this._removalsHead !== null || this._identityChangesHead !== null;
}
/**
* Reset the state of the change objects to show no changes. This means set previousKey to
* currentKey, and clear all of the queues (additions, moves, removals).
* Set the previousIndexes of moved and added items to their currentIndexes
* Reset the list of additions, moves and removals
*
* @internal
*/
_reset() {
if (this.isDirty) {
let record;
for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {
record._nextPrevious = record._next;
}
for (record = this._additionsHead; record !== null; record = record._nextAdded) {
record.previousIndex = record.currentIndex;
}
this._additionsHead = this._additionsTail = null;
for (record = this._movesHead; record !== null; record = record._nextMoved) {
record.previousIndex = record.currentIndex;
}
this._movesHead = this._movesTail = null;
this._removalsHead = this._removalsTail = null;
this._identityChangesHead = this._identityChangesTail = null;
}
}
/**
* This is the core function which handles differences between collections.
*
* - `record` is the record which we saw at this position last time. If null then it is a new
* item.
* - `item` is the current item in the collection
* - `index` is the position of the item in the collection
*
* @internal
*/
_mismatch(record, item, itemTrackBy, index) {
let previousRecord;
if (record === null) {
previousRecord = this._itTail;
} else {
previousRecord = record._prev;
this._remove(record);
}
record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);
if (record !== null) {
if (!Object.is(record.item, item))
this._addIdentityChange(record, item);
this._reinsertAfter(record, previousRecord, index);
} else {
record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);
if (record !== null) {
if (!Object.is(record.item, item))
this._addIdentityChange(record, item);
this._moveAfter(record, previousRecord, index);
} else {
record = this._addAfter(new IterableChangeRecord_(item, itemTrackBy), previousRecord, index);
}
}
return record;
}
/**
* This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)
*
* Use case: `[a, a]` => `[b, a, a]`
*
* If we did not have this check then the insertion of `b` would:
* 1) evict first `a`
* 2) insert `b` at `0` index.
* 3) leave `a` at index `1` as is. <-- this is wrong!
* 3) reinsert `a` at index 2. <-- this is wrong!
*
* The correct behavior is:
* 1) evict first `a`
* 2) insert `b` at `0` index.
* 3) reinsert `a` at index 1.
* 3) move `a` at from `1` to `2`.
*
*
* Double check that we have not evicted a duplicate item. We need to check if the item type may
* have already been removed:
* The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted
* at the end. Which will show up as the two 'a's switching position. This is incorrect, since a
* better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'
* at the end.
*
* @internal
*/
_verifyReinsertion(record, item, itemTrackBy, index) {
let reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);
if (reinsertRecord !== null) {
record = this._reinsertAfter(reinsertRecord, record._prev, index);
} else if (record.currentIndex != index) {
record.currentIndex = index;
this._addToMoves(record, index);
}
return record;
}
/**
* Get rid of any excess {@link IterableChangeRecord_}s from the previous collection
*
* - `record` The first excess {@link IterableChangeRecord_}.
*
* @internal
*/
_truncate(record) {
while (record !== null) {
const nextRecord = record._next;
this._addToRemovals(this._unlink(record));
record = nextRecord;
}
if (this._unlinkedRecords !== null) {
this._unlinkedRecords.clear();
}
if (this._additionsTail !== null) {
this._additionsTail._nextAdded = null;
}
if (this._movesTail !== null) {
this._movesTail._nextMoved = null;
}
if (this._itTail !== null) {
this._itTail._next = null;
}
if (this._removalsTail !== null) {
this._removalsTail._nextRemoved = null;
}
if (this._identityChangesTail !== null) {
this._identityChangesTail._nextIdentityChange = null;
}
}
/** @internal */
_reinsertAfter(record, prevRecord, index) {
if (this._unlinkedRecords !== null) {
this._unlinkedRecords.remove(record);
}
const prev = record._prevRemoved;
const next = record._nextRemoved;
if (prev === null) {
this._removalsHead = next;
} else {
prev._nextRemoved = next;
}
if (next === null) {
this._removalsTail = prev;
} else {
next._prevRemoved = prev;
}
this._insertAfter(record, prevRecord, index);
this._addToMoves(record, index);
return record;
}
/** @internal */
_moveAfter(record, prevRecord, index) {
this._unlink(record);
this._insertAfter(record, prevRecord, index);
this._addToMoves(record, index);
return record;
}
/** @internal */
_addAfter(record, prevRecord, index) {
this._insertAfter(record, prevRecord, index);
if (this._additionsTail === null) {
this._additionsTail = this._additionsHead = record;
} else {
this._additionsTail = this._additionsTail._nextAdded = record;
}
return record;
}
/** @internal */
_insertAfter(record, prevRecord, index) {
const next = prevRecord === null ? this._itHead : prevRecord._next;
record._next = next;
record._prev = prevRecord;
if (next === null) {
this._itTail = record;
} else {
next._prev = record;
}
if (prevRecord === null) {
this._itHead = record;
} else {
prevRecord._next = record;
}
if (this._linkedRecords === null) {
this._linkedRecords = new _DuplicateMap();
}
this._linkedRecords.put(record);
record.currentIndex = index;
return record;
}
/** @internal */
_remove(record) {
return this._addToRemovals(this._unlink(record));
}
/** @internal */
_unlink(record) {
if (this._linkedRecords !== null) {
this._linkedRecords.remove(record);
}
const prev = record._prev;
const next = record._next;
if (prev === null) {
this._itHead = next;
} else {
prev._next = next;
}
if (next === null) {
this._itTail = prev;
} else {
next._prev = prev;
}
return record;
}
/** @internal */
_addToMoves(record, toIndex) {
if (record.previousIndex === toIndex) {
return record;
}
if (this._movesTail === null) {
this._movesTail = this._movesHead = record;
} else {
this._movesTail = this._movesTail._nextMoved = record;
}
return record;
}
_addToRemovals(record) {
if (this._unlinkedRecords === null) {
this._unlinkedRecords = new _DuplicateMap();
}
this._unlinkedRecords.put(record);
record.currentIndex = null;
record._nextRemoved = null;
if (this._removalsTail === null) {
this._removalsTail = this._removalsHead = record;
record._prevRemoved = null;
} else {
record._prevRemoved = this._removalsTail;
this._removalsTail = this._removalsTail._nextRemoved = record;
}
return record;
}
/** @internal */
_addIdentityChange(record, item) {
record.item = item;
if (this._identityChangesTail === null) {
this._identityChangesTail = this._identityChangesHead = record;
} else {
this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record;
}
return record;
}
};
var IterableChangeRecord_ = class {
item;
trackById;
currentIndex = null;
previousIndex = null;
/** @internal */
_nextPrevious = null;
/** @internal */
_prev = null;
/** @internal */
_next = null;
/** @internal */
_prevDup = null;
/** @internal */
_nextDup = null;
/** @internal */
_prevRemoved = null;
/** @internal */
_nextRemoved = null;
/** @internal */
_nextAdded = null;
/** @internal */
_nextMoved = null;
/** @internal */
_nextIdentityChange = null;
constructor(item, trackById) {
this.item = item;
this.trackById = trackById;
}
};
var _DuplicateItemRecordList = class {
/** @internal */
_head = null;
/** @internal */
_tail = null;
/**
* Append the record to the list of duplicates.
*
* Note: by design all records in the list of duplicates hold the same value in record.item.
*/
add(record) {
if (this._head === null) {
this._head = this._tail = record;
record._nextDup = null;
record._prevDup = null;
} else {
this._tail._nextDup = record;
record._prevDup = this._tail;
record._nextDup = null;
this._tail = record;
}
}
// Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and
// IterableChangeRecord_.currentIndex >= atOrAfterIndex
get(trackById, atOrAfterIndex) {
let record;
for (record = this._head; record !== null; record = record._nextDup) {
if ((atOrAfterIndex === null || atOrAfterIndex <= record.currentIndex) && Object.is(record.trackById, trackById)) {
return record;
}
}
return null;
}
/**
* Remove one {@link IterableChangeRecord_} from the list of duplicates.
*
* Returns whether the list of duplicates is empty.
*/
remove(record) {
const prev = record._prevDup;
const next = record._nextDup;
if (prev === null) {
this._head = next;
} else {
prev._nextDup = next;
}
if (next === null) {
this._tail = prev;
} else {
next._prevDup = prev;
}
return this._head === null;
}
};
var _DuplicateMap = class {
map = /* @__PURE__ */ new Map();
put(record) {
const key = record.trackById;
let duplicates = this.map.get(key);
if (!duplicates) {
duplicates = new _DuplicateItemRecordList();
this.map.set(key, duplicates);
}
duplicates.add(record);
}
/**
* Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we
* have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.
*
* Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we
* have any more `a`s needs to return the second `a`.
*/
get(trackById, atOrAfterIndex) {
const key = trackById;
const recordList = this.map.get(key);
return recordList ? recordList.get(trackById, atOrAfterIndex) : null;
}
/**
* Removes a {@link IterableChangeRecord_} from the list of duplicates.
*
* The list of duplicates also is removed from the map if it gets empty.
*/
remove(record) {
const key = record.trackById;
const recordList = this.map.get(key);
if (recordList.remove(record)) {
this.map.delete(key);
}
return record;
}
get isEmpty() {
return this.map.size === 0;
}
clear() {
this.map.clear();
}
};
function getPreviousIndex(item, addRemoveOffset, moveOffsets) {
const previousIndex = item.previousIndex;
if (previousIndex === null)
return previousIndex;
let moveOffset = 0;
if (moveOffsets && previousIndex < moveOffsets.length) {
moveOffset = moveOffsets[previousIndex];
}
return previousIndex + addRemoveOffset + moveOffset;
}
var DefaultKeyValueDifferFactory = class {
constructor() {
}
supports(obj) {
return obj instanceof Map || isJsObject(obj);
}
create() {
return new DefaultKeyValueDiffer();
}
};
var DefaultKeyValueDiffer = class {
_records = /* @__PURE__ */ new Map();
_mapHead = null;
// _appendAfter is used in the check loop
_appendAfter = null;
_previousMapHead = null;
_changesHead = null;
_changesTail = null;
_additionsHead = null;
_additionsTail = null;
_removalsHead = null;
_removalsTail = null;
get isDirty() {
return this._additionsHead !== null || this._changesHead !== null || this._removalsHead !== null;
}
forEachItem(fn) {
let record;
for (record = this._mapHead; record !== null; record = record._next) {
fn(record);
}
}
forEachPreviousItem(fn) {
let record;
for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {
fn(record);
}
}
forEachChangedItem(fn) {
let record;
for (record = this._changesHead; record !== null; record = record._nextChanged) {
fn(record);
}
}
forEachAddedItem(fn) {
let record;
for (record = this._additionsHead; record !== null; record = record._nextAdded) {
fn(record);
}
}
forEachRemovedItem(fn) {
let record;
for (record = this._removalsHead; record !== null; record = record._nextRemoved) {
fn(record);
}
}
diff(map2) {
if (!map2) {
map2 = /* @__PURE__ */ new Map();
} else if (!(map2 instanceof Map || isJsObject(map2))) {
throw new RuntimeError(900, ngDevMode && `Error trying to diff '${stringify(map2)}'. Only maps and objects are allowed`);
}
return this.check(map2) ? this : null;
}
onDestroy() {
}
/**
* Check the current state of the map vs the previous.
* The algorithm is optimised for when the keys do no change.
*/
check(map2) {
this._reset();
let insertBefore = this._mapHead;
this._appendAfter = null;
this._forEach(map2, (value, key) => {
if (insertBefore && insertBefore.key === key) {
this._maybeAddToChanges(insertBefore, value);
this._appendAfter = insertBefore;
insertBefore = insertBefore._next;
} else {
const record = this._getOrCreateRecordForKey(key, value);
insertBefore = this._insertBeforeOrAppend(insertBefore, record);
}
});
if (insertBefore) {
if (insertBefore._prev) {
insertBefore._prev._next = null;
}
this._removalsHead = insertBefore;
for (let record = insertBefore; record !== null; record = record._nextRemoved) {
if (record === this._mapHead) {
this._mapHead = null;
}
this._records.delete(record.key);
record._nextRemoved = record._next;
record.previousValue = record.currentValue;
record.currentValue = null;
record._prev = null;
record._next = null;
}
}
if (this._changesTail)
this._changesTail._nextChanged = null;
if (this._additionsTail)
this._additionsTail._nextAdded = null;
return this.isDirty;
}
/**
* Inserts a record before `before` or append at the end of the list when `before` is null.
*
* Notes:
* - This method appends at `this._appendAfter`,
* - This method updates `this._appendAfter`,
* - The return value is the new value for the insertion pointer.
*/
_insertBeforeOrAppend(before, record) {
if (before) {
const prev = before._prev;
record._next = before;
record._prev = prev;
before._prev = record;
if (prev) {
prev._next = record;
}
if (before === this._mapHead) {
this._mapHead = record;
}
this._appendAfter = before;
return before;
}
if (this._appendAfter) {
this._appendAfter._next = record;
record._prev = this._appendAfter;
} else {
this._mapHead = record;
}
this._appendAfter = record;
return null;
}
_getOrCreateRecordForKey(key, value) {
if (this._records.has(key)) {
const record2 = this._records.get(key);
this._maybeAddToChanges(record2, value);
const prev = record2._prev;
const next = record2._next;
if (prev) {
prev._next = next;
}
if (next) {
next._prev = prev;
}
record2._next = null;
record2._prev = null;
return record2;
}
const record = new KeyValueChangeRecord_(key);
this._records.set(key, record);
record.currentValue = value;
this._addToAdditions(record);
return record;
}
/** @internal */
_reset() {
if (this.isDirty) {
let record;
this._previousMapHead = this._mapHead;
for (record = this._previousMapHead; record !== null; record = record._next) {
record._nextPrevious = record._next;
}
for (record = this._changesHead; record !== null; record = record._nextChanged) {
record.previousValue = record.currentValue;
}
for (record = this._additionsHead; record != null; record = record._nextAdded) {
record.previousValue = record.currentValue;
}
this._changesHead = this._changesTail = null;
this._additionsHead = this._additionsTail = null;
this._removalsHead = null;
}
}
// Add the record or a given key to the list of changes only when the value has actually changed
_maybeAddToChanges(record, newValue) {
if (!Object.is(newValue, record.currentValue)) {
record.previousValue = record.currentValue;
record.currentValue = newValue;
this._addToChanges(record);
}
}
_addToAdditions(record) {
if (this._additionsHead === null) {
this._additionsHead = this._additionsTail = record;
} else {
this._additionsTail._nextAdded = record;
this._additionsTail = record;
}
}
_addToChanges(record) {
if (this._changesHead === null) {
this._changesHead = this._changesTail = record;
} else {
this._changesTail._nextChanged = record;
this._changesTail = record;
}
}
/** @internal */
_forEach(obj, fn) {
if (obj instanceof Map) {
obj.forEach(fn);
} else {
Object.keys(obj).forEach((k) => fn(obj[k], k));
}
}
};
var KeyValueChangeRecord_ = class {
key;
previousValue = null;
currentValue = null;
/** @internal */
_nextPrevious = null;
/** @internal */
_next = null;
/** @internal */
_prev = null;
/** @internal */
_nextAdded = null;
/** @internal */
_nextRemoved = null;
/** @internal */
_nextChanged = null;
constructor(key) {
this.key = key;
}
};
function defaultIterableDiffersFactory() {
return new IterableDiffers([new DefaultIterableDifferFactory()]);
}
var IterableDiffers = class _IterableDiffers {
factories;
/** @nocollapse */
static \u0275prov = (
/** @pureOrBreakMyCode */
/* @__PURE__ */ \u0275\u0275defineInjectable({
token: _IterableDiffers,
providedIn: "root",
factory: defaultIterableDiffersFactory
})
);
constructor(factories) {
this.factories = factories;
}
static create(factories, parent) {
if (parent != null) {
const copied = parent.factories.slice();
factories = factories.concat(copied);
}
return new _IterableDiffers(factories);
}
/**
* Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the
* inherited {@link IterableDiffers} instance with the provided factories and return a new
* {@link IterableDiffers} instance.
*
* @usageNotes
* ### Example
*
* The following example shows how to extend an existing list of factories,
* which will only be applied to the injector for this component and its children.
* This step is all that's required to make a new {@link IterableDiffer} available.
*
* ```ts
* @Component({
* viewProviders: [
* IterableDiffers.extend([new ImmutableListDiffer()])
* ]
* })
* ```
*/
static extend(factories) {
return {
provide: _IterableDiffers,
useFactory: (parent) => {
return _IterableDiffers.create(factories, parent || defaultIterableDiffersFactory());
},
// Dependency technically isn't optional, but we can provide a better error message this way.
deps: [[_IterableDiffers, new SkipSelf(), new Optional()]]
};
}
find(iterable) {
const factory = this.factories.find((f) => f.supports(iterable));
if (factory != null) {
return factory;
} else {
throw new RuntimeError(901, ngDevMode && `Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);
}
}
};
function getTypeNameForDebugging(type) {
return type["name"] || typeof type;
}
function defaultKeyValueDiffersFactory() {
return new KeyValueDiffers([new DefaultKeyValueDifferFactory()]);
}
var KeyValueDiffers = class _KeyValueDiffers {
/** @nocollapse */
static \u0275prov = (
/** @pureOrBreakMyCode */
/* @__PURE__ */ \u0275\u0275defineInjectable({
token: _KeyValueDiffers,
providedIn: "root",
factory: defaultKeyValueDiffersFactory
})
);
factories;
constructor(factories) {
this.factories = factories;
}
static create(factories, parent) {
if (parent) {
const copied = parent.factories.slice();
factories = factories.concat(copied);
}
return new _KeyValueDiffers(factories);
}
/**
* Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the
* inherited {@link KeyValueDiffers} instance with the provided factories and return a new
* {@link KeyValueDiffers} instance.
*
* @usageNotes
* ### Example
*
* The following example shows how to extend an existing list of factories,
* which will only be applied to the injector for this component and its children.
* This step is all that's required to make a new {@link KeyValueDiffer} available.
*
* ```ts
* @Component({
* viewProviders: [
* KeyValueDiffers.extend([new ImmutableMapDiffer()])
* ]
* })
* ```
*/
static extend(factories) {
return {
provide: _KeyValueDiffers,
useFactory: (parent) => {
return _KeyValueDiffers.create(factories, parent || defaultKeyValueDiffersFactory());
},
// Dependency technically isn't optional, but we can provide a better error message this way.
deps: [[_KeyValueDiffers, new SkipSelf(), new Optional()]]
};
}
find(kv) {
const factory = this.factories.find((f) => f.supports(kv));
if (factory) {
return factory;
}
throw new RuntimeError(901, ngDevMode && `Cannot find a differ supporting object '${kv}'`);
}
};
var keyValDiff = [new DefaultKeyValueDifferFactory()];
var iterableDiff = [new DefaultIterableDifferFactory()];
var defaultIterableDiffers = new IterableDiffers(iterableDiff);
var defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);
var platformCore = createPlatformFactory(null, "core", []);
var ApplicationModule = class _ApplicationModule {
// Inject ApplicationRef to make it eager...
constructor(appRef) {
}
static \u0275fac = function ApplicationModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ApplicationModule)(\u0275\u0275inject(ApplicationRef));
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({ type: _ApplicationModule });
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationModule, [{
type: NgModule
}], () => [{ type: ApplicationRef }], null);
})();
function internalCreateApplication(config2) {
profiler(
8
/* ProfilerEvent.BootstrapApplicationStart */
);
try {
const { rootComponent, appProviders, platformProviders } = config2;
if ((typeof ngDevMode === "undefined" || ngDevMode) && rootComponent !== void 0) {
assertStandaloneComponentType(rootComponent);
}
const platformInjector = createOrReusePlatformInjector(platformProviders);
const allAppProviders = [
internalProvideZoneChangeDetection({}),
{ provide: ChangeDetectionScheduler, useExisting: ChangeDetectionSchedulerImpl },
errorHandlerEnvironmentInitializer,
...appProviders || []
];
const adapter = new EnvironmentNgModuleRefAdapter({
providers: allAppProviders,
parent: platformInjector,
debugName: typeof ngDevMode === "undefined" || ngDevMode ? "Environment Injector" : "",
// We skip environment initializers because we need to run them inside the NgZone, which
// happens after we get the NgZone instance from the Injector.
runEnvironmentInitializers: false
});
return bootstrap({
r3Injector: adapter.injector,
platformInjector,
rootComponent
});
} catch (e) {
return Promise.reject(e);
} finally {
profiler(
9
/* ProfilerEvent.BootstrapApplicationEnd */
);
}
}
function booleanAttribute(value) {
return typeof value === "boolean" ? value : value != null && value !== "false";
}
function numberAttribute(value, fallbackValue = NaN) {
const isNumberValue = !isNaN(parseFloat(value)) && !isNaN(Number(value));
return isNumberValue ? Number(value) : fallbackValue;
}
var NOT_SET = /* @__PURE__ */ Symbol("NOT_SET");
var EMPTY_CLEANUP_SET = /* @__PURE__ */ new Set();
var AFTER_RENDER_PHASE_EFFECT_NODE = /* @__PURE__ */ (() => __spreadProps(__spreadValues({}, SIGNAL_NODE), {
consumerIsAlwaysLive: true,
consumerAllowSignalWrites: true,
value: NOT_SET,
cleanup: null,
/** Called when the effect becomes dirty */
consumerMarkedDirty() {
if (this.sequence.impl.executing) {
if (this.sequence.lastPhase === null || this.sequence.lastPhase < this.phase) {
return;
}
this.sequence.erroredOrDestroyed = true;
}
this.sequence.scheduler.notify(
7
/* NotificationSource.RenderHook */
);
},
phaseFn(previousValue) {
this.sequence.lastPhase = this.phase;
if (!this.dirty) {
return this.signal;
}
this.dirty = false;
if (this.value !== NOT_SET && !consumerPollProducersForChange(this)) {
return this.signal;
}
try {
for (const cleanupFn of this.cleanup ?? EMPTY_CLEANUP_SET) {
cleanupFn();
}
} finally {
this.cleanup?.clear();
}
const args = [];
if (previousValue !== void 0) {
args.push(previousValue);
}
args.push(this.registerCleanupFn);
const prevConsumer = consumerBeforeComputation(this);
let newValue;
try {
newValue = this.userFn.apply(null, args);
} finally {
consumerAfterComputation(this, prevConsumer);
}
if (this.value === NOT_SET || !this.equal(this.value, newValue)) {
this.value = newValue;
this.version++;
}
return this.signal;
}
}))();
var AfterRenderEffectSequence = class extends AfterRenderSequence {
scheduler;
/**
* While this sequence is executing, this tracks the last phase which was called by the
* `afterRender` machinery.
*
* When a phase effect is marked dirty, this is used to determine whether it's already run or not.
*/
lastPhase = null;
/**
* The reactive nodes for each phase, if a phase effect is defined for that phase.
*
* These are initialized to `undefined` but set in the constructor.
*/
nodes = [void 0, void 0, void 0, void 0];
constructor(impl, effectHooks, view, scheduler, injector, snapshot = null) {
super(impl, [void 0, void 0, void 0, void 0], view, false, injector.get(DestroyRef), snapshot);
this.scheduler = scheduler;
for (const phase of AFTER_RENDER_PHASES) {
const effectHook = effectHooks[phase];
if (effectHook === void 0) {
continue;
}
const node = Object.create(AFTER_RENDER_PHASE_EFFECT_NODE);
node.sequence = this;
node.phase = phase;
node.userFn = effectHook;
node.dirty = true;
node.signal = (() => {
producerAccessed(node);
return node.value;
});
node.signal[SIGNAL] = node;
node.registerCleanupFn = (fn) => (node.cleanup ??= /* @__PURE__ */ new Set()).add(fn);
this.nodes[phase] = node;
this.hooks[phase] = (value) => node.phaseFn(value);
if (ngDevMode) {
setupDebugInfo(node, injector);
}
}
}
afterRun() {
super.afterRun();
this.lastPhase = null;
}
destroy() {
super.destroy();
for (const node of this.nodes) {
if (node) {
try {
for (const fn of node.cleanup ?? EMPTY_CLEANUP_SET) {
fn();
}
} finally {
consumerDestroy(node);
}
}
}
}
};
function afterRenderEffect(callbackOrSpec, options) {
ngDevMode && assertNotInReactiveContext(afterRenderEffect, "Call `afterRenderEffect` outside of a reactive context. For example, create the render effect inside the component constructor`.");
if (ngDevMode && !options?.injector) {
assertInInjectionContext(afterRenderEffect);
}
if (false) {
return NOOP_AFTER_RENDER_REF;
}
const injector = options?.injector ?? inject2(Injector);
const scheduler = injector.get(ChangeDetectionScheduler);
const manager = injector.get(AfterRenderManager);
const tracing = injector.get(TracingService, null, { optional: true });
manager.impl ??= injector.get(AfterRenderImpl);
let spec = callbackOrSpec;
if (typeof spec === "function") {
spec = { mixedReadWrite: callbackOrSpec };
}
const viewContext = injector.get(ViewContext, null, { optional: true });
const sequence = new AfterRenderEffectSequence(manager.impl, [spec.earlyRead, spec.write, spec.mixedReadWrite, spec.read], viewContext?.view, scheduler, injector, tracing?.snapshot(null));
manager.impl.register(sequence);
return sequence;
}
function setupDebugInfo(node, injector) {
node.debugName = `afterRenderEffect - ${phaseDebugName(node.phase)} phase`;
const prevInjectorProfilerContext = setInjectorProfilerContext({ injector, token: null });
try {
emitEffectCreatedEvent({ [SIGNAL]: node, destroy() {
} });
} finally {
setInjectorProfilerContext(prevInjectorProfilerContext);
}
}
function phaseDebugName(phase) {
switch (phase) {
case 0:
return "EarlyRead";
case 1:
return "Write";
case 2:
return "MixedReadWrite";
case 3:
return "Read";
}
}
function createComponent(component, options) {
ngDevMode && assertComponentDef(component);
const componentDef = getComponentDef(component);
const elementInjector = options.elementInjector || getNullInjector();
const factory = new ComponentFactory2(componentDef);
return factory.create(elementInjector, options.projectableNodes, options.hostElement, options.environmentInjector, options.directives, options.bindings);
}
var REQUEST = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "REQUEST" : "", {
providedIn: "platform",
factory: () => null
});
var RESPONSE_INIT = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "RESPONSE_INIT" : "", {
providedIn: "platform",
factory: () => null
});
var REQUEST_CONTEXT = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "REQUEST_CONTEXT" : "", {
providedIn: "platform",
factory: () => null
});
// node_modules/.pnpm/@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs@7.8.2__rxjs@7.8.2/node_modules/@angular/common/fesm2022/location.mjs
var _DOM = null;
function getDOM() {
return _DOM;
}
function setRootDomAdapter(adapter) {
_DOM ??= adapter;
}
var DomAdapter = class {
};
var PlatformLocation = class _PlatformLocation {
historyGo(relativePosition) {
throw new Error(ngDevMode ? "Not implemented" : "");
}
static \u0275fac = function PlatformLocation_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _PlatformLocation)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _PlatformLocation,
factory: () => (() => inject2(BrowserPlatformLocation))(),
providedIn: "platform"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformLocation, [{
type: Injectable,
args: [{
providedIn: "platform",
useFactory: () => inject2(BrowserPlatformLocation)
}]
}], null, null);
})();
var LOCATION_INITIALIZED = new InjectionToken(ngDevMode ? "Location Initialized" : "");
var BrowserPlatformLocation = class _BrowserPlatformLocation extends PlatformLocation {
_location;
_history;
_doc = inject2(DOCUMENT);
constructor() {
super();
this._location = window.location;
this._history = window.history;
}
getBaseHrefFromDOM() {
return getDOM().getBaseHref(this._doc);
}
onPopState(fn) {
const window2 = getDOM().getGlobalEventTarget(this._doc, "window");
window2.addEventListener("popstate", fn, false);
return () => window2.removeEventListener("popstate", fn);
}
onHashChange(fn) {
const window2 = getDOM().getGlobalEventTarget(this._doc, "window");
window2.addEventListener("hashchange", fn, false);
return () => window2.removeEventListener("hashchange", fn);
}
get href() {
return this._location.href;
}
get protocol() {
return this._location.protocol;
}
get hostname() {
return this._location.hostname;
}
get port() {
return this._location.port;
}
get pathname() {
return this._location.pathname;
}
get search() {
return this._location.search;
}
get hash() {
return this._location.hash;
}
set pathname(newPath) {
this._location.pathname = newPath;
}
pushState(state, title, url) {
this._history.pushState(state, title, url);
}
replaceState(state, title, url) {
this._history.replaceState(state, title, url);
}
forward() {
this._history.forward();
}
back() {
this._history.back();
}
historyGo(relativePosition = 0) {
this._history.go(relativePosition);
}
getState() {
return this._history.state;
}
static \u0275fac = function BrowserPlatformLocation_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _BrowserPlatformLocation)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _BrowserPlatformLocation,
factory: () => (() => new _BrowserPlatformLocation())(),
providedIn: "platform"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BrowserPlatformLocation, [{
type: Injectable,
args: [{
providedIn: "platform",
useFactory: () => new BrowserPlatformLocation()
}]
}], () => [], null);
})();
function joinWithSlash(start, end) {
if (!start) return end;
if (!end) return start;
if (start.endsWith("/")) {
return end.startsWith("/") ? start + end.slice(1) : start + end;
}
return end.startsWith("/") ? start + end : `${start}/${end}`;
}
function stripTrailingSlash(url) {
const pathEndIdx = url.search(/#|\?|$/);
return url[pathEndIdx - 1] === "/" ? url.slice(0, pathEndIdx - 1) + url.slice(pathEndIdx) : url;
}
function normalizeQueryParams(params) {
return params && params[0] !== "?" ? `?${params}` : params;
}
var LocationStrategy = class _LocationStrategy {
historyGo(relativePosition) {
throw new Error(ngDevMode ? "Not implemented" : "");
}
static \u0275fac = function LocationStrategy_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _LocationStrategy)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _LocationStrategy,
factory: () => (() => inject2(PathLocationStrategy))(),
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LocationStrategy, [{
type: Injectable,
args: [{
providedIn: "root",
useFactory: () => inject2(PathLocationStrategy)
}]
}], null, null);
})();
var APP_BASE_HREF = new InjectionToken(ngDevMode ? "appBaseHref" : "");
var PathLocationStrategy = class _PathLocationStrategy extends LocationStrategy {
_platformLocation;
_baseHref;
_removeListenerFns = [];
constructor(_platformLocation, href) {
super();
this._platformLocation = _platformLocation;
this._baseHref = href ?? this._platformLocation.getBaseHrefFromDOM() ?? inject2(DOCUMENT).location?.origin ?? "";
}
/** @docs-private */
ngOnDestroy() {
while (this._removeListenerFns.length) {
this._removeListenerFns.pop()();
}
}
onPopState(fn) {
this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));
}
getBaseHref() {
return this._baseHref;
}
prepareExternalUrl(internal) {
return joinWithSlash(this._baseHref, internal);
}
path(includeHash = false) {
const pathname = this._platformLocation.pathname + normalizeQueryParams(this._platformLocation.search);
const hash = this._platformLocation.hash;
return hash && includeHash ? `${pathname}${hash}` : pathname;
}
pushState(state, title, url, queryParams) {
const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));
this._platformLocation.pushState(state, title, externalUrl);
}
replaceState(state, title, url, queryParams) {
const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));
this._platformLocation.replaceState(state, title, externalUrl);
}
forward() {
this._platformLocation.forward();
}
back() {
this._platformLocation.back();
}
getState() {
return this._platformLocation.getState();
}
historyGo(relativePosition = 0) {
this._platformLocation.historyGo?.(relativePosition);
}
static \u0275fac = function PathLocationStrategy_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _PathLocationStrategy)(\u0275\u0275inject(PlatformLocation), \u0275\u0275inject(APP_BASE_HREF, 8));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _PathLocationStrategy,
factory: _PathLocationStrategy.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PathLocationStrategy, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [{
type: PlatformLocation
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Inject,
args: [APP_BASE_HREF]
}]
}], null);
})();
var Location = class _Location {
/** @internal */
_subject = new Subject();
/** @internal */
_basePath;
/** @internal */
_locationStrategy;
/** @internal */
_urlChangeListeners = [];
/** @internal */
_urlChangeSubscription = null;
constructor(locationStrategy) {
this._locationStrategy = locationStrategy;
const baseHref = this._locationStrategy.getBaseHref();
this._basePath = _stripOrigin(stripTrailingSlash(_stripIndexHtml(baseHref)));
this._locationStrategy.onPopState((ev) => {
this._subject.next({
"url": this.path(true),
"pop": true,
"state": ev.state,
"type": ev.type
});
});
}
/** @docs-private */
ngOnDestroy() {
this._urlChangeSubscription?.unsubscribe();
this._urlChangeListeners = [];
}
/**
* Normalizes the URL path for this location.
*
* @param includeHash True to include an anchor fragment in the path.
*
* @returns The normalized URL path.
*/
// TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is
// removed.
path(includeHash = false) {
return this.normalize(this._locationStrategy.path(includeHash));
}
/**
* Reports the current state of the location history.
* @returns The current value of the `history.state` object.
*/
getState() {
return this._locationStrategy.getState();
}
/**
* Normalizes the given path and compares to the current normalized path.
*
* @param path The given URL path.
* @param query Query parameters.
*
* @returns True if the given URL path is equal to the current normalized path, false
* otherwise.
*/
isCurrentPathEqualTo(path, query = "") {
return this.path() == this.normalize(path + normalizeQueryParams(query));
}
/**
* Normalizes a URL path by stripping any trailing slashes.
*
* @param url String representing a URL.
*
* @returns The normalized URL string.
*/
normalize(url) {
return _Location.stripTrailingSlash(_stripBasePath(this._basePath, _stripIndexHtml(url)));
}
/**
* Normalizes an external URL path.
* If the given URL doesn't begin with a leading slash (`'/'`), adds one
* before normalizing. Adds a hash if `HashLocationStrategy` is
* in use, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.
*
* @param url String representing a URL.
*
* @returns A normalized platform-specific URL.
*/
prepareExternalUrl(url) {
if (url && url[0] !== "/") {
url = "/" + url;
}
return this._locationStrategy.prepareExternalUrl(url);
}
// TODO: rename this method to pushState
/**
* Changes the browser's URL to a normalized version of a given URL, and pushes a
* new item onto the platform's history.
*
* @param path URL path to normalize.
* @param query Query parameters.
* @param state Location history state.
*
*/
go(path, query = "", state = null) {
this._locationStrategy.pushState(state, "", path, query);
this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);
}
/**
* Changes the browser's URL to a normalized version of the given URL, and replaces
* the top item on the platform's history stack.
*
* @param path URL path to normalize.
* @param query Query parameters.
* @param state Location history state.
*/
replaceState(path, query = "", state = null) {
this._locationStrategy.replaceState(state, "", path, query);
this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);
}
/**
* Navigates forward in the platform's history.
*/
forward() {
this._locationStrategy.forward();
}
/**
* Navigates back in the platform's history.
*/
back() {
this._locationStrategy.back();
}
/**
* Navigate to a specific page from session history, identified by its relative position to the
* current page.
*
* @param relativePosition Position of the target page in the history relative to the current
* page.
* A negative value moves backwards, a positive value moves forwards, e.g. `location.historyGo(2)`
* moves forward two pages and `location.historyGo(-2)` moves back two pages. When we try to go
* beyond what's stored in the history session, we stay in the current page. Same behaviour occurs
* when `relativePosition` equals 0.
* @see https://developer.mozilla.org/en-US/docs/Web/API/History_API#Moving_to_a_specific_point_in_history
*/
historyGo(relativePosition = 0) {
this._locationStrategy.historyGo?.(relativePosition);
}
/**
* Registers a URL change listener. Use to catch updates performed by the Angular
* framework that are not detectible through "popstate" or "hashchange" events.
*
* @param fn The change handler function, which take a URL and a location history state.
* @returns A function that, when executed, unregisters a URL change listener.
*/
onUrlChange(fn) {
this._urlChangeListeners.push(fn);
this._urlChangeSubscription ??= this.subscribe((v) => {
this._notifyUrlChangeListeners(v.url, v.state);
});
return () => {
const fnIndex = this._urlChangeListeners.indexOf(fn);
this._urlChangeListeners.splice(fnIndex, 1);
if (this._urlChangeListeners.length === 0) {
this._urlChangeSubscription?.unsubscribe();
this._urlChangeSubscription = null;
}
};
}
/** @internal */
_notifyUrlChangeListeners(url = "", state) {
this._urlChangeListeners.forEach((fn) => fn(url, state));
}
/**
* Subscribes to the platform's `popState` events.
*
* Note: `Location.go()` does not trigger the `popState` event in the browser. Use
* `Location.onUrlChange()` to subscribe to URL changes instead.
*
* @param value Event that is triggered when the state history changes.
* @param exception The exception to throw.
*
* @see [onpopstate](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate)
*
* @returns Subscribed events.
*/
subscribe(onNext, onThrow, onReturn) {
return this._subject.subscribe({
next: onNext,
error: onThrow ?? void 0,
complete: onReturn ?? void 0
});
}
/**
* Normalizes URL parameters by prepending with `?` if needed.
*
* @param params String of URL parameters.
*
* @returns The normalized URL parameters string.
*/
static normalizeQueryParams = normalizeQueryParams;
/**
* Joins two parts of a URL with a slash if needed.
*
* @param start URL string
* @param end URL string
*
*
* @returns The joined URL string.
*/
static joinWithSlash = joinWithSlash;
/**
* Removes a trailing slash from a URL string if needed.
* Looks for the first occurrence of either `#`, `?`, or the end of the
* line as `/` characters and removes the trailing slash if one exists.
*
* @param url URL string.
*
* @returns The URL string, modified if needed.
*/
static stripTrailingSlash = stripTrailingSlash;
static \u0275fac = function Location_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _Location)(\u0275\u0275inject(LocationStrategy));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _Location,
factory: () => createLocation(),
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Location, [{
type: Injectable,
args: [{
providedIn: "root",
// See #23917
useFactory: createLocation
}]
}], () => [{
type: LocationStrategy
}], null);
})();
function createLocation() {
return new Location(\u0275\u0275inject(LocationStrategy));
}
function _stripBasePath(basePath, url) {
if (!basePath || !url.startsWith(basePath)) {
return url;
}
const strippedUrl = url.substring(basePath.length);
if (strippedUrl === "" || ["/", ";", "?", "#"].includes(strippedUrl[0])) {
return strippedUrl;
}
return url;
}
function _stripIndexHtml(url) {
return url.replace(/\/index.html$/, "");
}
function _stripOrigin(baseHref) {
const isAbsoluteUrl2 = new RegExp("^(https?:)?//").test(baseHref);
if (isAbsoluteUrl2) {
const [, pathname] = baseHref.split(/\/\/[^\/]+/);
return pathname;
}
return baseHref;
}
// node_modules/.pnpm/@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs@7.8.2__rxjs@7.8.2/node_modules/@angular/common/fesm2022/common_module.mjs
var HashLocationStrategy = class _HashLocationStrategy extends LocationStrategy {
_platformLocation;
_baseHref = "";
_removeListenerFns = [];
constructor(_platformLocation, _baseHref) {
super();
this._platformLocation = _platformLocation;
if (_baseHref != null) {
this._baseHref = _baseHref;
}
}
/** @docs-private */
ngOnDestroy() {
while (this._removeListenerFns.length) {
this._removeListenerFns.pop()();
}
}
onPopState(fn) {
this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));
}
getBaseHref() {
return this._baseHref;
}
path(includeHash = false) {
const path = this._platformLocation.hash ?? "#";
return path.length > 0 ? path.substring(1) : path;
}
prepareExternalUrl(internal) {
const url = joinWithSlash(this._baseHref, internal);
return url.length > 0 ? "#" + url : url;
}
pushState(state, title, path, queryParams) {
const url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)) || this._platformLocation.pathname;
this._platformLocation.pushState(state, title, url);
}
replaceState(state, title, path, queryParams) {
const url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)) || this._platformLocation.pathname;
this._platformLocation.replaceState(state, title, url);
}
forward() {
this._platformLocation.forward();
}
back() {
this._platformLocation.back();
}
getState() {
return this._platformLocation.getState();
}
historyGo(relativePosition = 0) {
this._platformLocation.historyGo?.(relativePosition);
}
static \u0275fac = function HashLocationStrategy_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _HashLocationStrategy)(\u0275\u0275inject(PlatformLocation), \u0275\u0275inject(APP_BASE_HREF, 8));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _HashLocationStrategy,
factory: _HashLocationStrategy.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HashLocationStrategy, [{
type: Injectable
}], () => [{
type: PlatformLocation
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Inject,
args: [APP_BASE_HREF]
}]
}], null);
})();
var CURRENCIES_EN = {
"ADP": [void 0, void 0, 0],
"AFN": [void 0, "\u060B", 0],
"ALL": [void 0, void 0, 0],
"AMD": [void 0, "\u058F", 2],
"AOA": [void 0, "Kz"],
"ARS": [void 0, "$"],
"AUD": ["A$", "$"],
"AZN": [void 0, "\u20BC"],
"BAM": [void 0, "KM"],
"BBD": [void 0, "$"],
"BDT": [void 0, "\u09F3"],
"BHD": [void 0, void 0, 3],
"BIF": [void 0, void 0, 0],
"BMD": [void 0, "$"],
"BND": [void 0, "$"],
"BOB": [void 0, "Bs"],
"BRL": ["R$"],
"BSD": [void 0, "$"],
"BWP": [void 0, "P"],
"BYN": [void 0, void 0, 2],
"BYR": [void 0, void 0, 0],
"BZD": [void 0, "$"],
"CAD": ["CA$", "$", 2],
"CHF": [void 0, void 0, 2],
"CLF": [void 0, void 0, 4],
"CLP": [void 0, "$", 0],
"CNY": ["CN\xA5", "\xA5"],
"COP": [void 0, "$", 2],
"CRC": [void 0, "\u20A1", 2],
"CUC": [void 0, "$"],
"CUP": [void 0, "$"],
"CZK": [void 0, "K\u010D", 2],
"DJF": [void 0, void 0, 0],
"DKK": [void 0, "kr", 2],
"DOP": [void 0, "$"],
"EGP": [void 0, "E\xA3"],
"ESP": [void 0, "\u20A7", 0],
"EUR": ["\u20AC"],
"FJD": [void 0, "$"],
"FKP": [void 0, "\xA3"],
"GBP": ["\xA3"],
"GEL": [void 0, "\u20BE"],
"GHS": [void 0, "GH\u20B5"],
"GIP": [void 0, "\xA3"],
"GNF": [void 0, "FG", 0],
"GTQ": [void 0, "Q"],
"GYD": [void 0, "$", 2],
"HKD": ["HK$", "$"],
"HNL": [void 0, "L"],
"HRK": [void 0, "kn"],
"HUF": [void 0, "Ft", 2],
"IDR": [void 0, "Rp", 2],
"ILS": ["\u20AA"],
"INR": ["\u20B9"],
"IQD": [void 0, void 0, 0],
"IRR": [void 0, void 0, 0],
"ISK": [void 0, "kr", 0],
"ITL": [void 0, void 0, 0],
"JMD": [void 0, "$"],
"JOD": [void 0, void 0, 3],
"JPY": ["\xA5", void 0, 0],
"KHR": [void 0, "\u17DB"],
"KMF": [void 0, "CF", 0],
"KPW": [void 0, "\u20A9", 0],
"KRW": ["\u20A9", void 0, 0],
"KWD": [void 0, void 0, 3],
"KYD": [void 0, "$"],
"KZT": [void 0, "\u20B8"],
"LAK": [void 0, "\u20AD", 0],
"LBP": [void 0, "L\xA3", 0],
"LKR": [void 0, "Rs"],
"LRD": [void 0, "$"],
"LTL": [void 0, "Lt"],
"LUF": [void 0, void 0, 0],
"LVL": [void 0, "Ls"],
"LYD": [void 0, void 0, 3],
"MGA": [void 0, "Ar", 0],
"MGF": [void 0, void 0, 0],
"MMK": [void 0, "K", 0],
"MNT": [void 0, "\u20AE", 2],
"MRO": [void 0, void 0, 0],
"MUR": [void 0, "Rs", 2],
"MXN": ["MX$", "$"],
"MYR": [void 0, "RM"],
"NAD": [void 0, "$"],
"NGN": [void 0, "\u20A6"],
"NIO": [void 0, "C$"],
"NOK": [void 0, "kr", 2],
"NPR": [void 0, "Rs"],
"NZD": ["NZ$", "$"],
"OMR": [void 0, void 0, 3],
"PHP": ["\u20B1"],
"PKR": [void 0, "Rs", 2],
"PLN": [void 0, "z\u0142"],
"PYG": [void 0, "\u20B2", 0],
"RON": [void 0, "lei"],
"RSD": [void 0, void 0, 0],
"RUB": [void 0, "\u20BD"],
"RWF": [void 0, "RF", 0],
"SBD": [void 0, "$"],
"SEK": [void 0, "kr", 2],
"SGD": [void 0, "$"],
"SHP": [void 0, "\xA3"],
"SLE": [void 0, void 0, 2],
"SLL": [void 0, void 0, 0],
"SOS": [void 0, void 0, 0],
"SRD": [void 0, "$"],
"SSP": [void 0, "\xA3"],
"STD": [void 0, void 0, 0],
"STN": [void 0, "Db"],
"SYP": [void 0, "\xA3", 0],
"THB": [void 0, "\u0E3F"],
"TMM": [void 0, void 0, 0],
"TND": [void 0, void 0, 3],
"TOP": [void 0, "T$"],
"TRL": [void 0, void 0, 0],
"TRY": [void 0, "\u20BA"],
"TTD": [void 0, "$"],
"TWD": ["NT$", "$", 2],
"TZS": [void 0, void 0, 2],
"UAH": [void 0, "\u20B4"],
"UGX": [void 0, void 0, 0],
"USD": ["$"],
"UYI": [void 0, void 0, 0],
"UYU": [void 0, "$"],
"UYW": [void 0, void 0, 4],
"UZS": [void 0, void 0, 2],
"VEF": [void 0, "Bs", 2],
"VND": ["\u20AB", void 0, 0],
"VUV": [void 0, void 0, 0],
"XAF": ["FCFA", void 0, 0],
"XCD": ["EC$", "$"],
"XOF": ["F\u202FCFA", void 0, 0],
"XPF": ["CFPF", void 0, 0],
"XXX": ["\xA4"],
"YER": [void 0, void 0, 0],
"ZAR": [void 0, "R"],
"ZMK": [void 0, void 0, 0],
"ZMW": [void 0, "ZK"],
"ZWD": [void 0, void 0, 0]
};
var NumberFormatStyle;
(function(NumberFormatStyle2) {
NumberFormatStyle2[NumberFormatStyle2["Decimal"] = 0] = "Decimal";
NumberFormatStyle2[NumberFormatStyle2["Percent"] = 1] = "Percent";
NumberFormatStyle2[NumberFormatStyle2["Currency"] = 2] = "Currency";
NumberFormatStyle2[NumberFormatStyle2["Scientific"] = 3] = "Scientific";
})(NumberFormatStyle || (NumberFormatStyle = {}));
var Plural;
(function(Plural2) {
Plural2[Plural2["Zero"] = 0] = "Zero";
Plural2[Plural2["One"] = 1] = "One";
Plural2[Plural2["Two"] = 2] = "Two";
Plural2[Plural2["Few"] = 3] = "Few";
Plural2[Plural2["Many"] = 4] = "Many";
Plural2[Plural2["Other"] = 5] = "Other";
})(Plural || (Plural = {}));
var FormStyle;
(function(FormStyle2) {
FormStyle2[FormStyle2["Format"] = 0] = "Format";
FormStyle2[FormStyle2["Standalone"] = 1] = "Standalone";
})(FormStyle || (FormStyle = {}));
var TranslationWidth;
(function(TranslationWidth2) {
TranslationWidth2[TranslationWidth2["Narrow"] = 0] = "Narrow";
TranslationWidth2[TranslationWidth2["Abbreviated"] = 1] = "Abbreviated";
TranslationWidth2[TranslationWidth2["Wide"] = 2] = "Wide";
TranslationWidth2[TranslationWidth2["Short"] = 3] = "Short";
})(TranslationWidth || (TranslationWidth = {}));
var FormatWidth;
(function(FormatWidth2) {
FormatWidth2[FormatWidth2["Short"] = 0] = "Short";
FormatWidth2[FormatWidth2["Medium"] = 1] = "Medium";
FormatWidth2[FormatWidth2["Long"] = 2] = "Long";
FormatWidth2[FormatWidth2["Full"] = 3] = "Full";
})(FormatWidth || (FormatWidth = {}));
var NumberSymbol = {
/**
* Decimal separator.
* For `en-US`, the dot character.
* Example: 2,345`.`67
*/
Decimal: 0,
/**
* Grouping separator, typically for thousands.
* For `en-US`, the comma character.
* Example: 2`,`345.67
*/
Group: 1,
/**
* List-item separator.
* Example: "one, two, and three"
*/
List: 2,
/**
* Sign for percentage (out of 100).
* Example: 23.4%
*/
PercentSign: 3,
/**
* Sign for positive numbers.
* Example: +23
*/
PlusSign: 4,
/**
* Sign for negative numbers.
* Example: -23
*/
MinusSign: 5,
/**
* Computer notation for exponential value (n times a power of 10).
* Example: 1.2E3
*/
Exponential: 6,
/**
* Human-readable format of exponential.
* Example: 1.2x103
*/
SuperscriptingExponent: 7,
/**
* Sign for permille (out of 1000).
* Example: 23.4‰
*/
PerMille: 8,
/**
* Infinity, can be used with plus and minus.
* Example: ∞, +∞, -∞
*/
Infinity: 9,
/**
* Not a number.
* Example: NaN
*/
NaN: 10,
/**
* Symbol used between time units.
* Example: 10:52
*/
TimeSeparator: 11,
/**
* Decimal separator for currency values (fallback to `Decimal`).
* Example: $2,345.67
*/
CurrencyDecimal: 12,
/**
* Group separator for currency values (fallback to `Group`).
* Example: $2,345.67
*/
CurrencyGroup: 13
};
var WeekDay;
(function(WeekDay2) {
WeekDay2[WeekDay2["Sunday"] = 0] = "Sunday";
WeekDay2[WeekDay2["Monday"] = 1] = "Monday";
WeekDay2[WeekDay2["Tuesday"] = 2] = "Tuesday";
WeekDay2[WeekDay2["Wednesday"] = 3] = "Wednesday";
WeekDay2[WeekDay2["Thursday"] = 4] = "Thursday";
WeekDay2[WeekDay2["Friday"] = 5] = "Friday";
WeekDay2[WeekDay2["Saturday"] = 6] = "Saturday";
})(WeekDay || (WeekDay = {}));
function getLocaleId2(locale) {
return findLocaleData(locale)[LocaleDataIndex.LocaleId];
}
function getLocaleDayPeriods(locale, formStyle, width) {
const data = findLocaleData(locale);
const amPmData = [data[LocaleDataIndex.DayPeriodsFormat], data[LocaleDataIndex.DayPeriodsStandalone]];
const amPm = getLastDefinedValue(amPmData, formStyle);
return getLastDefinedValue(amPm, width);
}
function getLocaleDayNames(locale, formStyle, width) {
const data = findLocaleData(locale);
const daysData = [data[LocaleDataIndex.DaysFormat], data[LocaleDataIndex.DaysStandalone]];
const days = getLastDefinedValue(daysData, formStyle);
return getLastDefinedValue(days, width);
}
function getLocaleMonthNames(locale, formStyle, width) {
const data = findLocaleData(locale);
const monthsData = [data[LocaleDataIndex.MonthsFormat], data[LocaleDataIndex.MonthsStandalone]];
const months = getLastDefinedValue(monthsData, formStyle);
return getLastDefinedValue(months, width);
}
function getLocaleEraNames(locale, width) {
const data = findLocaleData(locale);
const erasData = data[LocaleDataIndex.Eras];
return getLastDefinedValue(erasData, width);
}
function getLocaleDateFormat(locale, width) {
const data = findLocaleData(locale);
return getLastDefinedValue(data[LocaleDataIndex.DateFormat], width);
}
function getLocaleTimeFormat(locale, width) {
const data = findLocaleData(locale);
return getLastDefinedValue(data[LocaleDataIndex.TimeFormat], width);
}
function getLocaleDateTimeFormat(locale, width) {
const data = findLocaleData(locale);
const dateTimeFormatData = data[LocaleDataIndex.DateTimeFormat];
return getLastDefinedValue(dateTimeFormatData, width);
}
function getLocaleNumberSymbol(locale, symbol) {
const data = findLocaleData(locale);
const res = data[LocaleDataIndex.NumberSymbols][symbol];
if (typeof res === "undefined") {
if (symbol === NumberSymbol.CurrencyDecimal) {
return data[LocaleDataIndex.NumberSymbols][NumberSymbol.Decimal];
} else if (symbol === NumberSymbol.CurrencyGroup) {
return data[LocaleDataIndex.NumberSymbols][NumberSymbol.Group];
}
}
return res;
}
function getLocaleNumberFormat(locale, type) {
const data = findLocaleData(locale);
return data[LocaleDataIndex.NumberFormats][type];
}
function getLocaleCurrencies(locale) {
const data = findLocaleData(locale);
return data[LocaleDataIndex.Currencies];
}
var getLocalePluralCase2 = getLocalePluralCase;
function checkFullData(data) {
if (!data[LocaleDataIndex.ExtraData]) {
throw new RuntimeError(2303, ngDevMode && `Missing extra locale data for the locale "${data[LocaleDataIndex.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`);
}
}
function getLocaleExtraDayPeriodRules(locale) {
const data = findLocaleData(locale);
checkFullData(data);
const rules = data[LocaleDataIndex.ExtraData][
2
/* ɵExtraLocaleDataIndex.ExtraDayPeriodsRules */
] || [];
return rules.map((rule) => {
if (typeof rule === "string") {
return extractTime(rule);
}
return [extractTime(rule[0]), extractTime(rule[1])];
});
}
function getLocaleExtraDayPeriods(locale, formStyle, width) {
const data = findLocaleData(locale);
checkFullData(data);
const dayPeriodsData = [data[LocaleDataIndex.ExtraData][
0
/* ɵExtraLocaleDataIndex.ExtraDayPeriodFormats */
], data[LocaleDataIndex.ExtraData][
1
/* ɵExtraLocaleDataIndex.ExtraDayPeriodStandalone */
]];
const dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];
return getLastDefinedValue(dayPeriods, width) || [];
}
function getLastDefinedValue(data, index) {
for (let i = index; i > -1; i--) {
if (typeof data[i] !== "undefined") {
return data[i];
}
}
throw new RuntimeError(2304, ngDevMode && "Locale data API: locale data undefined");
}
function extractTime(time) {
const [h, m] = time.split(":");
return {
hours: +h,
minutes: +m
};
}
function getCurrencySymbol(code, format, locale = "en") {
const currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];
const symbolNarrow = currency[
1
/* ɵCurrencyIndex.SymbolNarrow */
];
if (format === "narrow" && typeof symbolNarrow === "string") {
return symbolNarrow;
}
return currency[
0
/* ɵCurrencyIndex.Symbol */
] || code;
}
var DEFAULT_NB_OF_CURRENCY_DIGITS = 2;
function getNumberOfCurrencyDigits(code) {
let digits;
const currency = CURRENCIES_EN[code];
if (currency) {
digits = currency[
2
/* ɵCurrencyIndex.NbOfDigits */
];
}
return typeof digits === "number" ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;
}
var ISO8601_DATE_REGEX = /^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
var NAMED_FORMATS = {};
var DATE_FORMATS_SPLIT = /((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;
function formatDate(value, format, locale, timezone) {
let date = toDate(value);
const namedFormat = getNamedFormat(locale, format);
format = namedFormat || format;
let parts = [];
let match;
while (format) {
match = DATE_FORMATS_SPLIT.exec(format);
if (match) {
parts = parts.concat(match.slice(1));
const part = parts.pop();
if (!part) {
break;
}
format = part;
} else {
parts.push(format);
break;
}
}
if (typeof ngDevMode === "undefined" || ngDevMode) {
assertValidDateFormat(parts);
}
let dateTimezoneOffset = date.getTimezoneOffset();
if (timezone) {
dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
date = convertTimezoneToLocal(date, timezone);
}
let text = "";
parts.forEach((value2) => {
const dateFormatter = getDateFormatter(value2);
text += dateFormatter ? dateFormatter(date, locale, dateTimezoneOffset) : value2 === "''" ? "'" : value2.replace(/(^'|'$)/g, "").replace(/''/g, "'");
});
return text;
}
function assertValidDateFormat(parts) {
if (parts.some((part) => /^Y+$/.test(part)) && !parts.some((part) => /^w+$/.test(part))) {
const message = `Suspicious use of week-based year "Y" in date pattern "${parts.join("")}". Did you mean to use calendar year "y" instead?`;
if (parts.length === 1) {
console.error(formatRuntimeError(2300, message));
} else {
throw new RuntimeError(2300, message);
}
}
}
function createDate(year, month, date) {
const newDate = /* @__PURE__ */ new Date(0);
newDate.setFullYear(year, month, date);
newDate.setHours(0, 0, 0);
return newDate;
}
function getNamedFormat(locale, format) {
const localeId = getLocaleId2(locale);
NAMED_FORMATS[localeId] ??= {};
if (NAMED_FORMATS[localeId][format]) {
return NAMED_FORMATS[localeId][format];
}
let formatValue2 = "";
switch (format) {
case "shortDate":
formatValue2 = getLocaleDateFormat(locale, FormatWidth.Short);
break;
case "mediumDate":
formatValue2 = getLocaleDateFormat(locale, FormatWidth.Medium);
break;
case "longDate":
formatValue2 = getLocaleDateFormat(locale, FormatWidth.Long);
break;
case "fullDate":
formatValue2 = getLocaleDateFormat(locale, FormatWidth.Full);
break;
case "shortTime":
formatValue2 = getLocaleTimeFormat(locale, FormatWidth.Short);
break;
case "mediumTime":
formatValue2 = getLocaleTimeFormat(locale, FormatWidth.Medium);
break;
case "longTime":
formatValue2 = getLocaleTimeFormat(locale, FormatWidth.Long);
break;
case "fullTime":
formatValue2 = getLocaleTimeFormat(locale, FormatWidth.Full);
break;
case "short":
const shortTime = getNamedFormat(locale, "shortTime");
const shortDate = getNamedFormat(locale, "shortDate");
formatValue2 = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]);
break;
case "medium":
const mediumTime = getNamedFormat(locale, "mediumTime");
const mediumDate = getNamedFormat(locale, "mediumDate");
formatValue2 = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]);
break;
case "long":
const longTime = getNamedFormat(locale, "longTime");
const longDate = getNamedFormat(locale, "longDate");
formatValue2 = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]);
break;
case "full":
const fullTime = getNamedFormat(locale, "fullTime");
const fullDate = getNamedFormat(locale, "fullDate");
formatValue2 = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]);
break;
}
if (formatValue2) {
NAMED_FORMATS[localeId][format] = formatValue2;
}
return formatValue2;
}
function formatDateTime(str, opt_values) {
if (opt_values) {
str = str.replace(/\{([^}]+)}/g, function(match, key) {
return opt_values != null && key in opt_values ? opt_values[key] : match;
});
}
return str;
}
function padNumber(num, digits, minusSign = "-", trim, negWrap) {
let neg = "";
if (num < 0 || negWrap && num <= 0) {
if (negWrap) {
num = -num + 1;
} else {
num = -num;
neg = minusSign;
}
}
let strNum = String(num);
while (strNum.length < digits) {
strNum = "0" + strNum;
}
if (trim) {
strNum = strNum.slice(strNum.length - digits);
}
return neg + strNum;
}
function formatFractionalSeconds(milliseconds, digits) {
const strMs = padNumber(milliseconds, 3);
return strMs.substring(0, digits);
}
function dateGetter(name, size, offset = 0, trim = false, negWrap = false) {
return function(date, locale) {
let part = getDatePart(name, date);
if (offset > 0 || part > -offset) {
part += offset;
}
if (name === 3) {
if (part === 0 && offset === -12) {
part = 12;
}
} else if (name === 6) {
return formatFractionalSeconds(part, size);
}
const localeMinus = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
return padNumber(part, size, localeMinus, trim, negWrap);
};
}
function getDatePart(part, date) {
switch (part) {
case 0:
return date.getFullYear();
case 1:
return date.getMonth();
case 2:
return date.getDate();
case 3:
return date.getHours();
case 4:
return date.getMinutes();
case 5:
return date.getSeconds();
case 6:
return date.getMilliseconds();
case 7:
return date.getDay();
default:
throw new RuntimeError(2301, ngDevMode && `Unknown DateType value "${part}".`);
}
}
function dateStrGetter(name, width, form = FormStyle.Format, extended = false) {
return function(date, locale) {
return getDateTranslation(date, locale, name, width, form, extended);
};
}
function getDateTranslation(date, locale, name, width, form, extended) {
switch (name) {
case 2:
return getLocaleMonthNames(locale, form, width)[date.getMonth()];
case 1:
return getLocaleDayNames(locale, form, width)[date.getDay()];
case 0:
const currentHours = date.getHours();
const currentMinutes = date.getMinutes();
if (extended) {
const rules = getLocaleExtraDayPeriodRules(locale);
const dayPeriods = getLocaleExtraDayPeriods(locale, form, width);
const index = rules.findIndex((rule) => {
if (Array.isArray(rule)) {
const [from2, to] = rule;
const afterFrom = currentHours >= from2.hours && currentMinutes >= from2.minutes;
const beforeTo = currentHours < to.hours || currentHours === to.hours && currentMinutes < to.minutes;
if (from2.hours < to.hours) {
if (afterFrom && beforeTo) {
return true;
}
} else if (afterFrom || beforeTo) {
return true;
}
} else {
if (rule.hours === currentHours && rule.minutes === currentMinutes) {
return true;
}
}
return false;
});
if (index !== -1) {
return dayPeriods[index];
}
}
return getLocaleDayPeriods(locale, form, width)[currentHours < 12 ? 0 : 1];
case 3:
return getLocaleEraNames(locale, width)[date.getFullYear() <= 0 ? 0 : 1];
default:
const unexpected = name;
throw new RuntimeError(2302, ngDevMode && `unexpected translation type ${unexpected}`);
}
}
function timeZoneGetter(width) {
return function(date, locale, offset) {
const zone = -1 * offset;
const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);
switch (width) {
case 0:
return (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + padNumber(Math.abs(zone % 60), 2, minusSign);
case 1:
return "GMT" + (zone >= 0 ? "+" : "") + padNumber(hours, 1, minusSign);
case 2:
return "GMT" + (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + ":" + padNumber(Math.abs(zone % 60), 2, minusSign);
case 3:
if (offset === 0) {
return "Z";
} else {
return (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + ":" + padNumber(Math.abs(zone % 60), 2, minusSign);
}
default:
throw new RuntimeError(2302, ngDevMode && `Unknown zone width "${width}"`);
}
};
}
var JANUARY = 0;
var THURSDAY = 4;
function getFirstThursdayOfYear(year) {
const firstDayOfYear = createDate(year, JANUARY, 1).getDay();
return createDate(year, 0, 1 + (firstDayOfYear <= THURSDAY ? THURSDAY : THURSDAY + 7) - firstDayOfYear);
}
function getThursdayThisIsoWeek(datetime) {
const currentDay = datetime.getDay();
const deltaToThursday = currentDay === 0 ? -3 : THURSDAY - currentDay;
return createDate(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + deltaToThursday);
}
function weekGetter(size, monthBased = false) {
return function(date, locale) {
let result;
if (monthBased) {
const nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;
const today = date.getDate();
result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);
} else {
const thisThurs = getThursdayThisIsoWeek(date);
const firstThurs = getFirstThursdayOfYear(thisThurs.getFullYear());
const diff = thisThurs.getTime() - firstThurs.getTime();
result = 1 + Math.round(diff / 6048e5);
}
return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
};
}
function weekNumberingYearGetter(size, trim = false) {
return function(date, locale) {
const thisThurs = getThursdayThisIsoWeek(date);
const weekNumberingYear = thisThurs.getFullYear();
return padNumber(weekNumberingYear, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim);
};
}
var DATE_FORMATS = {};
function getDateFormatter(format) {
if (DATE_FORMATS[format]) {
return DATE_FORMATS[format];
}
let formatter;
switch (format) {
// Era name (AD/BC)
case "G":
case "GG":
case "GGG":
formatter = dateStrGetter(3, TranslationWidth.Abbreviated);
break;
case "GGGG":
formatter = dateStrGetter(3, TranslationWidth.Wide);
break;
case "GGGGG":
formatter = dateStrGetter(3, TranslationWidth.Narrow);
break;
// 1 digit representation of the year, e.g. (AD 1 => 1, AD 199 => 199)
case "y":
formatter = dateGetter(0, 1, 0, false, true);
break;
// 2 digit representation of the year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
case "yy":
formatter = dateGetter(0, 2, 0, true, true);
break;
// 3 digit representation of the year, padded (000-999). (e.g. AD 2001 => 01, AD 2010 => 10)
case "yyy":
formatter = dateGetter(0, 3, 0, false, true);
break;
// 4 digit representation of the year (e.g. AD 1 => 0001, AD 2010 => 2010)
case "yyyy":
formatter = dateGetter(0, 4, 0, false, true);
break;
// 1 digit representation of the week-numbering year, e.g. (AD 1 => 1, AD 199 => 199)
case "Y":
formatter = weekNumberingYearGetter(1);
break;
// 2 digit representation of the week-numbering year, padded (00-99). (e.g. AD 2001 => 01, AD
// 2010 => 10)
case "YY":
formatter = weekNumberingYearGetter(2, true);
break;
// 3 digit representation of the week-numbering year, padded (000-999). (e.g. AD 1 => 001, AD
// 2010 => 2010)
case "YYY":
formatter = weekNumberingYearGetter(3);
break;
// 4 digit representation of the week-numbering year (e.g. AD 1 => 0001, AD 2010 => 2010)
case "YYYY":
formatter = weekNumberingYearGetter(4);
break;
// Month of the year (1-12), numeric
case "M":
case "L":
formatter = dateGetter(1, 1, 1);
break;
case "MM":
case "LL":
formatter = dateGetter(1, 2, 1);
break;
// Month of the year (January, ...), string, format
case "MMM":
formatter = dateStrGetter(2, TranslationWidth.Abbreviated);
break;
case "MMMM":
formatter = dateStrGetter(2, TranslationWidth.Wide);
break;
case "MMMMM":
formatter = dateStrGetter(2, TranslationWidth.Narrow);
break;
// Month of the year (January, ...), string, standalone
case "LLL":
formatter = dateStrGetter(2, TranslationWidth.Abbreviated, FormStyle.Standalone);
break;
case "LLLL":
formatter = dateStrGetter(2, TranslationWidth.Wide, FormStyle.Standalone);
break;
case "LLLLL":
formatter = dateStrGetter(2, TranslationWidth.Narrow, FormStyle.Standalone);
break;
// Week of the year (1, ... 52)
case "w":
formatter = weekGetter(1);
break;
case "ww":
formatter = weekGetter(2);
break;
// Week of the month (1, ...)
case "W":
formatter = weekGetter(1, true);
break;
// Day of the month (1-31)
case "d":
formatter = dateGetter(2, 1);
break;
case "dd":
formatter = dateGetter(2, 2);
break;
// Day of the Week StandAlone (1, 1, Mon, Monday, M, Mo)
case "c":
case "cc":
formatter = dateGetter(7, 1);
break;
case "ccc":
formatter = dateStrGetter(1, TranslationWidth.Abbreviated, FormStyle.Standalone);
break;
case "cccc":
formatter = dateStrGetter(1, TranslationWidth.Wide, FormStyle.Standalone);
break;
case "ccccc":
formatter = dateStrGetter(1, TranslationWidth.Narrow, FormStyle.Standalone);
break;
case "cccccc":
formatter = dateStrGetter(1, TranslationWidth.Short, FormStyle.Standalone);
break;
// Day of the Week
case "E":
case "EE":
case "EEE":
formatter = dateStrGetter(1, TranslationWidth.Abbreviated);
break;
case "EEEE":
formatter = dateStrGetter(1, TranslationWidth.Wide);
break;
case "EEEEE":
formatter = dateStrGetter(1, TranslationWidth.Narrow);
break;
case "EEEEEE":
formatter = dateStrGetter(1, TranslationWidth.Short);
break;
// Generic period of the day (am-pm)
case "a":
case "aa":
case "aaa":
formatter = dateStrGetter(0, TranslationWidth.Abbreviated);
break;
case "aaaa":
formatter = dateStrGetter(0, TranslationWidth.Wide);
break;
case "aaaaa":
formatter = dateStrGetter(0, TranslationWidth.Narrow);
break;
// Extended period of the day (midnight, at night, ...), standalone
case "b":
case "bb":
case "bbb":
formatter = dateStrGetter(0, TranslationWidth.Abbreviated, FormStyle.Standalone, true);
break;
case "bbbb":
formatter = dateStrGetter(0, TranslationWidth.Wide, FormStyle.Standalone, true);
break;
case "bbbbb":
formatter = dateStrGetter(0, TranslationWidth.Narrow, FormStyle.Standalone, true);
break;
// Extended period of the day (midnight, night, ...), standalone
case "B":
case "BB":
case "BBB":
formatter = dateStrGetter(0, TranslationWidth.Abbreviated, FormStyle.Format, true);
break;
case "BBBB":
formatter = dateStrGetter(0, TranslationWidth.Wide, FormStyle.Format, true);
break;
case "BBBBB":
formatter = dateStrGetter(0, TranslationWidth.Narrow, FormStyle.Format, true);
break;
// Hour in AM/PM, (1-12)
case "h":
formatter = dateGetter(3, 1, -12);
break;
case "hh":
formatter = dateGetter(3, 2, -12);
break;
// Hour of the day (0-23)
case "H":
formatter = dateGetter(3, 1);
break;
// Hour in day, padded (00-23)
case "HH":
formatter = dateGetter(3, 2);
break;
// Minute of the hour (0-59)
case "m":
formatter = dateGetter(4, 1);
break;
case "mm":
formatter = dateGetter(4, 2);
break;
// Second of the minute (0-59)
case "s":
formatter = dateGetter(5, 1);
break;
case "ss":
formatter = dateGetter(5, 2);
break;
// Fractional second
case "S":
formatter = dateGetter(6, 1);
break;
case "SS":
formatter = dateGetter(6, 2);
break;
case "SSS":
formatter = dateGetter(6, 3);
break;
// Timezone ISO8601 short format (-0430)
case "Z":
case "ZZ":
case "ZZZ":
formatter = timeZoneGetter(
0
/* ZoneWidth.Short */
);
break;
// Timezone ISO8601 extended format (-04:30)
case "ZZZZZ":
formatter = timeZoneGetter(
3
/* ZoneWidth.Extended */
);
break;
// Timezone GMT short format (GMT+4)
case "O":
case "OO":
case "OOO":
// Should be location, but fallback to format O instead because we don't have the data yet
case "z":
case "zz":
case "zzz":
formatter = timeZoneGetter(
1
/* ZoneWidth.ShortGMT */
);
break;
// Timezone GMT long format (GMT+0430)
case "OOOO":
case "ZZZZ":
// Should be location, but fallback to format O instead because we don't have the data yet
case "zzzz":
formatter = timeZoneGetter(
2
/* ZoneWidth.Long */
);
break;
default:
return null;
}
DATE_FORMATS[format] = formatter;
return formatter;
}
function timezoneToOffset(timezone, fallback) {
timezone = timezone.replace(/:/g, "");
const requestedTimezoneOffset = Date.parse("Jan 01, 1970 00:00:00 " + timezone) / 6e4;
return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
}
function addDateMinutes(date, minutes) {
date = new Date(date.getTime());
date.setMinutes(date.getMinutes() + minutes);
return date;
}
function convertTimezoneToLocal(date, timezone, reverse) {
const reverseValue = -1;
const dateTimezoneOffset = date.getTimezoneOffset();
const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));
}
function toDate(value) {
if (isDate(value)) {
return value;
}
if (typeof value === "number" && !isNaN(value)) {
return new Date(value);
}
if (typeof value === "string") {
value = value.trim();
if (/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(value)) {
const [y, m = 1, d = 1] = value.split("-").map((val) => +val);
return createDate(y, m - 1, d);
}
const parsedNb = parseFloat(value);
if (!isNaN(value - parsedNb)) {
return new Date(parsedNb);
}
let match;
if (match = value.match(ISO8601_DATE_REGEX)) {
return isoStringToDate(match);
}
}
const date = new Date(value);
if (!isDate(date)) {
throw new RuntimeError(2302, ngDevMode && `Unable to convert "${value}" into a date`);
}
return date;
}
function isoStringToDate(match) {
const date = /* @__PURE__ */ new Date(0);
let tzHour = 0;
let tzMin = 0;
const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;
const timeSetter = match[8] ? date.setUTCHours : date.setHours;
if (match[9]) {
tzHour = Number(match[9] + match[10]);
tzMin = Number(match[9] + match[11]);
}
dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));
const h = Number(match[4] || 0) - tzHour;
const m = Number(match[5] || 0) - tzMin;
const s = Number(match[6] || 0);
const ms = Math.floor(parseFloat("0." + (match[7] || 0)) * 1e3);
timeSetter.call(date, h, m, s, ms);
return date;
}
function isDate(value) {
return value instanceof Date && !isNaN(value.valueOf());
}
var NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/;
var MAX_DIGITS = 22;
var DECIMAL_SEP = ".";
var ZERO_CHAR = "0";
var PATTERN_SEP = ";";
var GROUP_SEP = ",";
var DIGIT_CHAR = "#";
var CURRENCY_CHAR = "\xA4";
var PERCENT_CHAR = "%";
function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent = false) {
let formattedText = "";
let isZero = false;
if (!isFinite(value)) {
formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity);
} else {
let parsedNumber = parseNumber(value);
if (isPercent) {
parsedNumber = toPercent(parsedNumber);
}
let minInt = pattern.minInt;
let minFraction = pattern.minFrac;
let maxFraction = pattern.maxFrac;
if (digitsInfo) {
const parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);
if (parts === null) {
throw new RuntimeError(2306, ngDevMode && `${digitsInfo} is not a valid digit info`);
}
const minIntPart = parts[1];
const minFractionPart = parts[3];
const maxFractionPart = parts[5];
if (minIntPart != null) {
minInt = parseIntAutoRadix(minIntPart);
}
if (minFractionPart != null) {
minFraction = parseIntAutoRadix(minFractionPart);
}
if (maxFractionPart != null) {
maxFraction = parseIntAutoRadix(maxFractionPart);
} else if (minFractionPart != null && minFraction > maxFraction) {
maxFraction = minFraction;
}
}
roundNumber(parsedNumber, minFraction, maxFraction);
let digits = parsedNumber.digits;
let integerLen = parsedNumber.integerLen;
const exponent = parsedNumber.exponent;
let decimals = [];
isZero = digits.every((d) => !d);
for (; integerLen < minInt; integerLen++) {
digits.unshift(0);
}
for (; integerLen < 0; integerLen++) {
digits.unshift(0);
}
if (integerLen > 0) {
decimals = digits.splice(integerLen, digits.length);
} else {
decimals = digits;
digits = [0];
}
const groups = [];
if (digits.length >= pattern.lgSize) {
groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(""));
}
while (digits.length > pattern.gSize) {
groups.unshift(digits.splice(-pattern.gSize, digits.length).join(""));
}
if (digits.length) {
groups.unshift(digits.join(""));
}
formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));
if (decimals.length) {
formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join("");
}
if (exponent) {
formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + "+" + exponent;
}
}
if (value < 0 && !isZero) {
formattedText = pattern.negPre + formattedText + pattern.negSuf;
} else {
formattedText = pattern.posPre + formattedText + pattern.posSuf;
}
return formattedText;
}
function formatCurrency(value, locale, currency, currencyCode, digitsInfo) {
const format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency);
const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
pattern.minFrac = getNumberOfCurrencyDigits(currencyCode);
pattern.maxFrac = pattern.minFrac;
const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo);
return res.replace(CURRENCY_CHAR, currency).replace(CURRENCY_CHAR, "").trim();
}
function formatPercent(value, locale, digitsInfo) {
const format = getLocaleNumberFormat(locale, NumberFormatStyle.Percent);
const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo, true);
return res.replace(new RegExp(PERCENT_CHAR, "g"), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign));
}
function formatNumber(value, locale, digitsInfo) {
const format = getLocaleNumberFormat(locale, NumberFormatStyle.Decimal);
const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
return formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo);
}
function parseNumberFormat(format, minusSign = "-") {
const p = {
minInt: 1,
minFrac: 0,
maxFrac: 0,
posPre: "",
posSuf: "",
negPre: "",
negSuf: "",
gSize: 0,
lgSize: 0
};
const patternParts = format.split(PATTERN_SEP);
const positive = patternParts[0];
const negative = patternParts[1];
const positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ? positive.split(DECIMAL_SEP) : [positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1), positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)], integer = positiveParts[0], fraction = positiveParts[1] || "";
p.posPre = integer.substring(0, integer.indexOf(DIGIT_CHAR));
for (let i = 0; i < fraction.length; i++) {
const ch = fraction.charAt(i);
if (ch === ZERO_CHAR) {
p.minFrac = p.maxFrac = i + 1;
} else if (ch === DIGIT_CHAR) {
p.maxFrac = i + 1;
} else {
p.posSuf += ch;
}
}
const groups = integer.split(GROUP_SEP);
p.gSize = groups[1] ? groups[1].length : 0;
p.lgSize = groups[2] || groups[1] ? (groups[2] || groups[1]).length : 0;
if (negative) {
const trunkLen = positive.length - p.posPre.length - p.posSuf.length, pos = negative.indexOf(DIGIT_CHAR);
p.negPre = negative.substring(0, pos).replace(/'/g, "");
p.negSuf = negative.slice(pos + trunkLen).replace(/'/g, "");
} else {
p.negPre = minusSign + p.posPre;
p.negSuf = p.posSuf;
}
return p;
}
function toPercent(parsedNumber) {
if (parsedNumber.digits[0] === 0) {
return parsedNumber;
}
const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;
if (parsedNumber.exponent) {
parsedNumber.exponent += 2;
} else {
if (fractionLen === 0) {
parsedNumber.digits.push(0, 0);
} else if (fractionLen === 1) {
parsedNumber.digits.push(0);
}
parsedNumber.integerLen += 2;
}
return parsedNumber;
}
function parseNumber(num) {
let numStr = Math.abs(num) + "";
let exponent = 0, digits, integerLen;
let i, j, zeros;
if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {
numStr = numStr.replace(DECIMAL_SEP, "");
}
if ((i = numStr.search(/e/i)) > 0) {
if (integerLen < 0) integerLen = i;
integerLen += +numStr.slice(i + 1);
numStr = numStr.substring(0, i);
} else if (integerLen < 0) {
integerLen = numStr.length;
}
for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {
}
if (i === (zeros = numStr.length)) {
digits = [0];
integerLen = 1;
} else {
zeros--;
while (numStr.charAt(zeros) === ZERO_CHAR) zeros--;
integerLen -= i;
digits = [];
for (j = 0; i <= zeros; i++, j++) {
digits[j] = Number(numStr.charAt(i));
}
}
if (integerLen > MAX_DIGITS) {
digits = digits.splice(0, MAX_DIGITS - 1);
exponent = integerLen - 1;
integerLen = 1;
}
return {
digits,
exponent,
integerLen
};
}
function roundNumber(parsedNumber, minFrac, maxFrac) {
if (minFrac > maxFrac) {
throw new RuntimeError(2307, ngDevMode && `The minimum number of digits after fraction (${minFrac}) is higher than the maximum (${maxFrac}).`);
}
let digits = parsedNumber.digits;
let fractionLen = digits.length - parsedNumber.integerLen;
const fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac);
let roundAt = fractionSize + parsedNumber.integerLen;
let digit = digits[roundAt];
if (roundAt > 0) {
digits.splice(Math.max(parsedNumber.integerLen, roundAt));
for (let j = roundAt; j < digits.length; j++) {
digits[j] = 0;
}
} else {
fractionLen = Math.max(0, fractionLen);
parsedNumber.integerLen = 1;
digits.length = Math.max(1, roundAt = fractionSize + 1);
digits[0] = 0;
for (let i = 1; i < roundAt; i++) digits[i] = 0;
}
if (digit >= 5) {
if (roundAt - 1 < 0) {
for (let k = 0; k > roundAt; k--) {
digits.unshift(0);
parsedNumber.integerLen++;
}
digits.unshift(1);
parsedNumber.integerLen++;
} else {
digits[roundAt - 1]++;
}
}
for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);
let dropTrailingZeros = fractionSize !== 0;
const minLen = minFrac + parsedNumber.integerLen;
const carry = digits.reduceRight(function(carry2, d, i, digits2) {
d = d + carry2;
digits2[i] = d < 10 ? d : d - 10;
if (dropTrailingZeros) {
if (digits2[i] === 0 && i >= minLen) {
digits2.pop();
} else {
dropTrailingZeros = false;
}
}
return d >= 10 ? 1 : 0;
}, 0);
if (carry) {
digits.unshift(carry);
parsedNumber.integerLen++;
}
}
function parseIntAutoRadix(text) {
const result = parseInt(text);
if (isNaN(result)) {
throw new RuntimeError(2305, ngDevMode && "Invalid integer literal when parsing " + text);
}
return result;
}
var NgLocalization = class _NgLocalization {
static \u0275fac = function NgLocalization_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgLocalization)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _NgLocalization,
factory: function NgLocalization_Factory(__ngFactoryType__) {
let __ngConditionalFactory__ = null;
if (__ngFactoryType__) {
__ngConditionalFactory__ = new __ngFactoryType__();
} else {
__ngConditionalFactory__ = ((locale) => new NgLocaleLocalization(locale))(\u0275\u0275inject(LOCALE_ID));
}
return __ngConditionalFactory__;
},
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgLocalization, [{
type: Injectable,
args: [{
providedIn: "root",
useFactory: (locale) => new NgLocaleLocalization(locale),
deps: [LOCALE_ID]
}]
}], null, null);
})();
function getPluralCategory(value, cases, ngLocalization, locale) {
let key = `=${value}`;
if (cases.indexOf(key) > -1) {
return key;
}
key = ngLocalization.getPluralCategory(value, locale);
if (cases.indexOf(key) > -1) {
return key;
}
if (cases.indexOf("other") > -1) {
return "other";
}
throw new RuntimeError(2308, ngDevMode && `No plural message found for value "${value}"`);
}
var NgLocaleLocalization = class _NgLocaleLocalization extends NgLocalization {
locale;
constructor(locale) {
super();
this.locale = locale;
}
getPluralCategory(value, locale) {
const plural2 = getLocalePluralCase2(locale || this.locale)(value);
switch (plural2) {
case Plural.Zero:
return "zero";
case Plural.One:
return "one";
case Plural.Two:
return "two";
case Plural.Few:
return "few";
case Plural.Many:
return "many";
default:
return "other";
}
}
static \u0275fac = function NgLocaleLocalization_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgLocaleLocalization)(\u0275\u0275inject(LOCALE_ID));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _NgLocaleLocalization,
factory: _NgLocaleLocalization.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgLocaleLocalization, [{
type: Injectable
}], () => [{
type: void 0,
decorators: [{
type: Inject,
args: [LOCALE_ID]
}]
}], null);
})();
var WS_REGEXP = /\s+/;
var EMPTY_ARRAY2 = [];
var NgClass = class _NgClass {
_ngEl;
_renderer;
initialClasses = EMPTY_ARRAY2;
rawClass;
stateMap = /* @__PURE__ */ new Map();
constructor(_ngEl, _renderer) {
this._ngEl = _ngEl;
this._renderer = _renderer;
}
set klass(value) {
this.initialClasses = value != null ? value.trim().split(WS_REGEXP) : EMPTY_ARRAY2;
}
set ngClass(value) {
this.rawClass = typeof value === "string" ? value.trim().split(WS_REGEXP) : value;
}
/*
The NgClass directive uses the custom change detection algorithm for its inputs. The custom
algorithm is necessary since inputs are represented as complex object or arrays that need to be
deeply-compared.
This algorithm is perf-sensitive since NgClass is used very frequently and its poor performance
might negatively impact runtime performance of the entire change detection cycle. The design of
this algorithm is making sure that:
- there is no unnecessary DOM manipulation (CSS classes are added / removed from the DOM only when
needed), even if references to bound objects change;
- there is no memory allocation if nothing changes (even relatively modest memory allocation
during the change detection cycle can result in GC pauses for some of the CD cycles).
The algorithm works by iterating over the set of bound classes, staring with [class] binding and
then going over [ngClass] binding. For each CSS class name:
- check if it was seen before (this information is tracked in the state map) and if its value
changed;
- mark it as "touched" - names that are not marked are not present in the latest set of binding
and we can remove such class name from the internal data structures;
After iteration over all the CSS class names we've got data structure with all the information
necessary to synchronize changes to the DOM - it is enough to iterate over the state map, flush
changes to the DOM and reset internal data structures so those are ready for the next change
detection cycle.
*/
ngDoCheck() {
for (const klass of this.initialClasses) {
this._updateState(klass, true);
}
const rawClass = this.rawClass;
if (Array.isArray(rawClass) || rawClass instanceof Set) {
for (const klass of rawClass) {
this._updateState(klass, true);
}
} else if (rawClass != null) {
for (const klass of Object.keys(rawClass)) {
this._updateState(klass, Boolean(rawClass[klass]));
}
}
this._applyStateDiff();
}
_updateState(klass, nextEnabled) {
const state = this.stateMap.get(klass);
if (state !== void 0) {
if (state.enabled !== nextEnabled) {
state.changed = true;
state.enabled = nextEnabled;
}
state.touched = true;
} else {
this.stateMap.set(klass, {
enabled: nextEnabled,
changed: true,
touched: true
});
}
}
_applyStateDiff() {
for (const stateEntry of this.stateMap) {
const klass = stateEntry[0];
const state = stateEntry[1];
if (state.changed) {
this._toggleClass(klass, state.enabled);
state.changed = false;
} else if (!state.touched) {
if (state.enabled) {
this._toggleClass(klass, false);
}
this.stateMap.delete(klass);
}
state.touched = false;
}
}
_toggleClass(klass, enabled) {
if (ngDevMode) {
if (typeof klass !== "string") {
throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${stringify(klass)}`);
}
}
klass = klass.trim();
if (klass.length > 0) {
klass.split(WS_REGEXP).forEach((klass2) => {
if (enabled) {
this._renderer.addClass(this._ngEl.nativeElement, klass2);
} else {
this._renderer.removeClass(this._ngEl.nativeElement, klass2);
}
});
}
}
static \u0275fac = function NgClass_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgClass)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Renderer2));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgClass,
selectors: [["", "ngClass", ""]],
inputs: {
klass: [0, "class", "klass"],
ngClass: "ngClass"
}
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgClass, [{
type: Directive,
args: [{
selector: "[ngClass]"
}]
}], () => [{
type: ElementRef
}, {
type: Renderer2
}], {
klass: [{
type: Input,
args: ["class"]
}],
ngClass: [{
type: Input,
args: ["ngClass"]
}]
});
})();
var NgComponentOutlet = class _NgComponentOutlet {
_viewContainerRef;
// TODO(crisbeto): this should be `Type<T>`, but doing so broke a few
// targets in a TGP so we need to do it in a major version.
/** Component that should be rendered in the outlet. */
ngComponentOutlet = null;
ngComponentOutletInputs;
ngComponentOutletInjector;
ngComponentOutletEnvironmentInjector;
ngComponentOutletContent;
ngComponentOutletNgModule;
/**
* @deprecated This input is deprecated, use `ngComponentOutletNgModule` instead.
*/
ngComponentOutletNgModuleFactory;
_componentRef;
_moduleRef;
/**
* A helper data structure that allows us to track inputs that were part of the
* ngComponentOutletInputs expression. Tracking inputs is necessary for proper removal of ones
* that are no longer referenced.
*/
_inputsUsed = /* @__PURE__ */ new Map();
/**
* Gets the instance of the currently-rendered component.
* Will be null if no component has been rendered.
*/
get componentInstance() {
return this._componentRef?.instance ?? null;
}
constructor(_viewContainerRef) {
this._viewContainerRef = _viewContainerRef;
}
_needToReCreateNgModuleInstance(changes) {
return changes["ngComponentOutletNgModule"] !== void 0 || changes["ngComponentOutletNgModuleFactory"] !== void 0;
}
_needToReCreateComponentInstance(changes) {
return changes["ngComponentOutlet"] !== void 0 || changes["ngComponentOutletContent"] !== void 0 || changes["ngComponentOutletInjector"] !== void 0 || changes["ngComponentOutletEnvironmentInjector"] !== void 0 || this._needToReCreateNgModuleInstance(changes);
}
/** @docs-private */
ngOnChanges(changes) {
if (this._needToReCreateComponentInstance(changes)) {
this._viewContainerRef.clear();
this._inputsUsed.clear();
this._componentRef = void 0;
if (this.ngComponentOutlet) {
const injector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;
if (this._needToReCreateNgModuleInstance(changes)) {
this._moduleRef?.destroy();
if (this.ngComponentOutletNgModule) {
this._moduleRef = createNgModule(this.ngComponentOutletNgModule, getParentInjector(injector));
} else if (this.ngComponentOutletNgModuleFactory) {
this._moduleRef = this.ngComponentOutletNgModuleFactory.create(getParentInjector(injector));
} else {
this._moduleRef = void 0;
}
}
this._componentRef = this._viewContainerRef.createComponent(this.ngComponentOutlet, {
injector,
ngModuleRef: this._moduleRef,
projectableNodes: this.ngComponentOutletContent,
environmentInjector: this.ngComponentOutletEnvironmentInjector
});
}
}
}
/** @docs-private */
ngDoCheck() {
if (this._componentRef) {
if (this.ngComponentOutletInputs) {
for (const inputName of Object.keys(this.ngComponentOutletInputs)) {
this._inputsUsed.set(inputName, true);
}
}
this._applyInputStateDiff(this._componentRef);
}
}
/** @docs-private */
ngOnDestroy() {
this._moduleRef?.destroy();
}
_applyInputStateDiff(componentRef) {
for (const [inputName, touched] of this._inputsUsed) {
if (!touched) {
componentRef.setInput(inputName, void 0);
this._inputsUsed.delete(inputName);
} else {
componentRef.setInput(inputName, this.ngComponentOutletInputs[inputName]);
this._inputsUsed.set(inputName, false);
}
}
}
static \u0275fac = function NgComponentOutlet_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgComponentOutlet)(\u0275\u0275directiveInject(ViewContainerRef));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgComponentOutlet,
selectors: [["", "ngComponentOutlet", ""]],
inputs: {
ngComponentOutlet: "ngComponentOutlet",
ngComponentOutletInputs: "ngComponentOutletInputs",
ngComponentOutletInjector: "ngComponentOutletInjector",
ngComponentOutletEnvironmentInjector: "ngComponentOutletEnvironmentInjector",
ngComponentOutletContent: "ngComponentOutletContent",
ngComponentOutletNgModule: "ngComponentOutletNgModule",
ngComponentOutletNgModuleFactory: "ngComponentOutletNgModuleFactory"
},
exportAs: ["ngComponentOutlet"],
features: [\u0275\u0275NgOnChangesFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgComponentOutlet, [{
type: Directive,
args: [{
selector: "[ngComponentOutlet]",
exportAs: "ngComponentOutlet"
}]
}], () => [{
type: ViewContainerRef
}], {
ngComponentOutlet: [{
type: Input
}],
ngComponentOutletInputs: [{
type: Input
}],
ngComponentOutletInjector: [{
type: Input
}],
ngComponentOutletEnvironmentInjector: [{
type: Input
}],
ngComponentOutletContent: [{
type: Input
}],
ngComponentOutletNgModule: [{
type: Input
}],
ngComponentOutletNgModuleFactory: [{
type: Input
}]
});
})();
function getParentInjector(injector) {
const parentNgModule = injector.get(NgModuleRef$1);
return parentNgModule.injector;
}
var NgForOfContext = class {
$implicit;
ngForOf;
index;
count;
constructor($implicit, ngForOf, index, count) {
this.$implicit = $implicit;
this.ngForOf = ngForOf;
this.index = index;
this.count = count;
}
// Indicates whether this is the first item in the collection.
get first() {
return this.index === 0;
}
// Indicates whether this is the last item in the collection.
get last() {
return this.index === this.count - 1;
}
// Indicates whether an index of this item in the collection is even.
get even() {
return this.index % 2 === 0;
}
// Indicates whether an index of this item in the collection is odd.
get odd() {
return !this.even;
}
};
var NgForOf = class _NgForOf {
_viewContainer;
_template;
_differs;
/**
* The value of the iterable expression, which can be used as a
* [template input variable](guide/directives/structural-directives#shorthand).
* @deprecated The `ngFor` directive is deprecated. Use the `@for` block instead.
*/
set ngForOf(ngForOf) {
this._ngForOf = ngForOf;
this._ngForOfDirty = true;
}
/**
* Specifies a custom `TrackByFunction` to compute the identity of items in an iterable.
*
* If a custom `TrackByFunction` is not provided, `NgForOf` will use the item's [object
* identity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
* as the key.
*
* `NgForOf` uses the computed key to associate items in an iterable with DOM elements
* it produces for these items.
*
* A custom `TrackByFunction` is useful to provide good user experience in cases when items in an
* iterable rendered using `NgForOf` have a natural identifier (for example, custom ID or a
* primary key), and this iterable could be updated with new object instances that still
* represent the same underlying entity (for example, when data is re-fetched from the server,
* and the iterable is recreated and re-rendered, but most of the data is still the same).
*
* @see {@link TrackByFunction}
* @deprecated The `ngFor` directive is deprecated. Use the `@for` block instead.
*/
set ngForTrackBy(fn) {
if ((typeof ngDevMode === "undefined" || ngDevMode) && fn != null && typeof fn !== "function") {
console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}. See https://angular.dev/api/common/NgForOf#change-propagation for more information.`);
}
this._trackByFn = fn;
}
get ngForTrackBy() {
return this._trackByFn;
}
_ngForOf = null;
_ngForOfDirty = true;
_differ = null;
// waiting for microsoft/typescript#43662 to allow the return type `TrackByFunction|undefined` for
// the getter
_trackByFn;
constructor(_viewContainer, _template, _differs) {
this._viewContainer = _viewContainer;
this._template = _template;
this._differs = _differs;
}
/**
* A reference to the template that is stamped out for each item in the iterable.
* @see [template reference variable](guide/templates/variables#template-reference-variables)
* @deprecated The `ngFor` directive is deprecated. Use the `@for` block instead.
*/
set ngForTemplate(value) {
if (value) {
this._template = value;
}
}
/**
* Applies the changes when needed.
* @docs-private
*/
ngDoCheck() {
if (this._ngForOfDirty) {
this._ngForOfDirty = false;
const value = this._ngForOf;
if (!this._differ && value) {
if (typeof ngDevMode === "undefined" || ngDevMode) {
try {
this._differ = this._differs.find(value).create(this.ngForTrackBy);
} catch {
let errorMessage = `Cannot find a differ supporting object '${value}' of type '${getTypeName(value)}'. NgFor only supports binding to Iterables, such as Arrays.`;
if (typeof value === "object") {
errorMessage += " Did you mean to use the keyvalue pipe?";
}
throw new RuntimeError(-2200, errorMessage);
}
} else {
this._differ = this._differs.find(value).create(this.ngForTrackBy);
}
}
}
if (this._differ) {
const changes = this._differ.diff(this._ngForOf);
if (changes) this._applyChanges(changes);
}
}
_applyChanges(changes) {
const viewContainer = this._viewContainer;
changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => {
if (item.previousIndex == null) {
viewContainer.createEmbeddedView(this._template, new NgForOfContext(item.item, this._ngForOf, -1, -1), currentIndex === null ? void 0 : currentIndex);
} else if (currentIndex == null) {
viewContainer.remove(adjustedPreviousIndex === null ? void 0 : adjustedPreviousIndex);
} else if (adjustedPreviousIndex !== null) {
const view = viewContainer.get(adjustedPreviousIndex);
viewContainer.move(view, currentIndex);
applyViewChange(view, item);
}
});
for (let i = 0, ilen = viewContainer.length; i < ilen; i++) {
const viewRef = viewContainer.get(i);
const context2 = viewRef.context;
context2.index = i;
context2.count = ilen;
context2.ngForOf = this._ngForOf;
}
changes.forEachIdentityChange((record) => {
const viewRef = viewContainer.get(record.currentIndex);
applyViewChange(viewRef, record);
});
}
/**
* Asserts the correct type of the context for the template that `NgForOf` will render.
*
* The presence of this method is a signal to the Ivy template type-check compiler that the
* `NgForOf` structural directive renders its template with a specific context type.
*/
static ngTemplateContextGuard(dir, ctx) {
return true;
}
static \u0275fac = function NgForOf_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgForOf)(\u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(TemplateRef), \u0275\u0275directiveInject(IterableDiffers));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgForOf,
selectors: [["", "ngFor", "", "ngForOf", ""]],
inputs: {
ngForOf: "ngForOf",
ngForTrackBy: "ngForTrackBy",
ngForTemplate: "ngForTemplate"
}
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgForOf, [{
type: Directive,
args: [{
selector: "[ngFor][ngForOf]"
}]
}], () => [{
type: ViewContainerRef
}, {
type: TemplateRef
}, {
type: IterableDiffers
}], {
ngForOf: [{
type: Input
}],
ngForTrackBy: [{
type: Input
}],
ngForTemplate: [{
type: Input
}]
});
})();
function applyViewChange(view, record) {
view.context.$implicit = record.item;
}
function getTypeName(type) {
return type["name"] || typeof type;
}
var NgIf = class _NgIf {
_viewContainer;
_context = new NgIfContext();
_thenTemplateRef = null;
_elseTemplateRef = null;
_thenViewRef = null;
_elseViewRef = null;
constructor(_viewContainer, templateRef) {
this._viewContainer = _viewContainer;
this._thenTemplateRef = templateRef;
}
/**
* The Boolean expression to evaluate as the condition for showing a template.
* @deprecated Use the `@if` block instead. Intent to remove in v22
*/
set ngIf(condition) {
this._context.$implicit = this._context.ngIf = condition;
this._updateView();
}
/**
* A template to show if the condition expression evaluates to true.
* @deprecated Use the `@if` block instead. Intent to remove in v22
*/
set ngIfThen(templateRef) {
assertTemplate(templateRef, (typeof ngDevMode === "undefined" || ngDevMode) && "ngIfThen");
this._thenTemplateRef = templateRef;
this._thenViewRef = null;
this._updateView();
}
/**
* A template to show if the condition expression evaluates to false.
* @deprecated Use the `@if` block instead. Intent to remove in v22
*/
set ngIfElse(templateRef) {
assertTemplate(templateRef, (typeof ngDevMode === "undefined" || ngDevMode) && "ngIfElse");
this._elseTemplateRef = templateRef;
this._elseViewRef = null;
this._updateView();
}
_updateView() {
if (this._context.$implicit) {
if (!this._thenViewRef) {
this._viewContainer.clear();
this._elseViewRef = null;
if (this._thenTemplateRef) {
this._thenViewRef = this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);
}
}
} else {
if (!this._elseViewRef) {
this._viewContainer.clear();
this._thenViewRef = null;
if (this._elseTemplateRef) {
this._elseViewRef = this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);
}
}
}
}
/** @internal */
static ngIfUseIfTypeGuard;
/**
* Assert the correct type of the expression bound to the `ngIf` input within the template.
*
* The presence of this static field is a signal to the Ivy template type check compiler that
* when the `NgIf` structural directive renders its template, the type of the expression bound
* to `ngIf` should be narrowed in some way. For `NgIf`, the binding expression itself is used to
* narrow its type, which allows the strictNullChecks feature of TypeScript to work with `NgIf`.
*/
static ngTemplateGuard_ngIf;
/**
* Asserts the correct type of the context for the template that `NgIf` will render.
*
* The presence of this method is a signal to the Ivy template type-check compiler that the
* `NgIf` structural directive renders its template with a specific context type.
*/
static ngTemplateContextGuard(dir, ctx) {
return true;
}
static \u0275fac = function NgIf_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgIf)(\u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(TemplateRef));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgIf,
selectors: [["", "ngIf", ""]],
inputs: {
ngIf: "ngIf",
ngIfThen: "ngIfThen",
ngIfElse: "ngIfElse"
}
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgIf, [{
type: Directive,
args: [{
selector: "[ngIf]"
}]
}], () => [{
type: ViewContainerRef
}, {
type: TemplateRef
}], {
ngIf: [{
type: Input
}],
ngIfThen: [{
type: Input
}],
ngIfElse: [{
type: Input
}]
});
})();
var NgIfContext = class {
$implicit = null;
ngIf = null;
};
function assertTemplate(templateRef, property) {
if (templateRef && !templateRef.createEmbeddedView) {
throw new RuntimeError(2020, (typeof ngDevMode === "undefined" || ngDevMode) && `${property} must be a TemplateRef, but received '${stringify(templateRef)}'.`);
}
}
var SwitchView = class {
_viewContainerRef;
_templateRef;
_created = false;
constructor(_viewContainerRef, _templateRef) {
this._viewContainerRef = _viewContainerRef;
this._templateRef = _templateRef;
}
create() {
this._created = true;
this._viewContainerRef.createEmbeddedView(this._templateRef);
}
destroy() {
this._created = false;
this._viewContainerRef.clear();
}
enforceState(created) {
if (created && !this._created) {
this.create();
} else if (!created && this._created) {
this.destroy();
}
}
};
var NgSwitch = class _NgSwitch {
_defaultViews = [];
_defaultUsed = false;
_caseCount = 0;
_lastCaseCheckIndex = 0;
_lastCasesMatched = false;
_ngSwitch;
/** @deprecated Use the `@switch` block instead. Intent to remove in v22 */
set ngSwitch(newValue) {
this._ngSwitch = newValue;
if (this._caseCount === 0) {
this._updateDefaultCases(true);
}
}
/** @internal */
_addCase() {
return this._caseCount++;
}
/** @internal */
_addDefault(view) {
this._defaultViews.push(view);
}
/** @internal */
_matchCase(value) {
const matched = value === this._ngSwitch;
this._lastCasesMatched ||= matched;
this._lastCaseCheckIndex++;
if (this._lastCaseCheckIndex === this._caseCount) {
this._updateDefaultCases(!this._lastCasesMatched);
this._lastCaseCheckIndex = 0;
this._lastCasesMatched = false;
}
return matched;
}
_updateDefaultCases(useDefault) {
if (this._defaultViews.length > 0 && useDefault !== this._defaultUsed) {
this._defaultUsed = useDefault;
for (const defaultView of this._defaultViews) {
defaultView.enforceState(useDefault);
}
}
}
static \u0275fac = function NgSwitch_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgSwitch)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgSwitch,
selectors: [["", "ngSwitch", ""]],
inputs: {
ngSwitch: "ngSwitch"
}
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitch, [{
type: Directive,
args: [{
selector: "[ngSwitch]"
}]
}], null, {
ngSwitch: [{
type: Input
}]
});
})();
var NgSwitchCase = class _NgSwitchCase {
ngSwitch;
_view;
/**
* Stores the HTML template to be selected on match.
* @deprecated Use the `@case` block within a `@switch` block instead. Intent to remove in v22
*/
ngSwitchCase;
constructor(viewContainer, templateRef, ngSwitch) {
this.ngSwitch = ngSwitch;
if ((typeof ngDevMode === "undefined" || ngDevMode) && !ngSwitch) {
throwNgSwitchProviderNotFoundError("ngSwitchCase", "NgSwitchCase");
}
ngSwitch._addCase();
this._view = new SwitchView(viewContainer, templateRef);
}
/**
* Performs case matching. For internal use only.
* @docs-private
*/
ngDoCheck() {
this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase));
}
static \u0275fac = function NgSwitchCase_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgSwitchCase)(\u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(TemplateRef), \u0275\u0275directiveInject(NgSwitch, 9));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgSwitchCase,
selectors: [["", "ngSwitchCase", ""]],
inputs: {
ngSwitchCase: "ngSwitchCase"
}
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitchCase, [{
type: Directive,
args: [{
selector: "[ngSwitchCase]"
}]
}], () => [{
type: ViewContainerRef
}, {
type: TemplateRef
}, {
type: NgSwitch,
decorators: [{
type: Optional
}, {
type: Host
}]
}], {
ngSwitchCase: [{
type: Input
}]
});
})();
var NgSwitchDefault = class _NgSwitchDefault {
constructor(viewContainer, templateRef, ngSwitch) {
if ((typeof ngDevMode === "undefined" || ngDevMode) && !ngSwitch) {
throwNgSwitchProviderNotFoundError("ngSwitchDefault", "NgSwitchDefault");
}
ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));
}
static \u0275fac = function NgSwitchDefault_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgSwitchDefault)(\u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(TemplateRef), \u0275\u0275directiveInject(NgSwitch, 9));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgSwitchDefault,
selectors: [["", "ngSwitchDefault", ""]]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitchDefault, [{
type: Directive,
args: [{
selector: "[ngSwitchDefault]"
}]
}], () => [{
type: ViewContainerRef
}, {
type: TemplateRef
}, {
type: NgSwitch,
decorators: [{
type: Optional
}, {
type: Host
}]
}], null);
})();
function throwNgSwitchProviderNotFoundError(attrName, directiveName) {
throw new RuntimeError(2e3, `An element with the "${attrName}" attribute (matching the "${directiveName}" directive) must be located inside an element with the "ngSwitch" attribute (matching "NgSwitch" directive)`);
}
var NgPlural = class _NgPlural {
_localization;
_activeView;
_caseViews = {};
constructor(_localization) {
this._localization = _localization;
}
set ngPlural(value) {
this._updateView(value);
}
addCase(value, switchView) {
this._caseViews[value] = switchView;
}
_updateView(switchValue) {
this._clearViews();
const cases = Object.keys(this._caseViews);
const key = getPluralCategory(switchValue, cases, this._localization);
this._activateView(this._caseViews[key]);
}
_clearViews() {
if (this._activeView) this._activeView.destroy();
}
_activateView(view) {
if (view) {
this._activeView = view;
this._activeView.create();
}
}
static \u0275fac = function NgPlural_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgPlural)(\u0275\u0275directiveInject(NgLocalization));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgPlural,
selectors: [["", "ngPlural", ""]],
inputs: {
ngPlural: "ngPlural"
}
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgPlural, [{
type: Directive,
args: [{
selector: "[ngPlural]"
}]
}], () => [{
type: NgLocalization
}], {
ngPlural: [{
type: Input
}]
});
})();
var NgPluralCase = class _NgPluralCase {
value;
constructor(value, template, viewContainer, ngPlural) {
this.value = value;
const isANumber = !isNaN(Number(value));
ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template));
}
static \u0275fac = function NgPluralCase_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgPluralCase)(\u0275\u0275injectAttribute("ngPluralCase"), \u0275\u0275directiveInject(TemplateRef), \u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(NgPlural, 1));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgPluralCase,
selectors: [["", "ngPluralCase", ""]]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgPluralCase, [{
type: Directive,
args: [{
selector: "[ngPluralCase]"
}]
}], () => [{
type: void 0,
decorators: [{
type: Attribute,
args: ["ngPluralCase"]
}]
}, {
type: TemplateRef
}, {
type: ViewContainerRef
}, {
type: NgPlural,
decorators: [{
type: Host
}]
}], null);
})();
var NgStyle = class _NgStyle {
_ngEl;
_differs;
_renderer;
_ngStyle = null;
_differ = null;
constructor(_ngEl, _differs, _renderer) {
this._ngEl = _ngEl;
this._differs = _differs;
this._renderer = _renderer;
}
set ngStyle(values) {
this._ngStyle = values;
if (!this._differ && values) {
this._differ = this._differs.find(values).create();
}
}
ngDoCheck() {
if (this._differ) {
const changes = this._differ.diff(this._ngStyle);
if (changes) {
this._applyChanges(changes);
}
}
}
_setStyle(nameAndUnit, value) {
const [name, unit] = nameAndUnit.split(".");
const flags = name.indexOf("-") === -1 ? void 0 : RendererStyleFlags2.DashCase;
if (value != null) {
this._renderer.setStyle(this._ngEl.nativeElement, name, unit ? `${value}${unit}` : value, flags);
} else {
this._renderer.removeStyle(this._ngEl.nativeElement, name, flags);
}
}
_applyChanges(changes) {
changes.forEachRemovedItem((record) => this._setStyle(record.key, null));
changes.forEachAddedItem((record) => this._setStyle(record.key, record.currentValue));
changes.forEachChangedItem((record) => this._setStyle(record.key, record.currentValue));
}
static \u0275fac = function NgStyle_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgStyle)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(KeyValueDiffers), \u0275\u0275directiveInject(Renderer2));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgStyle,
selectors: [["", "ngStyle", ""]],
inputs: {
ngStyle: "ngStyle"
}
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgStyle, [{
type: Directive,
args: [{
selector: "[ngStyle]"
}]
}], () => [{
type: ElementRef
}, {
type: KeyValueDiffers
}, {
type: Renderer2
}], {
ngStyle: [{
type: Input,
args: ["ngStyle"]
}]
});
})();
var NgTemplateOutlet = class _NgTemplateOutlet {
_viewContainerRef;
_viewRef = null;
/**
* A context object to attach to the {@link EmbeddedViewRef}. This should be an
* object, the object's keys will be available for binding by the local template `let`
* declarations.
* Using the key `$implicit` in the context object will set its value as default.
*/
ngTemplateOutletContext = null;
/**
* A string defining the template reference and optionally the context object for the template.
*/
ngTemplateOutlet = null;
/** Injector to be used within the embedded view. */
ngTemplateOutletInjector = null;
constructor(_viewContainerRef) {
this._viewContainerRef = _viewContainerRef;
}
ngOnChanges(changes) {
if (this._shouldRecreateView(changes)) {
const viewContainerRef = this._viewContainerRef;
if (this._viewRef) {
viewContainerRef.remove(viewContainerRef.indexOf(this._viewRef));
}
if (!this.ngTemplateOutlet) {
this._viewRef = null;
return;
}
const viewContext = this._createContextForwardProxy();
this._viewRef = viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, viewContext, {
injector: this.ngTemplateOutletInjector ?? void 0
});
}
}
/**
* We need to re-create existing embedded view if either is true:
* - the outlet changed.
* - the injector changed.
*/
_shouldRecreateView(changes) {
return !!changes["ngTemplateOutlet"] || !!changes["ngTemplateOutletInjector"];
}
/**
* For a given outlet instance, we create a proxy object that delegates
* to the user-specified context. This allows changing, or swapping out
* the context object completely without having to destroy/re-create the view.
*/
_createContextForwardProxy() {
return new Proxy({}, {
set: (_target, prop, newValue) => {
if (!this.ngTemplateOutletContext) {
return false;
}
return Reflect.set(this.ngTemplateOutletContext, prop, newValue);
},
get: (_target, prop, receiver) => {
if (!this.ngTemplateOutletContext) {
return void 0;
}
return Reflect.get(this.ngTemplateOutletContext, prop, receiver);
}
});
}
static \u0275fac = function NgTemplateOutlet_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgTemplateOutlet)(\u0275\u0275directiveInject(ViewContainerRef));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgTemplateOutlet,
selectors: [["", "ngTemplateOutlet", ""]],
inputs: {
ngTemplateOutletContext: "ngTemplateOutletContext",
ngTemplateOutlet: "ngTemplateOutlet",
ngTemplateOutletInjector: "ngTemplateOutletInjector"
},
features: [\u0275\u0275NgOnChangesFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgTemplateOutlet, [{
type: Directive,
args: [{
selector: "[ngTemplateOutlet]"
}]
}], () => [{
type: ViewContainerRef
}], {
ngTemplateOutletContext: [{
type: Input
}],
ngTemplateOutlet: [{
type: Input
}],
ngTemplateOutletInjector: [{
type: Input
}]
});
})();
var COMMON_DIRECTIVES = [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase];
function invalidPipeArgumentError(type, value) {
return new RuntimeError(2100, ngDevMode && `InvalidPipeArgument: '${value}' for pipe '${stringify(type)}'`);
}
var SubscribableStrategy = class {
createSubscription(async2, updateLatestValue, onError) {
return untracked2(() => async2.subscribe({
next: updateLatestValue,
error: onError
}));
}
dispose(subscription) {
untracked2(() => subscription.unsubscribe());
}
};
var PromiseStrategy = class {
createSubscription(async2, updateLatestValue, onError) {
async2.then(
// Using optional chaining because we may have set it to `null`; since the promise
// is async, the view might be destroyed by the time the promise resolves.
(v) => updateLatestValue?.(v),
(e) => onError?.(e)
);
return {
unsubscribe: () => {
updateLatestValue = null;
onError = null;
}
};
}
dispose(subscription) {
subscription.unsubscribe();
}
};
var _promiseStrategy = new PromiseStrategy();
var _subscribableStrategy = new SubscribableStrategy();
var AsyncPipe = class _AsyncPipe {
_ref;
_latestValue = null;
markForCheckOnValueUpdate = true;
_subscription = null;
_obj = null;
_strategy = null;
applicationErrorHandler = inject2(INTERNAL_APPLICATION_ERROR_HANDLER);
constructor(ref) {
this._ref = ref;
}
ngOnDestroy() {
if (this._subscription) {
this._dispose();
}
this._ref = null;
}
transform(obj) {
if (!this._obj) {
if (obj) {
try {
this.markForCheckOnValueUpdate = false;
this._subscribe(obj);
} finally {
this.markForCheckOnValueUpdate = true;
}
}
return this._latestValue;
}
if (obj !== this._obj) {
this._dispose();
return this.transform(obj);
}
return this._latestValue;
}
_subscribe(obj) {
this._obj = obj;
this._strategy = this._selectStrategy(obj);
this._subscription = this._strategy.createSubscription(obj, (value) => this._updateLatestValue(obj, value), (e) => this.applicationErrorHandler(e));
}
_selectStrategy(obj) {
if (isPromise2(obj)) {
return _promiseStrategy;
}
if (isSubscribable(obj)) {
return _subscribableStrategy;
}
throw invalidPipeArgumentError(_AsyncPipe, obj);
}
_dispose() {
this._strategy.dispose(this._subscription);
this._latestValue = null;
this._subscription = null;
this._obj = null;
}
_updateLatestValue(async2, value) {
if (async2 === this._obj) {
this._latestValue = value;
if (this.markForCheckOnValueUpdate) {
this._ref?.markForCheck();
}
}
}
static \u0275fac = function AsyncPipe_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _AsyncPipe)(\u0275\u0275directiveInject(ChangeDetectorRef, 16));
};
static \u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
name: "async",
type: _AsyncPipe,
pure: false
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AsyncPipe, [{
type: Pipe,
args: [{
name: "async",
pure: false
}]
}], () => [{
type: ChangeDetectorRef
}], null);
})();
var LowerCasePipe = class _LowerCasePipe {
transform(value) {
if (value == null) return null;
if (typeof value !== "string") {
throw invalidPipeArgumentError(_LowerCasePipe, value);
}
return value.toLowerCase();
}
static \u0275fac = function LowerCasePipe_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _LowerCasePipe)();
};
static \u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
name: "lowercase",
type: _LowerCasePipe,
pure: true
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LowerCasePipe, [{
type: Pipe,
args: [{
name: "lowercase"
}]
}], null, null);
})();
var unicodeWordMatch = /(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g;
var TitleCasePipe = class _TitleCasePipe {
transform(value) {
if (value == null) return null;
if (typeof value !== "string") {
throw invalidPipeArgumentError(_TitleCasePipe, value);
}
return value.replace(unicodeWordMatch, (txt) => txt[0].toUpperCase() + txt.slice(1).toLowerCase());
}
static \u0275fac = function TitleCasePipe_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _TitleCasePipe)();
};
static \u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
name: "titlecase",
type: _TitleCasePipe,
pure: true
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TitleCasePipe, [{
type: Pipe,
args: [{
name: "titlecase"
}]
}], null, null);
})();
var UpperCasePipe = class _UpperCasePipe {
transform(value) {
if (value == null) return null;
if (typeof value !== "string") {
throw invalidPipeArgumentError(_UpperCasePipe, value);
}
return value.toUpperCase();
}
static \u0275fac = function UpperCasePipe_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _UpperCasePipe)();
};
static \u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
name: "uppercase",
type: _UpperCasePipe,
pure: true
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(UpperCasePipe, [{
type: Pipe,
args: [{
name: "uppercase"
}]
}], null, null);
})();
var DEFAULT_DATE_FORMAT = "mediumDate";
var DATE_PIPE_DEFAULT_TIMEZONE = new InjectionToken(ngDevMode ? "DATE_PIPE_DEFAULT_TIMEZONE" : "");
var DATE_PIPE_DEFAULT_OPTIONS = new InjectionToken(ngDevMode ? "DATE_PIPE_DEFAULT_OPTIONS" : "");
var DatePipe = class _DatePipe {
locale;
defaultTimezone;
defaultOptions;
constructor(locale, defaultTimezone, defaultOptions) {
this.locale = locale;
this.defaultTimezone = defaultTimezone;
this.defaultOptions = defaultOptions;
}
transform(value, format, timezone, locale) {
if (value == null || value === "" || value !== value) return null;
try {
const _format = format ?? this.defaultOptions?.dateFormat ?? DEFAULT_DATE_FORMAT;
const _timezone = timezone ?? this.defaultOptions?.timezone ?? this.defaultTimezone ?? void 0;
return formatDate(value, _format, locale || this.locale, _timezone);
} catch (error) {
throw invalidPipeArgumentError(_DatePipe, error.message);
}
}
static \u0275fac = function DatePipe_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _DatePipe)(\u0275\u0275directiveInject(LOCALE_ID, 16), \u0275\u0275directiveInject(DATE_PIPE_DEFAULT_TIMEZONE, 24), \u0275\u0275directiveInject(DATE_PIPE_DEFAULT_OPTIONS, 24));
};
static \u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
name: "date",
type: _DatePipe,
pure: true
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DatePipe, [{
type: Pipe,
args: [{
name: "date"
}]
}], () => [{
type: void 0,
decorators: [{
type: Inject,
args: [LOCALE_ID]
}]
}, {
type: void 0,
decorators: [{
type: Inject,
args: [DATE_PIPE_DEFAULT_TIMEZONE]
}, {
type: Optional
}]
}, {
type: void 0,
decorators: [{
type: Inject,
args: [DATE_PIPE_DEFAULT_OPTIONS]
}, {
type: Optional
}]
}], null);
})();
var _INTERPOLATION_REGEXP = /#/g;
var I18nPluralPipe = class _I18nPluralPipe {
_localization;
constructor(_localization) {
this._localization = _localization;
}
/**
* @param value the number to be formatted
* @param pluralMap an object that mimics the ICU format, see
* https://unicode-org.github.io/icu/userguide/format_parse/messages/.
* @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
* default).
*/
transform(value, pluralMap, locale) {
if (value == null) return "";
if (typeof pluralMap !== "object" || pluralMap === null) {
throw invalidPipeArgumentError(_I18nPluralPipe, pluralMap);
}
const key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale);
return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());
}
static \u0275fac = function I18nPluralPipe_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _I18nPluralPipe)(\u0275\u0275directiveInject(NgLocalization, 16));
};
static \u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
name: "i18nPlural",
type: _I18nPluralPipe,
pure: true
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(I18nPluralPipe, [{
type: Pipe,
args: [{
name: "i18nPlural"
}]
}], () => [{
type: NgLocalization
}], null);
})();
var I18nSelectPipe = class _I18nSelectPipe {
/**
* @param value a string to be internationalized.
* @param mapping an object that indicates the text that should be displayed
* for different values of the provided `value`.
*/
transform(value, mapping) {
if (value == null) return "";
if (typeof mapping !== "object" || typeof value !== "string") {
throw invalidPipeArgumentError(_I18nSelectPipe, mapping);
}
if (mapping.hasOwnProperty(value)) {
return mapping[value];
}
if (mapping.hasOwnProperty("other")) {
return mapping["other"];
}
return "";
}
static \u0275fac = function I18nSelectPipe_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _I18nSelectPipe)();
};
static \u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
name: "i18nSelect",
type: _I18nSelectPipe,
pure: true
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(I18nSelectPipe, [{
type: Pipe,
args: [{
name: "i18nSelect"
}]
}], null, null);
})();
var JsonPipe = class _JsonPipe {
/**
* @param value A value of any type to convert into a JSON-format string.
*/
transform(value) {
return JSON.stringify(value, null, 2);
}
static \u0275fac = function JsonPipe_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _JsonPipe)();
};
static \u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
name: "json",
type: _JsonPipe,
pure: false
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(JsonPipe, [{
type: Pipe,
args: [{
name: "json",
pure: false
}]
}], null, null);
})();
function makeKeyValuePair(key, value) {
return {
key,
value
};
}
var KeyValuePipe = class _KeyValuePipe {
differs;
constructor(differs) {
this.differs = differs;
}
differ;
keyValues = [];
compareFn = defaultComparator;
transform(input2, compareFn = defaultComparator) {
if (!input2 || !(input2 instanceof Map) && typeof input2 !== "object") {
return null;
}
this.differ ??= this.differs.find(input2).create();
const differChanges = this.differ.diff(input2);
const compareFnChanged = compareFn !== this.compareFn;
if (differChanges) {
this.keyValues = [];
differChanges.forEachItem((r) => {
this.keyValues.push(makeKeyValuePair(r.key, r.currentValue));
});
}
if (differChanges || compareFnChanged) {
if (compareFn) {
this.keyValues.sort(compareFn);
}
this.compareFn = compareFn;
}
return this.keyValues;
}
static \u0275fac = function KeyValuePipe_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _KeyValuePipe)(\u0275\u0275directiveInject(KeyValueDiffers, 16));
};
static \u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
name: "keyvalue",
type: _KeyValuePipe,
pure: false
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(KeyValuePipe, [{
type: Pipe,
args: [{
name: "keyvalue",
pure: false
}]
}], () => [{
type: KeyValueDiffers
}], null);
})();
function defaultComparator(keyValueA, keyValueB) {
const a = keyValueA.key;
const b = keyValueB.key;
if (a === b) return 0;
if (a == null) return 1;
if (b == null) return -1;
if (typeof a == "string" && typeof b == "string") {
return a < b ? -1 : 1;
}
if (typeof a == "number" && typeof b == "number") {
return a - b;
}
if (typeof a == "boolean" && typeof b == "boolean") {
return a < b ? -1 : 1;
}
const aString = String(a);
const bString = String(b);
return aString == bString ? 0 : aString < bString ? -1 : 1;
}
var DecimalPipe = class _DecimalPipe {
_locale;
constructor(_locale) {
this._locale = _locale;
}
transform(value, digitsInfo, locale) {
if (!isValue(value)) return null;
locale ||= this._locale;
try {
const num = strToNumber(value);
return formatNumber(num, locale, digitsInfo);
} catch (error) {
throw invalidPipeArgumentError(_DecimalPipe, error.message);
}
}
static \u0275fac = function DecimalPipe_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _DecimalPipe)(\u0275\u0275directiveInject(LOCALE_ID, 16));
};
static \u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
name: "number",
type: _DecimalPipe,
pure: true
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DecimalPipe, [{
type: Pipe,
args: [{
name: "number"
}]
}], () => [{
type: void 0,
decorators: [{
type: Inject,
args: [LOCALE_ID]
}]
}], null);
})();
var PercentPipe = class _PercentPipe {
_locale;
constructor(_locale) {
this._locale = _locale;
}
/**
*
* @param value The number to be formatted as a percentage.
* @param digitsInfo Decimal representation options, specified by a string
* in the following format:<br>
* <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>.
* - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
* Default is `1`.
* - `minFractionDigits`: The minimum number of digits after the decimal point.
* Default is `0`.
* - `maxFractionDigits`: The maximum number of digits after the decimal point.
* Default is `0`.
* @param locale A locale code for the locale format rules to use.
* When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
* See [Setting your app locale](guide/i18n/locale-id).
*/
transform(value, digitsInfo, locale) {
if (!isValue(value)) return null;
locale ||= this._locale;
try {
const num = strToNumber(value);
return formatPercent(num, locale, digitsInfo);
} catch (error) {
throw invalidPipeArgumentError(_PercentPipe, error.message);
}
}
static \u0275fac = function PercentPipe_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _PercentPipe)(\u0275\u0275directiveInject(LOCALE_ID, 16));
};
static \u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
name: "percent",
type: _PercentPipe,
pure: true
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PercentPipe, [{
type: Pipe,
args: [{
name: "percent"
}]
}], () => [{
type: void 0,
decorators: [{
type: Inject,
args: [LOCALE_ID]
}]
}], null);
})();
var CurrencyPipe = class _CurrencyPipe {
_locale;
_defaultCurrencyCode;
constructor(_locale, _defaultCurrencyCode = "USD") {
this._locale = _locale;
this._defaultCurrencyCode = _defaultCurrencyCode;
}
transform(value, currencyCode = this._defaultCurrencyCode, display = "symbol", digitsInfo, locale) {
if (!isValue(value)) return null;
locale ||= this._locale;
if (typeof display === "boolean") {
if (typeof ngDevMode === "undefined" || ngDevMode) {
console.warn(`Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are "code", "symbol" or "symbol-narrow".`);
}
display = display ? "symbol" : "code";
}
let currency = currencyCode || this._defaultCurrencyCode;
if (display !== "code") {
if (display === "symbol" || display === "symbol-narrow") {
currency = getCurrencySymbol(currency, display === "symbol" ? "wide" : "narrow", locale);
} else {
currency = display;
}
}
try {
const num = strToNumber(value);
return formatCurrency(num, locale, currency, currencyCode, digitsInfo);
} catch (error) {
throw invalidPipeArgumentError(_CurrencyPipe, error.message);
}
}
static \u0275fac = function CurrencyPipe_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CurrencyPipe)(\u0275\u0275directiveInject(LOCALE_ID, 16), \u0275\u0275directiveInject(DEFAULT_CURRENCY_CODE, 16));
};
static \u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
name: "currency",
type: _CurrencyPipe,
pure: true
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CurrencyPipe, [{
type: Pipe,
args: [{
name: "currency"
}]
}], () => [{
type: void 0,
decorators: [{
type: Inject,
args: [LOCALE_ID]
}]
}, {
type: void 0,
decorators: [{
type: Inject,
args: [DEFAULT_CURRENCY_CODE]
}]
}], null);
})();
function isValue(value) {
return !(value == null || value === "" || value !== value);
}
function strToNumber(value) {
if (typeof value === "string" && !isNaN(Number(value) - parseFloat(value))) {
return Number(value);
}
if (typeof value !== "number") {
throw new RuntimeError(2309, ngDevMode && `${value} is not a number`);
}
return value;
}
var SlicePipe = class _SlicePipe {
transform(value, start, end) {
if (value == null) return null;
const supports = typeof value === "string" || Array.isArray(value);
if (!supports) {
throw invalidPipeArgumentError(_SlicePipe, value);
}
return value.slice(start, end);
}
static \u0275fac = function SlicePipe_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _SlicePipe)();
};
static \u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
name: "slice",
type: _SlicePipe,
pure: false
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SlicePipe, [{
type: Pipe,
args: [{
name: "slice",
pure: false
}]
}], null, null);
})();
var COMMON_PIPES = [AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe];
var CommonModule = class _CommonModule {
static \u0275fac = function CommonModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CommonModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _CommonModule,
imports: [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe],
exports: [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CommonModule, [{
type: NgModule,
args: [{
imports: [COMMON_DIRECTIVES, COMMON_PIPES],
exports: [COMMON_DIRECTIVES, COMMON_PIPES]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs@7.8.2__rxjs@7.8.2/node_modules/@angular/common/fesm2022/xhr.mjs
function parseCookieValue(cookieStr, name) {
name = encodeURIComponent(name);
for (const cookie of cookieStr.split(";")) {
const eqIndex = cookie.indexOf("=");
const [cookieName, cookieValue] = eqIndex == -1 ? [cookie, ""] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)];
if (cookieName.trim() === name) {
return decodeURIComponent(cookieValue);
}
}
return null;
}
var XhrFactory = class {
};
// node_modules/.pnpm/@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs@7.8.2__rxjs@7.8.2/node_modules/@angular/common/fesm2022/common.mjs
var PLATFORM_BROWSER_ID = "browser";
function isPlatformBrowser(platformId) {
return platformId === PLATFORM_BROWSER_ID;
}
var VERSION2 = new Version("20.2.1");
var PLACEHOLDER_QUALITY = "20";
function getUrl(src, win) {
return isAbsoluteUrl(src) ? new URL(src) : new URL(src, win.location.href);
}
function isAbsoluteUrl(src) {
return /^https?:\/\//.test(src);
}
function extractHostname(url) {
return isAbsoluteUrl(url) ? new URL(url).hostname : url;
}
function isValidPath(path) {
const isString = typeof path === "string";
if (!isString || path.trim() === "") {
return false;
}
try {
const url = new URL(path);
return true;
} catch {
return false;
}
}
function normalizePath(path) {
return path.endsWith("/") ? path.slice(0, -1) : path;
}
function normalizeSrc(src) {
return src.startsWith("/") ? src.slice(1) : src;
}
var noopImageLoader = (config2) => config2.src;
var IMAGE_LOADER = new InjectionToken(ngDevMode ? "ImageLoader" : "", {
providedIn: "root",
factory: () => noopImageLoader
});
function createImageLoader(buildUrlFn, exampleUrls) {
return function provideImageLoader(path) {
if (!isValidPath(path)) {
throwInvalidPathError(path, exampleUrls || []);
}
path = normalizePath(path);
const loaderFn = (config2) => {
if (isAbsoluteUrl(config2.src)) {
throwUnexpectedAbsoluteUrlError(path, config2.src);
}
return buildUrlFn(path, __spreadProps(__spreadValues({}, config2), {
src: normalizeSrc(config2.src)
}));
};
const providers = [{
provide: IMAGE_LOADER,
useValue: loaderFn
}];
return providers;
};
}
function throwInvalidPathError(path, exampleUrls) {
throw new RuntimeError(2959, ngDevMode && `Image loader has detected an invalid path (\`${path}\`). To fix this, supply a path using one of the following formats: ${exampleUrls.join(" or ")}`);
}
function throwUnexpectedAbsoluteUrlError(path, url) {
throw new RuntimeError(2959, ngDevMode && `Image loader has detected a \`<img>\` tag with an invalid \`ngSrc\` attribute: ${url}. This image loader expects \`ngSrc\` to be a relative URL - however the provided value is an absolute URL. To fix this, provide \`ngSrc\` as a path relative to the base URL configured for this loader (\`${path}\`).`);
}
var provideCloudflareLoader = createImageLoader(createCloudflareUrl, ngDevMode ? ["https://<ZONE>/cdn-cgi/image/<OPTIONS>/<SOURCE-IMAGE>"] : void 0);
function createCloudflareUrl(path, config2) {
let params = `format=auto`;
if (config2.width) {
params += `,width=${config2.width}`;
}
if (config2.isPlaceholder) {
params += `,quality=${PLACEHOLDER_QUALITY}`;
}
return `${path}/cdn-cgi/image/${params}/${config2.src}`;
}
var cloudinaryLoaderInfo = {
name: "Cloudinary",
testUrl: isCloudinaryUrl
};
var CLOUDINARY_LOADER_REGEX = /https?\:\/\/[^\/]+\.cloudinary\.com\/.+/;
function isCloudinaryUrl(url) {
return CLOUDINARY_LOADER_REGEX.test(url);
}
var provideCloudinaryLoader = createImageLoader(createCloudinaryUrl, ngDevMode ? ["https://res.cloudinary.com/mysite", "https://mysite.cloudinary.com", "https://subdomain.mysite.com"] : void 0);
function createCloudinaryUrl(path, config2) {
const quality = config2.isPlaceholder ? "q_auto:low" : "q_auto";
let params = `f_auto,${quality}`;
if (config2.width) {
params += `,w_${config2.width}`;
}
if (config2.loaderParams?.["rounded"]) {
params += `,r_max`;
}
return `${path}/image/upload/${params}/${config2.src}`;
}
var imageKitLoaderInfo = {
name: "ImageKit",
testUrl: isImageKitUrl
};
var IMAGE_KIT_LOADER_REGEX = /https?\:\/\/[^\/]+\.imagekit\.io\/.+/;
function isImageKitUrl(url) {
return IMAGE_KIT_LOADER_REGEX.test(url);
}
var provideImageKitLoader = createImageLoader(createImagekitUrl, ngDevMode ? ["https://ik.imagekit.io/mysite", "https://subdomain.mysite.com"] : void 0);
function createImagekitUrl(path, config2) {
const {
src,
width
} = config2;
const params = [];
if (width) {
params.push(`w-${width}`);
}
if (config2.isPlaceholder) {
params.push(`q-${PLACEHOLDER_QUALITY}`);
}
const urlSegments = params.length ? [path, `tr:${params.join(",")}`, src] : [path, src];
const url = new URL(urlSegments.join("/"));
return url.href;
}
var imgixLoaderInfo = {
name: "Imgix",
testUrl: isImgixUrl
};
var IMGIX_LOADER_REGEX = /https?\:\/\/[^\/]+\.imgix\.net\/.+/;
function isImgixUrl(url) {
return IMGIX_LOADER_REGEX.test(url);
}
var provideImgixLoader = createImageLoader(createImgixUrl, ngDevMode ? ["https://somepath.imgix.net/"] : void 0);
function createImgixUrl(path, config2) {
const url = new URL(`${path}/${config2.src}`);
url.searchParams.set("auto", "format");
if (config2.width) {
url.searchParams.set("w", config2.width.toString());
}
if (config2.isPlaceholder) {
url.searchParams.set("q", PLACEHOLDER_QUALITY);
}
return url.href;
}
var netlifyLoaderInfo = {
name: "Netlify",
testUrl: isNetlifyUrl
};
var NETLIFY_LOADER_REGEX = /https?\:\/\/[^\/]+\.netlify\.app\/.+/;
function isNetlifyUrl(url) {
return NETLIFY_LOADER_REGEX.test(url);
}
function imgDirectiveDetails(ngSrc, includeNgSrc = true) {
const ngSrcInfo = includeNgSrc ? `(activated on an <img> element with the \`ngSrc="${ngSrc}"\`) ` : "";
return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`;
}
function assertDevMode(checkName) {
if (!ngDevMode) {
throw new RuntimeError(2958, `Unexpected invocation of the ${checkName} in the prod mode. Please make sure that the prod mode is enabled for production builds.`);
}
}
var LCPImageObserver = class _LCPImageObserver {
// Map of full image URLs -> original `ngSrc` values.
images = /* @__PURE__ */ new Map();
window = inject2(DOCUMENT).defaultView;
observer = null;
constructor() {
assertDevMode("LCP checker");
if (typeof PerformanceObserver !== "undefined") {
this.observer = this.initPerformanceObserver();
}
}
/**
* Inits PerformanceObserver and subscribes to LCP events.
* Based on https://web.dev/lcp/#measure-lcp-in-javascript
*/
initPerformanceObserver() {
const observer = new PerformanceObserver((entryList) => {
const entries = entryList.getEntries();
if (entries.length === 0) return;
const lcpElement = entries[entries.length - 1];
const imgSrc = lcpElement.element?.src ?? "";
if (imgSrc.startsWith("data:") || imgSrc.startsWith("blob:")) return;
const img = this.images.get(imgSrc);
if (!img) return;
if (!img.priority && !img.alreadyWarnedPriority) {
img.alreadyWarnedPriority = true;
logMissingPriorityError(imgSrc);
}
if (img.modified && !img.alreadyWarnedModified) {
img.alreadyWarnedModified = true;
logModifiedWarning(imgSrc);
}
});
observer.observe({
type: "largest-contentful-paint",
buffered: true
});
return observer;
}
registerImage(rewrittenSrc, originalNgSrc, isPriority) {
if (!this.observer) return;
const newObservedImageState = {
priority: isPriority,
modified: false,
alreadyWarnedModified: false,
alreadyWarnedPriority: false
};
this.images.set(getUrl(rewrittenSrc, this.window).href, newObservedImageState);
}
unregisterImage(rewrittenSrc) {
if (!this.observer) return;
this.images.delete(getUrl(rewrittenSrc, this.window).href);
}
updateImage(originalSrc, newSrc) {
if (!this.observer) return;
const originalUrl = getUrl(originalSrc, this.window).href;
const img = this.images.get(originalUrl);
if (img) {
img.modified = true;
this.images.set(getUrl(newSrc, this.window).href, img);
this.images.delete(originalUrl);
}
}
ngOnDestroy() {
if (!this.observer) return;
this.observer.disconnect();
this.images.clear();
}
static \u0275fac = function LCPImageObserver_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _LCPImageObserver)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _LCPImageObserver,
factory: _LCPImageObserver.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LCPImageObserver, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
function logMissingPriorityError(ngSrc) {
const directiveDetails = imgDirectiveDetails(ngSrc);
console.error(formatRuntimeError(2955, `${directiveDetails} this image is the Largest Contentful Paint (LCP) element but was not marked "priority". This image should be marked "priority" in order to prioritize its loading. To fix this, add the "priority" attribute.`));
}
function logModifiedWarning(ngSrc) {
const directiveDetails = imgDirectiveDetails(ngSrc);
console.warn(formatRuntimeError(2964, `${directiveDetails} this image is the Largest Contentful Paint (LCP) element and has had its "ngSrc" attribute modified. This can cause slower loading performance. It is recommended not to modify the "ngSrc" property on any image which could be the LCP element.`));
}
var INTERNAL_PRECONNECT_CHECK_BLOCKLIST = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "0.0.0.0"]);
var PRECONNECT_CHECK_BLOCKLIST = new InjectionToken(ngDevMode ? "PRECONNECT_CHECK_BLOCKLIST" : "");
var PreconnectLinkChecker = class _PreconnectLinkChecker {
document = inject2(DOCUMENT);
/**
* Set of <link rel="preconnect"> tags found on this page.
* The `null` value indicates that there was no DOM query operation performed.
*/
preconnectLinks = null;
/*
* Keep track of all already seen origin URLs to avoid repeating the same check.
*/
alreadySeen = /* @__PURE__ */ new Set();
window = this.document.defaultView;
blocklist = new Set(INTERNAL_PRECONNECT_CHECK_BLOCKLIST);
constructor() {
assertDevMode("preconnect link checker");
const blocklist = inject2(PRECONNECT_CHECK_BLOCKLIST, {
optional: true
});
if (blocklist) {
this.populateBlocklist(blocklist);
}
}
populateBlocklist(origins) {
if (Array.isArray(origins)) {
deepForEach2(origins, (origin) => {
this.blocklist.add(extractHostname(origin));
});
} else {
this.blocklist.add(extractHostname(origins));
}
}
/**
* Checks that a preconnect resource hint exists in the head for the
* given src.
*
* @param rewrittenSrc src formatted with loader
* @param originalNgSrc ngSrc value
*/
assertPreconnect(rewrittenSrc, originalNgSrc) {
if (false) return;
const imgUrl = getUrl(rewrittenSrc, this.window);
if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin)) return;
this.alreadySeen.add(imgUrl.origin);
this.preconnectLinks ??= this.queryPreconnectLinks();
if (!this.preconnectLinks.has(imgUrl.origin)) {
console.warn(formatRuntimeError(2956, `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this image. Preconnecting to the origin(s) that serve priority images ensures that these images are delivered as soon as possible. To fix this, please add the following element into the <head> of the document:
<link rel="preconnect" href="${imgUrl.origin}">`));
}
}
queryPreconnectLinks() {
const preconnectUrls = /* @__PURE__ */ new Set();
const links = this.document.querySelectorAll("link[rel=preconnect]");
for (const link of links) {
const url = getUrl(link.href, this.window);
preconnectUrls.add(url.origin);
}
return preconnectUrls;
}
ngOnDestroy() {
this.preconnectLinks?.clear();
this.alreadySeen.clear();
}
static \u0275fac = function PreconnectLinkChecker_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _PreconnectLinkChecker)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _PreconnectLinkChecker,
factory: _PreconnectLinkChecker.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PreconnectLinkChecker, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
function deepForEach2(input2, fn) {
for (let value of input2) {
Array.isArray(value) ? deepForEach2(value, fn) : fn(value);
}
}
var DEFAULT_PRELOADED_IMAGES_LIMIT = 5;
var PRELOADED_IMAGES = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "NG_OPTIMIZED_PRELOADED_IMAGES" : "", {
providedIn: "root",
factory: () => /* @__PURE__ */ new Set()
});
var PreloadLinkCreator = class _PreloadLinkCreator {
preloadedImages = inject2(PRELOADED_IMAGES);
document = inject2(DOCUMENT);
errorShown = false;
/**
* @description Add a preload `<link>` to the `<head>` of the `index.html` that is served from the
* server while using Angular Universal and SSR to kick off image loads for high priority images.
*
* The `sizes` (passed in from the user) and `srcset` (parsed and formatted from `ngSrcset`)
* properties used to set the corresponding attributes, `imagesizes` and `imagesrcset`
* respectively, on the preload `<link>` tag so that the correctly sized image is preloaded from
* the CDN.
*
* {@link https://web.dev/preload-responsive-images/#imagesrcset-and-imagesizes}
*
* @param renderer The `Renderer2` passed in from the directive
* @param src The original src of the image that is set on the `ngSrc` input.
* @param srcset The parsed and formatted srcset created from the `ngSrcset` input
* @param sizes The value of the `sizes` attribute passed in to the `<img>` tag
*/
createPreloadLinkTag(renderer, src, srcset, sizes) {
if (ngDevMode && !this.errorShown && this.preloadedImages.size >= DEFAULT_PRELOADED_IMAGES_LIMIT) {
this.errorShown = true;
console.warn(formatRuntimeError(2961, `The \`NgOptimizedImage\` directive has detected that more than ${DEFAULT_PRELOADED_IMAGES_LIMIT} images were marked as priority. This might negatively affect an overall performance of the page. To fix this, remove the "priority" attribute from images with less priority.`));
}
if (this.preloadedImages.has(src)) {
return;
}
this.preloadedImages.add(src);
const preload = renderer.createElement("link");
renderer.setAttribute(preload, "as", "image");
renderer.setAttribute(preload, "href", src);
renderer.setAttribute(preload, "rel", "preload");
renderer.setAttribute(preload, "fetchpriority", "high");
if (sizes) {
renderer.setAttribute(preload, "imageSizes", sizes);
}
if (srcset) {
renderer.setAttribute(preload, "imageSrcset", srcset);
}
renderer.appendChild(this.document.head, preload);
}
static \u0275fac = function PreloadLinkCreator_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _PreloadLinkCreator)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _PreloadLinkCreator,
factory: _PreloadLinkCreator.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PreloadLinkCreator, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], null, null);
})();
var BASE64_IMG_MAX_LENGTH_IN_ERROR = 50;
var VALID_WIDTH_DESCRIPTOR_SRCSET = /^((\s*\d+w\s*(,|$)){1,})$/;
var VALID_DENSITY_DESCRIPTOR_SRCSET = /^((\s*\d+(\.\d+)?x\s*(,|$)){1,})$/;
var ABSOLUTE_SRCSET_DENSITY_CAP = 3;
var RECOMMENDED_SRCSET_DENSITY_CAP = 2;
var DENSITY_SRCSET_MULTIPLIERS = [1, 2];
var VIEWPORT_BREAKPOINT_CUTOFF = 640;
var ASPECT_RATIO_TOLERANCE = 0.1;
var OVERSIZED_IMAGE_TOLERANCE2 = 1e3;
var FIXED_SRCSET_WIDTH_LIMIT = 1920;
var FIXED_SRCSET_HEIGHT_LIMIT = 1080;
var PLACEHOLDER_DIMENSION_LIMIT = 1e3;
var DATA_URL_WARN_LIMIT = 4e3;
var DATA_URL_ERROR_LIMIT = 1e4;
var BUILT_IN_LOADERS = [imgixLoaderInfo, imageKitLoaderInfo, cloudinaryLoaderInfo, netlifyLoaderInfo];
var PRIORITY_COUNT_THRESHOLD = 10;
var IMGS_WITH_PRIORITY_ATTR_COUNT = 0;
var NgOptimizedImage = class _NgOptimizedImage {
imageLoader = inject2(IMAGE_LOADER);
config = processConfig(inject2(IMAGE_CONFIG));
renderer = inject2(Renderer2);
imgElement = inject2(ElementRef).nativeElement;
injector = inject2(Injector);
// An LCP image observer should be injected only in development mode.
// Do not assign it to `null` to avoid having a redundant property in the production bundle.
lcpObserver;
/**
* Calculate the rewritten `src` once and store it.
* This is needed to avoid repetitive calculations and make sure the directive cleanup in the
* `ngOnDestroy` does not rely on the `IMAGE_LOADER` logic (which in turn can rely on some other
* instance that might be already destroyed).
*/
_renderedSrc = null;
/**
* Name of the source image.
* Image name will be processed by the image loader and the final URL will be applied as the `src`
* property of the image.
*/
ngSrc;
/**
* A comma separated list of width or density descriptors.
* The image name will be taken from `ngSrc` and combined with the list of width or density
* descriptors to generate the final `srcset` property of the image.
*
* Example:
* ```html
* <img ngSrc="hello.jpg" ngSrcset="100w, 200w" /> =>
* <img src="path/hello.jpg" srcset="path/hello.jpg?w=100 100w, path/hello.jpg?w=200 200w" />
* ```
*/
ngSrcset;
/**
* The base `sizes` attribute passed through to the `<img>` element.
* Providing sizes causes the image to create an automatic responsive srcset.
*/
sizes;
/**
* For responsive images: the intrinsic width of the image in pixels.
* For fixed size images: the desired rendered width of the image in pixels.
*/
width;
/**
* For responsive images: the intrinsic height of the image in pixels.
* For fixed size images: the desired rendered height of the image in pixels.
*/
height;
/**
* The desired decoding behavior for the image. Defaults to `auto`
* if not explicitly set, matching native browser behavior.
*
* Use `async` to decode the image off the main thread (non-blocking),
* `sync` for immediate decoding (blocking), or `auto` to let the
* browser decide the optimal strategy.
*
* [Spec](https://html.spec.whatwg.org/multipage/images.html#image-decoding-hint)
*/
decoding;
/**
* The desired loading behavior (lazy, eager, or auto). Defaults to `lazy`,
* which is recommended for most images.
*
* Warning: Setting images as loading="eager" or loading="auto" marks them
* as non-priority images and can hurt loading performance. For images which
* may be the LCP element, use the `priority` attribute instead of `loading`.
*/
loading;
/**
* Indicates whether this image should have a high priority.
*/
priority = false;
/**
* Data to pass through to custom loaders.
*/
loaderParams;
/**
* Disables automatic srcset generation for this image.
*/
disableOptimizedSrcset = false;
/**
* Sets the image to "fill mode", which eliminates the height/width requirement and adds
* styles such that the image fills its containing element.
*/
fill = false;
/**
* A URL or data URL for an image to be used as a placeholder while this image loads.
*/
placeholder;
/**
* Configuration object for placeholder settings. Options:
* * blur: Setting this to false disables the automatic CSS blur.
*/
placeholderConfig;
/**
* Value of the `src` attribute if set on the host `<img>` element.
* This input is exclusively read to assert that `src` is not set in conflict
* with `ngSrc` and that images don't start to load until a lazy loading strategy is set.
* @internal
*/
src;
/**
* Value of the `srcset` attribute if set on the host `<img>` element.
* This input is exclusively read to assert that `srcset` is not set in conflict
* with `ngSrcset` and that images don't start to load until a lazy loading strategy is set.
* @internal
*/
srcset;
constructor() {
if (ngDevMode) {
this.lcpObserver = this.injector.get(LCPImageObserver);
const destroyRef = inject2(DestroyRef);
destroyRef.onDestroy(() => {
if (!this.priority && this._renderedSrc !== null) {
this.lcpObserver.unregisterImage(this._renderedSrc);
}
});
}
}
/** @docs-private */
ngOnInit() {
performanceMarkFeature("NgOptimizedImage");
if (ngDevMode) {
const ngZone = this.injector.get(NgZone);
assertNonEmptyInput(this, "ngSrc", this.ngSrc);
assertValidNgSrcset(this, this.ngSrcset);
assertNoConflictingSrc(this);
if (this.ngSrcset) {
assertNoConflictingSrcset(this);
}
assertNotBase64Image(this);
assertNotBlobUrl(this);
if (this.fill) {
assertEmptyWidthAndHeight(this);
ngZone.runOutsideAngular(() => assertNonZeroRenderedHeight(this, this.imgElement, this.renderer));
} else {
assertNonEmptyWidthAndHeight(this);
if (this.height !== void 0) {
assertGreaterThanZero(this, this.height, "height");
}
if (this.width !== void 0) {
assertGreaterThanZero(this, this.width, "width");
}
ngZone.runOutsideAngular(() => assertNoImageDistortion(this, this.imgElement, this.renderer));
}
assertValidLoadingInput(this);
assertValidDecodingInput(this);
if (!this.ngSrcset) {
assertNoComplexSizes(this);
}
assertValidPlaceholder(this, this.imageLoader);
assertNotMissingBuiltInLoader(this.ngSrc, this.imageLoader);
assertNoNgSrcsetWithoutLoader(this, this.imageLoader);
assertNoLoaderParamsWithoutLoader(this, this.imageLoader);
ngZone.runOutsideAngular(() => {
this.lcpObserver.registerImage(this.getRewrittenSrc(), this.ngSrc, this.priority);
});
if (this.priority) {
const checker = this.injector.get(PreconnectLinkChecker);
checker.assertPreconnect(this.getRewrittenSrc(), this.ngSrc);
if (true) {
const applicationRef = this.injector.get(ApplicationRef);
assetPriorityCountBelowThreshold(applicationRef);
}
}
}
if (this.placeholder) {
this.removePlaceholderOnLoad(this.imgElement);
}
this.setHostAttributes();
}
setHostAttributes() {
if (this.fill) {
this.sizes ||= "100vw";
} else {
this.setHostAttribute("width", this.width.toString());
this.setHostAttribute("height", this.height.toString());
}
this.setHostAttribute("loading", this.getLoadingBehavior());
this.setHostAttribute("fetchpriority", this.getFetchPriority());
this.setHostAttribute("decoding", this.getDecoding());
this.setHostAttribute("ng-img", "true");
const rewrittenSrcset = this.updateSrcAndSrcset();
if (this.sizes) {
if (this.getLoadingBehavior() === "lazy") {
this.setHostAttribute("sizes", "auto, " + this.sizes);
} else {
this.setHostAttribute("sizes", this.sizes);
}
} else {
if (this.ngSrcset && VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset) && this.getLoadingBehavior() === "lazy") {
this.setHostAttribute("sizes", "auto, 100vw");
}
}
if (false) {
const preloadLinkCreator = this.injector.get(PreloadLinkCreator);
preloadLinkCreator.createPreloadLinkTag(this.renderer, this.getRewrittenSrc(), rewrittenSrcset, this.sizes);
}
}
/** @docs-private */
ngOnChanges(changes) {
if (ngDevMode) {
assertNoPostInitInputChange(this, changes, ["ngSrcset", "width", "height", "priority", "fill", "loading", "sizes", "loaderParams", "disableOptimizedSrcset"]);
}
if (changes["ngSrc"] && !changes["ngSrc"].isFirstChange()) {
const oldSrc = this._renderedSrc;
this.updateSrcAndSrcset(true);
if (ngDevMode) {
const newSrc = this._renderedSrc;
if (oldSrc && newSrc && oldSrc !== newSrc) {
const ngZone = this.injector.get(NgZone);
ngZone.runOutsideAngular(() => {
this.lcpObserver.updateImage(oldSrc, newSrc);
});
}
}
}
if (ngDevMode && changes["placeholder"]?.currentValue && true && true) {
assertPlaceholderDimensions(this, this.imgElement);
}
}
callImageLoader(configWithoutCustomParams) {
let augmentedConfig = configWithoutCustomParams;
if (this.loaderParams) {
augmentedConfig.loaderParams = this.loaderParams;
}
return this.imageLoader(augmentedConfig);
}
getLoadingBehavior() {
if (!this.priority && this.loading !== void 0) {
return this.loading;
}
return this.priority ? "eager" : "lazy";
}
getFetchPriority() {
return this.priority ? "high" : "auto";
}
getDecoding() {
if (this.priority) {
return "sync";
}
return this.decoding ?? "auto";
}
getRewrittenSrc() {
if (!this._renderedSrc) {
const imgConfig = {
src: this.ngSrc
};
this._renderedSrc = this.callImageLoader(imgConfig);
}
return this._renderedSrc;
}
getRewrittenSrcset() {
const widthSrcSet = VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset);
const finalSrcs = this.ngSrcset.split(",").filter((src) => src !== "").map((srcStr) => {
srcStr = srcStr.trim();
const width = widthSrcSet ? parseFloat(srcStr) : parseFloat(srcStr) * this.width;
return `${this.callImageLoader({
src: this.ngSrc,
width
})} ${srcStr}`;
});
return finalSrcs.join(", ");
}
getAutomaticSrcset() {
if (this.sizes) {
return this.getResponsiveSrcset();
} else {
return this.getFixedSrcset();
}
}
getResponsiveSrcset() {
const {
breakpoints
} = this.config;
let filteredBreakpoints = breakpoints;
if (this.sizes?.trim() === "100vw") {
filteredBreakpoints = breakpoints.filter((bp) => bp >= VIEWPORT_BREAKPOINT_CUTOFF);
}
const finalSrcs = filteredBreakpoints.map((bp) => `${this.callImageLoader({
src: this.ngSrc,
width: bp
})} ${bp}w`);
return finalSrcs.join(", ");
}
updateSrcAndSrcset(forceSrcRecalc = false) {
if (forceSrcRecalc) {
this._renderedSrc = null;
}
const rewrittenSrc = this.getRewrittenSrc();
this.setHostAttribute("src", rewrittenSrc);
let rewrittenSrcset = void 0;
if (this.ngSrcset) {
rewrittenSrcset = this.getRewrittenSrcset();
} else if (this.shouldGenerateAutomaticSrcset()) {
rewrittenSrcset = this.getAutomaticSrcset();
}
if (rewrittenSrcset) {
this.setHostAttribute("srcset", rewrittenSrcset);
}
return rewrittenSrcset;
}
getFixedSrcset() {
const finalSrcs = DENSITY_SRCSET_MULTIPLIERS.map((multiplier) => `${this.callImageLoader({
src: this.ngSrc,
width: this.width * multiplier
})} ${multiplier}x`);
return finalSrcs.join(", ");
}
shouldGenerateAutomaticSrcset() {
let oversizedImage = false;
if (!this.sizes) {
oversizedImage = this.width > FIXED_SRCSET_WIDTH_LIMIT || this.height > FIXED_SRCSET_HEIGHT_LIMIT;
}
return !this.disableOptimizedSrcset && !this.srcset && this.imageLoader !== noopImageLoader && !oversizedImage;
}
/**
* Returns an image url formatted for use with the CSS background-image property. Expects one of:
* * A base64 encoded image, which is wrapped and passed through.
* * A boolean. If true, calls the image loader to generate a small placeholder url.
*/
generatePlaceholder(placeholderInput) {
const {
placeholderResolution
} = this.config;
if (placeholderInput === true) {
return `url(${this.callImageLoader({
src: this.ngSrc,
width: placeholderResolution,
isPlaceholder: true
})})`;
} else if (typeof placeholderInput === "string") {
return `url(${placeholderInput})`;
}
return null;
}
/**
* Determines if blur should be applied, based on an optional boolean
* property `blur` within the optional configuration object `placeholderConfig`.
*/
shouldBlurPlaceholder(placeholderConfig) {
if (!placeholderConfig || !placeholderConfig.hasOwnProperty("blur")) {
return true;
}
return Boolean(placeholderConfig.blur);
}
removePlaceholderOnLoad(img) {
const callback = () => {
const changeDetectorRef = this.injector.get(ChangeDetectorRef);
removeLoadListenerFn();
removeErrorListenerFn();
this.placeholder = false;
changeDetectorRef.markForCheck();
};
const removeLoadListenerFn = this.renderer.listen(img, "load", callback);
const removeErrorListenerFn = this.renderer.listen(img, "error", callback);
callOnLoadIfImageIsLoaded(img, callback);
}
setHostAttribute(name, value) {
this.renderer.setAttribute(this.imgElement, name, value);
}
static \u0275fac = function NgOptimizedImage_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgOptimizedImage)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgOptimizedImage,
selectors: [["img", "ngSrc", ""]],
hostVars: 18,
hostBindings: function NgOptimizedImage_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275styleProp("position", ctx.fill ? "absolute" : null)("width", ctx.fill ? "100%" : null)("height", ctx.fill ? "100%" : null)("inset", ctx.fill ? "0" : null)("background-size", ctx.placeholder ? "cover" : null)("background-position", ctx.placeholder ? "50% 50%" : null)("background-repeat", ctx.placeholder ? "no-repeat" : null)("background-image", ctx.placeholder ? ctx.generatePlaceholder(ctx.placeholder) : null)("filter", ctx.placeholder && ctx.shouldBlurPlaceholder(ctx.placeholderConfig) ? "blur(15px)" : null);
}
},
inputs: {
ngSrc: [2, "ngSrc", "ngSrc", unwrapSafeUrl],
ngSrcset: "ngSrcset",
sizes: "sizes",
width: [2, "width", "width", numberAttribute],
height: [2, "height", "height", numberAttribute],
decoding: "decoding",
loading: "loading",
priority: [2, "priority", "priority", booleanAttribute],
loaderParams: "loaderParams",
disableOptimizedSrcset: [2, "disableOptimizedSrcset", "disableOptimizedSrcset", booleanAttribute],
fill: [2, "fill", "fill", booleanAttribute],
placeholder: [2, "placeholder", "placeholder", booleanOrUrlAttribute],
placeholderConfig: "placeholderConfig",
src: "src",
srcset: "srcset"
},
features: [\u0275\u0275NgOnChangesFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgOptimizedImage, [{
type: Directive,
args: [{
selector: "img[ngSrc]",
host: {
"[style.position]": 'fill ? "absolute" : null',
"[style.width]": 'fill ? "100%" : null',
"[style.height]": 'fill ? "100%" : null',
"[style.inset]": 'fill ? "0" : null',
"[style.background-size]": 'placeholder ? "cover" : null',
"[style.background-position]": 'placeholder ? "50% 50%" : null',
"[style.background-repeat]": 'placeholder ? "no-repeat" : null',
"[style.background-image]": "placeholder ? generatePlaceholder(placeholder) : null",
"[style.filter]": 'placeholder && shouldBlurPlaceholder(placeholderConfig) ? "blur(15px)" : null'
}
}]
}], () => [], {
ngSrc: [{
type: Input,
args: [{
required: true,
transform: unwrapSafeUrl
}]
}],
ngSrcset: [{
type: Input
}],
sizes: [{
type: Input
}],
width: [{
type: Input,
args: [{
transform: numberAttribute
}]
}],
height: [{
type: Input,
args: [{
transform: numberAttribute
}]
}],
decoding: [{
type: Input
}],
loading: [{
type: Input
}],
priority: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
loaderParams: [{
type: Input
}],
disableOptimizedSrcset: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
fill: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
placeholder: [{
type: Input,
args: [{
transform: booleanOrUrlAttribute
}]
}],
placeholderConfig: [{
type: Input
}],
src: [{
type: Input
}],
srcset: [{
type: Input
}]
});
})();
function processConfig(config2) {
let sortedBreakpoints = {};
if (config2.breakpoints) {
sortedBreakpoints.breakpoints = config2.breakpoints.sort((a, b) => a - b);
}
return Object.assign({}, IMAGE_CONFIG_DEFAULTS, config2, sortedBreakpoints);
}
function assertNoConflictingSrc(dir) {
if (dir.src) {
throw new RuntimeError(2950, `${imgDirectiveDetails(dir.ngSrc)} both \`src\` and \`ngSrc\` have been set. Supplying both of these attributes breaks lazy loading. The NgOptimizedImage directive sets \`src\` itself based on the value of \`ngSrc\`. To fix this, please remove the \`src\` attribute.`);
}
}
function assertNoConflictingSrcset(dir) {
if (dir.srcset) {
throw new RuntimeError(2951, `${imgDirectiveDetails(dir.ngSrc)} both \`srcset\` and \`ngSrcset\` have been set. Supplying both of these attributes breaks lazy loading. The NgOptimizedImage directive sets \`srcset\` itself based on the value of \`ngSrcset\`. To fix this, please remove the \`srcset\` attribute.`);
}
}
function assertNotBase64Image(dir) {
let ngSrc = dir.ngSrc.trim();
if (ngSrc.startsWith("data:")) {
if (ngSrc.length > BASE64_IMG_MAX_LENGTH_IN_ERROR) {
ngSrc = ngSrc.substring(0, BASE64_IMG_MAX_LENGTH_IN_ERROR) + "...";
}
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`ngSrc\` is a Base64-encoded string (${ngSrc}). NgOptimizedImage does not support Base64-encoded strings. To fix this, disable the NgOptimizedImage directive for this element by removing \`ngSrc\` and using a standard \`src\` attribute instead.`);
}
}
function assertNoComplexSizes(dir) {
let sizes = dir.sizes;
if (sizes?.match(/((\)|,)\s|^)\d+px/)) {
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`sizes\` was set to a string including pixel values. For automatic \`srcset\` generation, \`sizes\` must only include responsive values, such as \`sizes="50vw"\` or \`sizes="(min-width: 768px) 50vw, 100vw"\`. To fix this, modify the \`sizes\` attribute, or provide your own \`ngSrcset\` value directly.`);
}
}
function assertValidPlaceholder(dir, imageLoader) {
assertNoPlaceholderConfigWithoutPlaceholder(dir);
assertNoRelativePlaceholderWithoutLoader(dir, imageLoader);
assertNoOversizedDataUrl(dir);
}
function assertNoPlaceholderConfigWithoutPlaceholder(dir) {
if (dir.placeholderConfig && !dir.placeholder) {
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`placeholderConfig\` options were provided for an image that does not use the \`placeholder\` attribute, and will have no effect.`);
}
}
function assertNoRelativePlaceholderWithoutLoader(dir, imageLoader) {
if (dir.placeholder === true && imageLoader === noopImageLoader) {
throw new RuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to true but no image loader is configured (i.e. the default one is being used), which would result in the same image being used for the primary image and its placeholder. To fix this, provide a loader or remove the \`placeholder\` attribute from the image.`);
}
}
function assertNoOversizedDataUrl(dir) {
if (dir.placeholder && typeof dir.placeholder === "string" && dir.placeholder.startsWith("data:")) {
if (dir.placeholder.length > DATA_URL_ERROR_LIMIT) {
throw new RuntimeError(2965, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to a data URL which is longer than ${DATA_URL_ERROR_LIMIT} characters. This is strongly discouraged, as large inline placeholders directly increase the bundle size of Angular and hurt page load performance. To fix this, generate a smaller data URL placeholder.`);
}
if (dir.placeholder.length > DATA_URL_WARN_LIMIT) {
console.warn(formatRuntimeError(2965, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to a data URL which is longer than ${DATA_URL_WARN_LIMIT} characters. This is discouraged, as large inline placeholders directly increase the bundle size of Angular and hurt page load performance. For better loading performance, generate a smaller data URL placeholder.`));
}
}
}
function assertNotBlobUrl(dir) {
const ngSrc = dir.ngSrc.trim();
if (ngSrc.startsWith("blob:")) {
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrc\` was set to a blob URL (${ngSrc}). Blob URLs are not supported by the NgOptimizedImage directive. To fix this, disable the NgOptimizedImage directive for this element by removing \`ngSrc\` and using a regular \`src\` attribute instead.`);
}
}
function assertNonEmptyInput(dir, name, value) {
const isString = typeof value === "string";
const isEmptyString = isString && value.trim() === "";
if (!isString || isEmptyString) {
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`${name}\` has an invalid value (\`${value}\`). To fix this, change the value to a non-empty string.`);
}
}
function assertValidNgSrcset(dir, value) {
if (value == null) return;
assertNonEmptyInput(dir, "ngSrcset", value);
const stringVal = value;
const isValidWidthDescriptor = VALID_WIDTH_DESCRIPTOR_SRCSET.test(stringVal);
const isValidDensityDescriptor = VALID_DENSITY_DESCRIPTOR_SRCSET.test(stringVal);
if (isValidDensityDescriptor) {
assertUnderDensityCap(dir, stringVal);
}
const isValidSrcset = isValidWidthDescriptor || isValidDensityDescriptor;
if (!isValidSrcset) {
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrcset\` has an invalid value (\`${value}\`). To fix this, supply \`ngSrcset\` using a comma-separated list of one or more width descriptors (e.g. "100w, 200w") or density descriptors (e.g. "1x, 2x").`);
}
}
function assertUnderDensityCap(dir, value) {
const underDensityCap = value.split(",").every((num) => num === "" || parseFloat(num) <= ABSOLUTE_SRCSET_DENSITY_CAP);
if (!underDensityCap) {
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` contains an unsupported image density:\`${value}\`. NgOptimizedImage generally recommends a max image density of ${RECOMMENDED_SRCSET_DENSITY_CAP}x but supports image densities up to ${ABSOLUTE_SRCSET_DENSITY_CAP}x. The human eye cannot distinguish between image densities greater than ${RECOMMENDED_SRCSET_DENSITY_CAP}x - which makes them unnecessary for most use cases. Images that will be pinch-zoomed are typically the primary use case for ${ABSOLUTE_SRCSET_DENSITY_CAP}x images. Please remove the high density descriptor and try again.`);
}
}
function postInitInputChangeError(dir, inputName) {
let reason;
if (inputName === "width" || inputName === "height") {
reason = `Changing \`${inputName}\` may result in different attribute value applied to the underlying image element and cause layout shifts on a page.`;
} else {
reason = `Changing the \`${inputName}\` would have no effect on the underlying image element, because the resource loading has already occurred.`;
}
return new RuntimeError(2953, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` was updated after initialization. The NgOptimizedImage directive will not react to this input change. ${reason} To fix this, either switch \`${inputName}\` to a static value or wrap the image element in an @if that is gated on the necessary value.`);
}
function assertNoPostInitInputChange(dir, changes, inputs) {
inputs.forEach((input2) => {
const isUpdated = changes.hasOwnProperty(input2);
if (isUpdated && !changes[input2].isFirstChange()) {
if (input2 === "ngSrc") {
dir = {
ngSrc: changes[input2].previousValue
};
}
throw postInitInputChangeError(dir, input2);
}
});
}
function assertGreaterThanZero(dir, inputValue, inputName) {
const validNumber = typeof inputValue === "number" && inputValue > 0;
const validString = typeof inputValue === "string" && /^\d+$/.test(inputValue.trim()) && parseInt(inputValue) > 0;
if (!validNumber && !validString) {
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` has an invalid value. To fix this, provide \`${inputName}\` as a number greater than 0.`);
}
}
function assertNoImageDistortion(dir, img, renderer) {
const callback = () => {
removeLoadListenerFn();
removeErrorListenerFn();
const computedStyle = window.getComputedStyle(img);
let renderedWidth = parseFloat(computedStyle.getPropertyValue("width"));
let renderedHeight = parseFloat(computedStyle.getPropertyValue("height"));
const boxSizing = computedStyle.getPropertyValue("box-sizing");
if (boxSizing === "border-box") {
const paddingTop = computedStyle.getPropertyValue("padding-top");
const paddingRight = computedStyle.getPropertyValue("padding-right");
const paddingBottom = computedStyle.getPropertyValue("padding-bottom");
const paddingLeft = computedStyle.getPropertyValue("padding-left");
renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
}
const renderedAspectRatio = renderedWidth / renderedHeight;
const nonZeroRenderedDimensions = renderedWidth !== 0 && renderedHeight !== 0;
const intrinsicWidth = img.naturalWidth;
const intrinsicHeight = img.naturalHeight;
const intrinsicAspectRatio = intrinsicWidth / intrinsicHeight;
const suppliedWidth = dir.width;
const suppliedHeight = dir.height;
const suppliedAspectRatio = suppliedWidth / suppliedHeight;
const inaccurateDimensions = Math.abs(suppliedAspectRatio - intrinsicAspectRatio) > ASPECT_RATIO_TOLERANCE;
const stylingDistortion = nonZeroRenderedDimensions && Math.abs(intrinsicAspectRatio - renderedAspectRatio) > ASPECT_RATIO_TOLERANCE;
if (inaccurateDimensions) {
console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the image does not match the aspect ratio indicated by the width and height attributes.
Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h (aspect-ratio: ${round(intrinsicAspectRatio)}).
Supplied width and height attributes: ${suppliedWidth}w x ${suppliedHeight}h (aspect-ratio: ${round(suppliedAspectRatio)}).
To fix this, update the width and height attributes.`));
} else if (stylingDistortion) {
console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the rendered image does not match the image's intrinsic aspect ratio.
Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h (aspect-ratio: ${round(intrinsicAspectRatio)}).
Rendered image size: ${renderedWidth}w x ${renderedHeight}h (aspect-ratio: ${round(renderedAspectRatio)}).
This issue can occur if "width" and "height" attributes are added to an image without updating the corresponding image styling. To fix this, adjust image styling. In most cases, adding "height: auto" or "width: auto" to the image styling will fix this issue.`));
} else if (!dir.ngSrcset && nonZeroRenderedDimensions) {
const recommendedWidth = RECOMMENDED_SRCSET_DENSITY_CAP * renderedWidth;
const recommendedHeight = RECOMMENDED_SRCSET_DENSITY_CAP * renderedHeight;
const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE2;
const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE2;
if (oversizedWidth || oversizedHeight) {
console.warn(formatRuntimeError(2960, `${imgDirectiveDetails(dir.ngSrc)} the intrinsic image is significantly larger than necessary.
Rendered image size: ${renderedWidth}w x ${renderedHeight}h.
Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h.
Recommended intrinsic image size: ${recommendedWidth}w x ${recommendedHeight}h.
Note: Recommended intrinsic image size is calculated assuming a maximum DPR of ${RECOMMENDED_SRCSET_DENSITY_CAP}. To improve loading time, resize the image or consider using the "ngSrcset" and "sizes" attributes.`));
}
}
};
const removeLoadListenerFn = renderer.listen(img, "load", callback);
const removeErrorListenerFn = renderer.listen(img, "error", () => {
removeLoadListenerFn();
removeErrorListenerFn();
});
callOnLoadIfImageIsLoaded(img, callback);
}
function assertNonEmptyWidthAndHeight(dir) {
let missingAttributes = [];
if (dir.width === void 0) missingAttributes.push("width");
if (dir.height === void 0) missingAttributes.push("height");
if (missingAttributes.length > 0) {
throw new RuntimeError(2954, `${imgDirectiveDetails(dir.ngSrc)} these required attributes are missing: ${missingAttributes.map((attr) => `"${attr}"`).join(", ")}. Including "width" and "height" attributes will prevent image-related layout shifts. To fix this, include "width" and "height" attributes on the image tag or turn on "fill" mode with the \`fill\` attribute.`);
}
}
function assertEmptyWidthAndHeight(dir) {
if (dir.width || dir.height) {
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the attributes \`height\` and/or \`width\` are present along with the \`fill\` attribute. Because \`fill\` mode causes an image to fill its containing element, the size attributes have no effect and should be removed.`);
}
}
function assertNonZeroRenderedHeight(dir, img, renderer) {
const callback = () => {
removeLoadListenerFn();
removeErrorListenerFn();
const renderedHeight = img.clientHeight;
if (dir.fill && renderedHeight === 0) {
console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the height of the fill-mode image is zero. This is likely because the containing element does not have the CSS 'position' property set to one of the following: "relative", "fixed", or "absolute". To fix this problem, make sure the container element has the CSS 'position' property defined and the height of the element is not zero.`));
}
};
const removeLoadListenerFn = renderer.listen(img, "load", callback);
const removeErrorListenerFn = renderer.listen(img, "error", () => {
removeLoadListenerFn();
removeErrorListenerFn();
});
callOnLoadIfImageIsLoaded(img, callback);
}
function assertValidLoadingInput(dir) {
if (dir.loading && dir.priority) {
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute was used on an image that was marked "priority". Setting \`loading\` on priority images is not allowed because these images will always be eagerly loaded. To fix this, remove the \u201Cloading\u201D attribute from the priority image.`);
}
const validInputs = ["auto", "eager", "lazy"];
if (typeof dir.loading === "string" && !validInputs.includes(dir.loading)) {
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute has an invalid value (\`${dir.loading}\`). To fix this, provide a valid value ("lazy", "eager", or "auto").`);
}
}
function assertValidDecodingInput(dir) {
const validInputs = ["sync", "async", "auto"];
if (typeof dir.decoding === "string" && !validInputs.includes(dir.decoding)) {
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`decoding\` attribute has an invalid value (\`${dir.decoding}\`). To fix this, provide a valid value ("sync", "async", or "auto").`);
}
}
function assertNotMissingBuiltInLoader(ngSrc, imageLoader) {
if (imageLoader === noopImageLoader) {
let builtInLoaderName = "";
for (const loader of BUILT_IN_LOADERS) {
if (loader.testUrl(ngSrc)) {
builtInLoaderName = loader.name;
break;
}
}
if (builtInLoaderName) {
console.warn(formatRuntimeError(2962, `NgOptimizedImage: It looks like your images may be hosted on the ${builtInLoaderName} CDN, but your app is not using Angular's built-in loader for that CDN. We recommend switching to use the built-in by calling \`provide${builtInLoaderName}Loader()\` in your \`providers\` and passing it your instance's base URL. If you don't want to use the built-in loader, define a custom loader function using IMAGE_LOADER to silence this warning.`));
}
}
}
function assertNoNgSrcsetWithoutLoader(dir, imageLoader) {
if (dir.ngSrcset && imageLoader === noopImageLoader) {
console.warn(formatRuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` attribute is present but no image loader is configured (i.e. the default one is being used), which would result in the same image being used for all configured sizes. To fix this, provide a loader or remove the \`ngSrcset\` attribute from the image.`));
}
}
function assertNoLoaderParamsWithoutLoader(dir, imageLoader) {
if (dir.loaderParams && imageLoader === noopImageLoader) {
console.warn(formatRuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`loaderParams\` attribute is present but no image loader is configured (i.e. the default one is being used), which means that the loaderParams data will not be consumed and will not affect the URL. To fix this, provide a custom loader or remove the \`loaderParams\` attribute from the image.`));
}
}
async function assetPriorityCountBelowThreshold(appRef) {
if (IMGS_WITH_PRIORITY_ATTR_COUNT === 0) {
IMGS_WITH_PRIORITY_ATTR_COUNT++;
await appRef.whenStable();
if (IMGS_WITH_PRIORITY_ATTR_COUNT > PRIORITY_COUNT_THRESHOLD) {
console.warn(formatRuntimeError(2966, `NgOptimizedImage: The "priority" attribute is set to true more than ${PRIORITY_COUNT_THRESHOLD} times (${IMGS_WITH_PRIORITY_ATTR_COUNT} times). Marking too many images as "high" priority can hurt your application's LCP (https://web.dev/lcp). "Priority" should only be set on the image expected to be the page's LCP element.`));
}
} else {
IMGS_WITH_PRIORITY_ATTR_COUNT++;
}
}
function assertPlaceholderDimensions(dir, imgElement) {
const computedStyle = window.getComputedStyle(imgElement);
let renderedWidth = parseFloat(computedStyle.getPropertyValue("width"));
let renderedHeight = parseFloat(computedStyle.getPropertyValue("height"));
if (renderedWidth > PLACEHOLDER_DIMENSION_LIMIT || renderedHeight > PLACEHOLDER_DIMENSION_LIMIT) {
console.warn(formatRuntimeError(2967, `${imgDirectiveDetails(dir.ngSrc)} it uses a placeholder image, but at least one of the dimensions attribute (height or width) exceeds the limit of ${PLACEHOLDER_DIMENSION_LIMIT}px. To fix this, use a smaller image as a placeholder.`));
}
}
function callOnLoadIfImageIsLoaded(img, callback) {
if (img.complete && img.naturalWidth) {
callback();
}
}
function round(input2) {
return Number.isInteger(input2) ? input2 : input2.toFixed(2);
}
function unwrapSafeUrl(value) {
if (typeof value === "string") {
return value;
}
return unwrapSafeValue(value);
}
function booleanOrUrlAttribute(value) {
if (typeof value === "string" && value !== "true" && value !== "false" && value !== "") {
return value;
}
return booleanAttribute(value);
}
// node_modules/.pnpm/@angular+platform-browser@20.2.1_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compile_b4fkdnyec4c2x5ti6yyl4kmq7u/node_modules/@angular/platform-browser/fesm2022/dom_renderer.mjs
var EVENT_MANAGER_PLUGINS = new InjectionToken(ngDevMode ? "EventManagerPlugins" : "");
var EventManager = class _EventManager {
_zone;
_plugins;
_eventNameToPlugin = /* @__PURE__ */ new Map();
/**
* Initializes an instance of the event-manager service.
*/
constructor(plugins, _zone) {
this._zone = _zone;
plugins.forEach((plugin) => {
plugin.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.
* @param options Options that configure how the event listener is bound.
* @returns A callback function that can be used to remove the handler.
*/
addEventListener(element, eventName, handler, options) {
const plugin = this._findPluginFor(eventName);
return plugin.addEventListener(element, eventName, handler, options);
}
/**
* Retrieves the compilation zone in which event listeners are registered.
*/
getZone() {
return this._zone;
}
/** @internal */
_findPluginFor(eventName) {
let plugin = this._eventNameToPlugin.get(eventName);
if (plugin) {
return plugin;
}
const plugins = this._plugins;
plugin = plugins.find((plugin2) => plugin2.supports(eventName));
if (!plugin) {
throw new RuntimeError(5101, (typeof ngDevMode === "undefined" || ngDevMode) && `No event manager plugin found for event ${eventName}`);
}
this._eventNameToPlugin.set(eventName, plugin);
return plugin;
}
static \u0275fac = function EventManager_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _EventManager)(\u0275\u0275inject(EVENT_MANAGER_PLUGINS), \u0275\u0275inject(NgZone));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _EventManager,
factory: _EventManager.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(EventManager, [{
type: Injectable
}], () => [{
type: void 0,
decorators: [{
type: Inject,
args: [EVENT_MANAGER_PLUGINS]
}]
}, {
type: NgZone
}], null);
})();
var EventManagerPlugin = class {
_doc;
// TODO: remove (has some usage in G3)
constructor(_doc) {
this._doc = _doc;
}
// Using non-null assertion because it's set by EventManager's constructor
manager;
};
var APP_ID_ATTRIBUTE_NAME = "ng-app-id";
function removeElements(elements) {
for (const element of elements) {
element.remove();
}
}
function createStyleElement(style, doc) {
const styleElement = doc.createElement("style");
styleElement.textContent = style;
return styleElement;
}
function addServerStyles(doc, appId, inline, external) {
const elements = doc.head?.querySelectorAll(`style[${APP_ID_ATTRIBUTE_NAME}="${appId}"],link[${APP_ID_ATTRIBUTE_NAME}="${appId}"]`);
if (elements) {
for (const styleElement of elements) {
styleElement.removeAttribute(APP_ID_ATTRIBUTE_NAME);
if (styleElement instanceof HTMLLinkElement) {
external.set(styleElement.href.slice(styleElement.href.lastIndexOf("/") + 1), {
usage: 0,
elements: [styleElement]
});
} else if (styleElement.textContent) {
inline.set(styleElement.textContent, {
usage: 0,
elements: [styleElement]
});
}
}
}
}
function createLinkElement(url, doc) {
const linkElement = doc.createElement("link");
linkElement.setAttribute("rel", "stylesheet");
linkElement.setAttribute("href", url);
return linkElement;
}
var SharedStylesHost = class _SharedStylesHost {
doc;
appId;
nonce;
/**
* Provides usage information for active inline style content and associated HTML <style> elements.
* Embedded styles typically originate from the `styles` metadata of a rendered component.
*/
inline = /* @__PURE__ */ new Map();
/**
* Provides usage information for active external style URLs and the associated HTML <link> elements.
* External styles typically originate from the `ɵɵExternalStylesFeature` of a rendered component.
*/
external = /* @__PURE__ */ new Map();
/**
* Set of host DOM nodes that will have styles attached.
*/
hosts = /* @__PURE__ */ new Set();
constructor(doc, appId, nonce, platformId = {}) {
this.doc = doc;
this.appId = appId;
this.nonce = nonce;
addServerStyles(doc, appId, this.inline, this.external);
this.hosts.add(doc.head);
}
/**
* Adds embedded styles to the DOM via HTML `style` elements.
* @param styles An array of style content strings.
*/
addStyles(styles, urls) {
for (const value of styles) {
this.addUsage(value, this.inline, createStyleElement);
}
urls?.forEach((value) => this.addUsage(value, this.external, createLinkElement));
}
/**
* Removes embedded styles from the DOM that were added as HTML `style` elements.
* @param styles An array of style content strings.
*/
removeStyles(styles, urls) {
for (const value of styles) {
this.removeUsage(value, this.inline);
}
urls?.forEach((value) => this.removeUsage(value, this.external));
}
addUsage(value, usages, creator) {
const record = usages.get(value);
if (record) {
if ((typeof ngDevMode === "undefined" || ngDevMode) && record.usage === 0) {
record.elements.forEach((element) => element.setAttribute("ng-style-reused", ""));
}
record.usage++;
} else {
usages.set(value, {
usage: 1,
elements: [...this.hosts].map((host) => this.addElement(host, creator(value, this.doc)))
});
}
}
removeUsage(value, usages) {
const record = usages.get(value);
if (record) {
record.usage--;
if (record.usage <= 0) {
removeElements(record.elements);
usages.delete(value);
}
}
}
ngOnDestroy() {
for (const [, {
elements
}] of [...this.inline, ...this.external]) {
removeElements(elements);
}
this.hosts.clear();
}
/**
* Adds a host node to the set of style hosts and adds all existing style usage to
* the newly added host node.
*
* This is currently only used for Shadow DOM encapsulation mode.
*/
addHost(hostNode) {
this.hosts.add(hostNode);
for (const [style, {
elements
}] of this.inline) {
elements.push(this.addElement(hostNode, createStyleElement(style, this.doc)));
}
for (const [url, {
elements
}] of this.external) {
elements.push(this.addElement(hostNode, createLinkElement(url, this.doc)));
}
}
removeHost(hostNode) {
this.hosts.delete(hostNode);
}
addElement(host, element) {
if (this.nonce) {
element.setAttribute("nonce", this.nonce);
}
if (false) {
element.setAttribute(APP_ID_ATTRIBUTE_NAME, this.appId);
}
return host.appendChild(element);
}
static \u0275fac = function SharedStylesHost_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _SharedStylesHost)(\u0275\u0275inject(DOCUMENT), \u0275\u0275inject(APP_ID), \u0275\u0275inject(CSP_NONCE, 8), \u0275\u0275inject(PLATFORM_ID));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _SharedStylesHost,
factory: _SharedStylesHost.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SharedStylesHost, [{
type: Injectable
}], () => [{
type: Document,
decorators: [{
type: Inject,
args: [DOCUMENT]
}]
}, {
type: void 0,
decorators: [{
type: Inject,
args: [APP_ID]
}]
}, {
type: void 0,
decorators: [{
type: Inject,
args: [CSP_NONCE]
}, {
type: Optional
}]
}, {
type: void 0,
decorators: [{
type: Inject,
args: [PLATFORM_ID]
}]
}], null);
})();
var 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/Math/MathML"
};
var COMPONENT_REGEX = /%COMP%/g;
var SOURCEMAP_URL_REGEXP = /\/\*#\s*sourceMappingURL=(.+?)\s*\*\//;
var PROTOCOL_REGEXP = /^https?:/;
var COMPONENT_VARIABLE = "%COMP%";
var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
var CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
var REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT = true;
var REMOVE_STYLES_ON_COMPONENT_DESTROY = new InjectionToken(ngDevMode ? "RemoveStylesOnCompDestroy" : "", {
providedIn: "root",
factory: () => REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT
});
function shimContentAttribute(componentShortId) {
return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);
}
function shimHostAttribute(componentShortId) {
return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);
}
function shimStylesContent(compId, styles) {
return styles.map((s) => s.replace(COMPONENT_REGEX, compId));
}
function addBaseHrefToCssSourceMap(baseHref, styles) {
if (!baseHref) {
return styles;
}
const absoluteBaseHrefUrl = new URL(baseHref, "http://localhost");
return styles.map((cssContent) => {
if (!cssContent.includes("sourceMappingURL=")) {
return cssContent;
}
return cssContent.replace(SOURCEMAP_URL_REGEXP, (_, sourceMapUrl) => {
if (sourceMapUrl[0] === "/" || sourceMapUrl.startsWith("data:") || PROTOCOL_REGEXP.test(sourceMapUrl)) {
return `/*# sourceMappingURL=${sourceMapUrl} */`;
}
const {
pathname: resolvedSourceMapUrl
} = new URL(sourceMapUrl, absoluteBaseHrefUrl);
return `/*# sourceMappingURL=${resolvedSourceMapUrl} */`;
});
});
}
var DomRendererFactory2 = class _DomRendererFactory2 {
eventManager;
sharedStylesHost;
appId;
removeStylesOnCompDestroy;
doc;
platformId;
ngZone;
nonce;
animationDisabled;
maxAnimationTimeout;
tracingService;
rendererByCompId = /* @__PURE__ */ new Map();
defaultRenderer;
platformIsServer;
registry;
constructor(eventManager, sharedStylesHost, appId, removeStylesOnCompDestroy, doc, platformId, ngZone, nonce = null, animationDisabled, maxAnimationTimeout, tracingService = null) {
this.eventManager = eventManager;
this.sharedStylesHost = sharedStylesHost;
this.appId = appId;
this.removeStylesOnCompDestroy = removeStylesOnCompDestroy;
this.doc = doc;
this.platformId = platformId;
this.ngZone = ngZone;
this.nonce = nonce;
this.animationDisabled = animationDisabled;
this.maxAnimationTimeout = maxAnimationTimeout;
this.tracingService = tracingService;
this.platformIsServer = false;
this.defaultRenderer = new DefaultDomRenderer2(eventManager, doc, ngZone, this.platformIsServer, this.tracingService, this.registry = getAnimationElementRemovalRegistry(), this.maxAnimationTimeout);
}
createRenderer(element, type) {
if (!element || !type) {
return this.defaultRenderer;
}
if (false) {
type = __spreadProps(__spreadValues({}, type), {
encapsulation: ViewEncapsulation.Emulated
});
}
const renderer = this.getOrCreateRenderer(element, type);
if (renderer instanceof EmulatedEncapsulationDomRenderer2) {
renderer.applyToHost(element);
} else if (renderer instanceof NoneEncapsulationDomRenderer) {
renderer.applyStyles();
}
return renderer;
}
getOrCreateRenderer(element, type) {
const rendererByCompId = this.rendererByCompId;
let renderer = rendererByCompId.get(type.id);
if (!renderer) {
const doc = this.doc;
const ngZone = this.ngZone;
const eventManager = this.eventManager;
const sharedStylesHost = this.sharedStylesHost;
const removeStylesOnCompDestroy = this.removeStylesOnCompDestroy;
const platformIsServer = this.platformIsServer;
const tracingService = this.tracingService;
switch (type.encapsulation) {
case ViewEncapsulation.Emulated:
renderer = new EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, type, this.appId, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService, this.registry, this.animationDisabled, this.maxAnimationTimeout);
break;
case ViewEncapsulation.ShadowDom:
return new ShadowDomRenderer(eventManager, sharedStylesHost, element, type, doc, ngZone, this.nonce, platformIsServer, tracingService, this.registry, this.maxAnimationTimeout);
default:
renderer = new NoneEncapsulationDomRenderer(eventManager, sharedStylesHost, type, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService, this.registry, this.animationDisabled, this.maxAnimationTimeout);
break;
}
rendererByCompId.set(type.id, renderer);
}
return renderer;
}
ngOnDestroy() {
this.rendererByCompId.clear();
}
/**
* Used during HMR to clear any cached data about a component.
* @param componentId ID of the component that is being replaced.
*/
componentReplaced(componentId) {
this.rendererByCompId.delete(componentId);
}
static \u0275fac = function DomRendererFactory2_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _DomRendererFactory2)(\u0275\u0275inject(EventManager), \u0275\u0275inject(SharedStylesHost), \u0275\u0275inject(APP_ID), \u0275\u0275inject(REMOVE_STYLES_ON_COMPONENT_DESTROY), \u0275\u0275inject(DOCUMENT), \u0275\u0275inject(PLATFORM_ID), \u0275\u0275inject(NgZone), \u0275\u0275inject(CSP_NONCE), \u0275\u0275inject(ANIMATIONS_DISABLED), \u0275\u0275inject(MAX_ANIMATION_TIMEOUT), \u0275\u0275inject(TracingService, 8));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _DomRendererFactory2,
factory: _DomRendererFactory2.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DomRendererFactory2, [{
type: Injectable
}], () => [{
type: EventManager
}, {
type: SharedStylesHost
}, {
type: void 0,
decorators: [{
type: Inject,
args: [APP_ID]
}]
}, {
type: void 0,
decorators: [{
type: Inject,
args: [REMOVE_STYLES_ON_COMPONENT_DESTROY]
}]
}, {
type: Document,
decorators: [{
type: Inject,
args: [DOCUMENT]
}]
}, {
type: Object,
decorators: [{
type: Inject,
args: [PLATFORM_ID]
}]
}, {
type: NgZone
}, {
type: void 0,
decorators: [{
type: Inject,
args: [CSP_NONCE]
}]
}, {
type: void 0,
decorators: [{
type: Inject,
args: [ANIMATIONS_DISABLED]
}]
}, {
type: void 0,
decorators: [{
type: Inject,
args: [MAX_ANIMATION_TIMEOUT]
}]
}, {
type: TracingService,
decorators: [{
type: Inject,
args: [TracingService]
}, {
type: Optional
}]
}], null);
})();
var DefaultDomRenderer2 = class {
eventManager;
doc;
ngZone;
platformIsServer;
tracingService;
registry;
maxAnimationTimeout;
data = /* @__PURE__ */ Object.create(null);
/**
* By default this renderer throws when encountering synthetic properties
* This can be disabled for example by the AsyncAnimationRendererFactory
*/
throwOnSyntheticProps = true;
constructor(eventManager, doc, ngZone, platformIsServer, tracingService, registry2, maxAnimationTimeout) {
this.eventManager = eventManager;
this.doc = doc;
this.ngZone = ngZone;
this.platformIsServer = platformIsServer;
this.tracingService = tracingService;
this.registry = registry2;
this.maxAnimationTimeout = maxAnimationTimeout;
}
destroy() {
}
destroyNode = null;
createElement(name, namespace) {
if (namespace) {
return this.doc.createElementNS(NAMESPACE_URIS[namespace] || namespace, name);
}
return this.doc.createElement(name);
}
createComment(value) {
return this.doc.createComment(value);
}
createText(value) {
return this.doc.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) {
const {
elements
} = this.registry;
if (elements) {
elements.animate(oldChild, () => oldChild.remove(), this.maxAnimationTimeout);
return;
}
oldChild.remove();
}
selectRootElement(selectorOrNode, preserveContent) {
let el = typeof selectorOrNode === "string" ? this.doc.querySelector(selectorOrNode) : selectorOrNode;
if (!el) {
throw new RuntimeError(-5104, (typeof ngDevMode === "undefined" || ngDevMode) && `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 & (RendererStyleFlags2.DashCase | RendererStyleFlags2.Important)) {
el.style.setProperty(style, value, flags & RendererStyleFlags2.Important ? "important" : "");
} else {
el.style[style] = value;
}
}
removeStyle(el, style, flags) {
if (flags & RendererStyleFlags2.DashCase) {
el.style.removeProperty(style);
} else {
el.style[style] = "";
}
}
setProperty(el, name, value) {
if (el == null) {
return;
}
(typeof ngDevMode === "undefined" || ngDevMode) && this.throwOnSyntheticProps && checkNoSyntheticProp(name, "property");
el[name] = value;
}
setValue(node, value) {
node.nodeValue = value;
}
listen(target, event, callback, options) {
(typeof ngDevMode === "undefined" || ngDevMode) && this.throwOnSyntheticProps && checkNoSyntheticProp(event, "listener");
if (typeof target === "string") {
target = getDOM().getGlobalEventTarget(this.doc, target);
if (!target) {
throw new RuntimeError(5102, (typeof ngDevMode === "undefined" || ngDevMode) && `Unsupported event target ${target} for event ${event}`);
}
}
let wrappedCallback = this.decoratePreventDefault(callback);
if (this.tracingService?.wrapEventListener) {
wrappedCallback = this.tracingService.wrapEventListener(target, event, wrappedCallback);
}
return this.eventManager.addEventListener(target, event, wrappedCallback, options);
}
decoratePreventDefault(eventHandler) {
return (event) => {
if (event === "__ngUnwrap__") {
return eventHandler;
}
const allowDefaultBehavior = false ? this.ngZone.runGuarded(() => eventHandler(event)) : eventHandler(event);
if (allowDefaultBehavior === false) {
event.preventDefault();
}
return void 0;
};
}
};
var AT_CHARCODE = (() => "@".charCodeAt(0))();
function checkNoSyntheticProp(name, nameKind) {
if (name.charCodeAt(0) === AT_CHARCODE) {
throw new RuntimeError(5105, `Unexpected synthetic ${nameKind} ${name} found. Please make sure that:
- Make sure \`provideAnimationsAsync()\`, \`provideAnimations()\` or \`provideNoopAnimations()\` call was added to a list of providers used to bootstrap an application.
- There is a corresponding animation configuration named \`${name}\` defined in the \`animations\` field of the \`@Component\` decorator (see https://angular.dev/api/core/Component#animations).`);
}
}
function isTemplateNode(node) {
return node.tagName === "TEMPLATE" && node.content !== void 0;
}
var ShadowDomRenderer = class extends DefaultDomRenderer2 {
sharedStylesHost;
hostEl;
shadowRoot;
constructor(eventManager, sharedStylesHost, hostEl, component, doc, ngZone, nonce, platformIsServer, tracingService, registry2, maxAnimationTimeout) {
super(eventManager, doc, ngZone, platformIsServer, tracingService, registry2, maxAnimationTimeout);
this.sharedStylesHost = sharedStylesHost;
this.hostEl = hostEl;
this.shadowRoot = hostEl.attachShadow({
mode: "open"
});
this.sharedStylesHost.addHost(this.shadowRoot);
let styles = component.styles;
if (ngDevMode) {
const baseHref = getDOM().getBaseHref(doc) ?? "";
styles = addBaseHrefToCssSourceMap(baseHref, styles);
}
styles = shimStylesContent(component.id, styles);
for (const style of styles) {
const styleEl = document.createElement("style");
if (nonce) {
styleEl.setAttribute("nonce", nonce);
}
styleEl.textContent = style;
this.shadowRoot.appendChild(styleEl);
}
const styleUrls = component.getExternalStyles?.();
if (styleUrls) {
for (const styleUrl of styleUrls) {
const linkEl = createLinkElement(styleUrl, doc);
if (nonce) {
linkEl.setAttribute("nonce", nonce);
}
this.shadowRoot.appendChild(linkEl);
}
}
}
nodeOrShadowRoot(node) {
return node === this.hostEl ? this.shadowRoot : node;
}
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(null, oldChild);
}
parentNode(node) {
return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(node)));
}
destroy() {
this.sharedStylesHost.removeHost(this.shadowRoot);
}
};
var NoneEncapsulationDomRenderer = class extends DefaultDomRenderer2 {
sharedStylesHost;
removeStylesOnCompDestroy;
styles;
styleUrls;
_animationDisabled;
constructor(eventManager, sharedStylesHost, component, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService, registry2, animationDisabled, maxAnimationTimeout, compId) {
super(eventManager, doc, ngZone, platformIsServer, tracingService, registry2, maxAnimationTimeout);
this.sharedStylesHost = sharedStylesHost;
this.removeStylesOnCompDestroy = removeStylesOnCompDestroy;
this._animationDisabled = animationDisabled;
let styles = component.styles;
if (ngDevMode) {
const baseHref = getDOM().getBaseHref(doc) ?? "";
styles = addBaseHrefToCssSourceMap(baseHref, styles);
}
this.styles = compId ? shimStylesContent(compId, styles) : styles;
this.styleUrls = component.getExternalStyles?.(compId);
}
applyStyles() {
this.sharedStylesHost.addStyles(this.styles, this.styleUrls);
}
destroy() {
if (!this.removeStylesOnCompDestroy) {
return;
}
if (!this._animationDisabled && this.registry.elements) {
this.ngZone.runOutsideAngular(() => {
setTimeout(() => {
this.sharedStylesHost.removeStyles(this.styles, this.styleUrls);
}, this.maxAnimationTimeout);
});
return;
}
this.sharedStylesHost.removeStyles(this.styles, this.styleUrls);
}
};
var EmulatedEncapsulationDomRenderer2 = class extends NoneEncapsulationDomRenderer {
contentAttr;
hostAttr;
constructor(eventManager, sharedStylesHost, component, appId, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService, registry2, animationDisabled, maxAnimationTimeout) {
const compId = appId + "-" + component.id;
super(eventManager, sharedStylesHost, component, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService, registry2, animationDisabled, maxAnimationTimeout, compId);
this.contentAttr = shimContentAttribute(compId);
this.hostAttr = shimHostAttribute(compId);
}
applyToHost(element) {
this.applyStyles();
this.setAttribute(element, this.hostAttr, "");
}
createElement(parent, name) {
const el = super.createElement(parent, name);
super.setAttribute(el, this.contentAttr, "");
return el;
}
};
// node_modules/.pnpm/@angular+platform-browser@20.2.1_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compile_b4fkdnyec4c2x5ti6yyl4kmq7u/node_modules/@angular/platform-browser/fesm2022/browser.mjs
var BrowserDomAdapter = class _BrowserDomAdapter extends DomAdapter {
supportsDOMEvents = true;
static makeCurrent() {
setRootDomAdapter(new _BrowserDomAdapter());
}
onAndCancel(el, evt, listener, options) {
el.addEventListener(evt, listener, options);
return () => {
el.removeEventListener(evt, listener, options);
};
}
dispatchEvent(el, evt) {
el.dispatchEvent(evt);
}
remove(node) {
node.remove();
}
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 parseCookieValue(document.cookie, name);
}
};
var baseElement = null;
function getBaseElementHref() {
baseElement = baseElement || document.head.querySelector("base");
return baseElement ? baseElement.getAttribute("href") : null;
}
function relativePath(url) {
return new URL(url, document.baseURI).pathname;
}
var BrowserGetTestability = class {
addToWindow(registry2) {
_global["getAngularTestability"] = (elem, findInAncestors = true) => {
const testability = registry2.findTestabilityInTree(elem, findInAncestors);
if (testability == null) {
throw new RuntimeError(5103, (typeof ngDevMode === "undefined" || ngDevMode) && "Could not find testability for element.");
}
return testability;
};
_global["getAllAngularTestabilities"] = () => registry2.getAllTestabilities();
_global["getAllAngularRootElements"] = () => registry2.getAllRootElements();
const whenAllStable = (callback) => {
const testabilities = _global["getAllAngularTestabilities"]();
let count = testabilities.length;
const decrement = function() {
count--;
if (count == 0) {
callback();
}
};
testabilities.forEach((testability) => {
testability.whenStable(decrement);
});
};
if (!_global["frameworkStabilizers"]) {
_global["frameworkStabilizers"] = [];
}
_global["frameworkStabilizers"].push(whenAllStable);
}
findTestabilityInTree(registry2, elem, findInAncestors) {
if (elem == null) {
return null;
}
const t = registry2.getTestability(elem);
if (t != null) {
return t;
} else if (!findInAncestors) {
return null;
}
if (getDOM().isShadowRoot(elem)) {
return this.findTestabilityInTree(registry2, elem.host, true);
}
return this.findTestabilityInTree(registry2, elem.parentElement, true);
}
};
var BrowserXhr = class _BrowserXhr {
build() {
return new XMLHttpRequest();
}
static \u0275fac = function BrowserXhr_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _BrowserXhr)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _BrowserXhr,
factory: _BrowserXhr.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BrowserXhr, [{
type: Injectable
}], null, null);
})();
var DomEventsPlugin = 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, options) {
element.addEventListener(eventName, handler, options);
return () => this.removeEventListener(element, eventName, handler, options);
}
removeEventListener(target, eventName, callback, options) {
return target.removeEventListener(eventName, callback, options);
}
static \u0275fac = function DomEventsPlugin_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _DomEventsPlugin)(\u0275\u0275inject(DOCUMENT));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _DomEventsPlugin,
factory: _DomEventsPlugin.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DomEventsPlugin, [{
type: Injectable
}], () => [{
type: void 0,
decorators: [{
type: Inject,
args: [DOCUMENT]
}]
}], null);
})();
var MODIFIER_KEYS = ["alt", "control", "meta", "shift"];
var _keyMap = {
"\b": "Backspace",
" ": "Tab",
"\x7F": "Delete",
"\x1B": "Escape",
"Del": "Delete",
"Esc": "Escape",
"Left": "ArrowLeft",
"Right": "ArrowRight",
"Up": "ArrowUp",
"Down": "ArrowDown",
"Menu": "ContextMenu",
"Scroll": "ScrollLock",
"Win": "OS"
};
var MODIFIER_KEY_GETTERS = {
"alt": (event) => event.altKey,
"control": (event) => event.ctrlKey,
"meta": (event) => event.metaKey,
"shift": (event) => event.shiftKey
};
var KeyEventsPlugin = 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, options) {
const parsedEvent = _KeyEventsPlugin.parseEventName(eventName);
const outsideHandler = _KeyEventsPlugin.eventCallback(parsedEvent["fullKey"], handler, this.manager.getZone());
return this.manager.getZone().runOutsideAngular(() => {
return getDOM().onAndCancel(element, parsedEvent["domEventName"], outsideHandler, options);
});
}
/**
* 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) {
return null;
}
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.";
}
if (keycode == null || !keycode) return false;
keycode = keycode.toLowerCase();
if (keycode === " ") {
keycode = "space";
} else if (keycode === ".") {
keycode = "dot";
}
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) {
return keyName === "esc" ? "escape" : keyName;
}
static \u0275fac = function KeyEventsPlugin_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _KeyEventsPlugin)(\u0275\u0275inject(DOCUMENT));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _KeyEventsPlugin,
factory: _KeyEventsPlugin.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(KeyEventsPlugin, [{
type: Injectable
}], () => [{
type: void 0,
decorators: [{
type: Inject,
args: [DOCUMENT]
}]
}], null);
})();
function bootstrapApplication(rootComponent, options) {
const config2 = __spreadValues({
rootComponent
}, createProvidersConfig(options));
if (false) {
return resolveComponentResources(fetch).catch((error) => {
console.error(error);
return Promise.resolve();
}).then(() => internalCreateApplication(config2));
}
return internalCreateApplication(config2);
}
function createProvidersConfig(options) {
return {
appProviders: [...BROWSER_MODULE_PROVIDERS, ...options?.providers ?? []],
platformProviders: INTERNAL_BROWSER_PLATFORM_PROVIDERS
};
}
function initDomAdapter() {
BrowserDomAdapter.makeCurrent();
}
function errorHandler() {
return new ErrorHandler();
}
function _document() {
setDocument(document);
return document;
}
var INTERNAL_BROWSER_PLATFORM_PROVIDERS = [{
provide: PLATFORM_ID,
useValue: PLATFORM_BROWSER_ID
}, {
provide: PLATFORM_INITIALIZER,
useValue: initDomAdapter,
multi: true
}, {
provide: DOCUMENT,
useFactory: _document
}];
var platformBrowser = createPlatformFactory(platformCore, "browser", INTERNAL_BROWSER_PLATFORM_PROVIDERS);
var BROWSER_MODULE_PROVIDERS_MARKER = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "BrowserModule Providers Marker" : "");
var TESTABILITY_PROVIDERS = [{
provide: TESTABILITY_GETTER,
useClass: BrowserGetTestability
}, {
provide: TESTABILITY,
useClass: Testability,
deps: [NgZone, TestabilityRegistry, TESTABILITY_GETTER]
}, {
provide: Testability,
// Also provide as `Testability` for backwards-compatibility.
useClass: Testability,
deps: [NgZone, TestabilityRegistry, TESTABILITY_GETTER]
}];
var BROWSER_MODULE_PROVIDERS = [{
provide: INJECTOR_SCOPE,
useValue: "root"
}, {
provide: ErrorHandler,
useFactory: errorHandler
}, {
provide: EVENT_MANAGER_PLUGINS,
useClass: DomEventsPlugin,
multi: true,
deps: [DOCUMENT]
}, {
provide: EVENT_MANAGER_PLUGINS,
useClass: KeyEventsPlugin,
multi: true,
deps: [DOCUMENT]
}, DomRendererFactory2, SharedStylesHost, EventManager, {
provide: RendererFactory2,
useExisting: DomRendererFactory2
}, {
provide: XhrFactory,
useClass: BrowserXhr
}, typeof ngDevMode === "undefined" || ngDevMode ? {
provide: BROWSER_MODULE_PROVIDERS_MARKER,
useValue: true
} : []];
var BrowserModule = class _BrowserModule {
constructor() {
if (typeof ngDevMode === "undefined" || ngDevMode) {
const providersAlreadyPresent = inject2(BROWSER_MODULE_PROVIDERS_MARKER, {
optional: true,
skipSelf: true
});
if (providersAlreadyPresent) {
throw new RuntimeError(5100, `Providers from the \`BrowserModule\` have already been loaded. If you need access to common directives such as NgIf and NgFor, import the \`CommonModule\` instead.`);
}
}
}
static \u0275fac = function BrowserModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _BrowserModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _BrowserModule,
exports: [CommonModule, ApplicationModule]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS],
imports: [CommonModule, ApplicationModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BrowserModule, [{
type: NgModule,
args: [{
providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS],
exports: [CommonModule, ApplicationModule]
}]
}], () => [], null);
})();
// node_modules/.pnpm/@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs@7.8.2__rxjs@7.8.2/node_modules/@angular/common/fesm2022/module.mjs
var HttpHandler = class {
};
var HttpBackend = class {
};
var HttpHeaders = class _HttpHeaders {
/**
* Internal map of lowercase header names to values.
*/
headers;
/**
* Internal map of lowercased header names to the normalized
* form of the name (the form seen first).
*/
normalizedNames = /* @__PURE__ */ new Map();
/**
* Complete the lazy initialization of this object (needed before reading).
*/
lazyInit;
/**
* Queued updates to be materialized the next initialization.
*/
lazyUpdate = null;
/** Constructs a new HTTP header object with the given values.*/
constructor(headers) {
if (!headers) {
this.headers = /* @__PURE__ */ new Map();
} else if (typeof headers === "string") {
this.lazyInit = () => {
this.headers = /* @__PURE__ */ new Map();
headers.split("\n").forEach((line) => {
const index = line.indexOf(":");
if (index > 0) {
const name = line.slice(0, index);
const value = line.slice(index + 1).trim();
this.addHeaderEntry(name, value);
}
});
};
} else if (typeof Headers !== "undefined" && headers instanceof Headers) {
this.headers = /* @__PURE__ */ new Map();
headers.forEach((value, name) => {
this.addHeaderEntry(name, value);
});
} else {
this.lazyInit = () => {
if (typeof ngDevMode === "undefined" || ngDevMode) {
assertValidHeaders(headers);
}
this.headers = /* @__PURE__ */ new Map();
Object.entries(headers).forEach(([name, values]) => {
this.setHeaderEntries(name, values);
});
};
}
}
/**
* Checks for existence of a given header.
*
* @param name The header name to check for existence.
*
* @returns True if the header exists, false otherwise.
*/
has(name) {
this.init();
return this.headers.has(name.toLowerCase());
}
/**
* Retrieves the first value of a given header.
*
* @param name The header name.
*
* @returns The value string if the header exists, null otherwise
*/
get(name) {
this.init();
const values = this.headers.get(name.toLowerCase());
return values && values.length > 0 ? values[0] : null;
}
/**
* Retrieves the names of the headers.
*
* @returns A list of header names.
*/
keys() {
this.init();
return Array.from(this.normalizedNames.values());
}
/**
* Retrieves a list of values for a given header.
*
* @param name The header name from which to retrieve values.
*
* @returns A string of values if the header exists, null otherwise.
*/
getAll(name) {
this.init();
return this.headers.get(name.toLowerCase()) || null;
}
/**
* Appends a new value to the existing set of values for a header
* and returns them in a clone of the original instance.
*
* @param name The header name for which to append the values.
* @param value The value to append.
*
* @returns A clone of the HTTP headers object with the value appended to the given header.
*/
append(name, value) {
return this.clone({
name,
value,
op: "a"
});
}
/**
* Sets or modifies a value for a given header in a clone of the original instance.
* If the header already exists, its value is replaced with the given value
* in the returned object.
*
* @param name The header name.
* @param value The value or values to set or override for the given header.
*
* @returns A clone of the HTTP headers object with the newly set header value.
*/
set(name, value) {
return this.clone({
name,
value,
op: "s"
});
}
/**
* Deletes values for a given header in a clone of the original instance.
*
* @param name The header name.
* @param value The value or values to delete for the given header.
*
* @returns A clone of the HTTP headers object with the given value deleted.
*/
delete(name, value) {
return this.clone({
name,
value,
op: "d"
});
}
maybeSetNormalizedName(name, lcName) {
if (!this.normalizedNames.has(lcName)) {
this.normalizedNames.set(lcName, name);
}
}
init() {
if (!!this.lazyInit) {
if (this.lazyInit instanceof _HttpHeaders) {
this.copyFrom(this.lazyInit);
} else {
this.lazyInit();
}
this.lazyInit = null;
if (!!this.lazyUpdate) {
this.lazyUpdate.forEach((update) => this.applyUpdate(update));
this.lazyUpdate = null;
}
}
}
copyFrom(other) {
other.init();
Array.from(other.headers.keys()).forEach((key) => {
this.headers.set(key, other.headers.get(key));
this.normalizedNames.set(key, other.normalizedNames.get(key));
});
}
clone(update) {
const clone = new _HttpHeaders();
clone.lazyInit = !!this.lazyInit && this.lazyInit instanceof _HttpHeaders ? this.lazyInit : this;
clone.lazyUpdate = (this.lazyUpdate || []).concat([update]);
return clone;
}
applyUpdate(update) {
const key = update.name.toLowerCase();
switch (update.op) {
case "a":
case "s":
let value = update.value;
if (typeof value === "string") {
value = [value];
}
if (value.length === 0) {
return;
}
this.maybeSetNormalizedName(update.name, key);
const base = (update.op === "a" ? this.headers.get(key) : void 0) || [];
base.push(...value);
this.headers.set(key, base);
break;
case "d":
const toDelete = update.value;
if (!toDelete) {
this.headers.delete(key);
this.normalizedNames.delete(key);
} else {
let existing = this.headers.get(key);
if (!existing) {
return;
}
existing = existing.filter((value2) => toDelete.indexOf(value2) === -1);
if (existing.length === 0) {
this.headers.delete(key);
this.normalizedNames.delete(key);
} else {
this.headers.set(key, existing);
}
}
break;
}
}
addHeaderEntry(name, value) {
const key = name.toLowerCase();
this.maybeSetNormalizedName(name, key);
if (this.headers.has(key)) {
this.headers.get(key).push(value);
} else {
this.headers.set(key, [value]);
}
}
setHeaderEntries(name, values) {
const headerValues = (Array.isArray(values) ? values : [values]).map((value) => value.toString());
const key = name.toLowerCase();
this.headers.set(key, headerValues);
this.maybeSetNormalizedName(name, key);
}
/**
* @internal
*/
forEach(fn) {
this.init();
Array.from(this.normalizedNames.keys()).forEach((key) => fn(this.normalizedNames.get(key), this.headers.get(key)));
}
};
function assertValidHeaders(headers) {
for (const [key, value] of Object.entries(headers)) {
if (!(typeof value === "string" || typeof value === "number") && !Array.isArray(value)) {
throw new Error(`Unexpected value of the \`${key}\` header provided. Expecting either a string, a number or an array, but got: \`${value}\`.`);
}
}
}
var HttpUrlEncodingCodec = class {
/**
* Encodes a key name for a URL parameter or query-string.
* @param key The key name.
* @returns The encoded key name.
*/
encodeKey(key) {
return standardEncoding(key);
}
/**
* Encodes the value of a URL parameter or query-string.
* @param value The value.
* @returns The encoded value.
*/
encodeValue(value) {
return standardEncoding(value);
}
/**
* Decodes an encoded URL parameter or query-string key.
* @param key The encoded key name.
* @returns The decoded key name.
*/
decodeKey(key) {
return decodeURIComponent(key);
}
/**
* Decodes an encoded URL parameter or query-string value.
* @param value The encoded value.
* @returns The decoded value.
*/
decodeValue(value) {
return decodeURIComponent(value);
}
};
function paramParser(rawParams, codec) {
const map2 = /* @__PURE__ */ new Map();
if (rawParams.length > 0) {
const params = rawParams.replace(/^\?/, "").split("&");
params.forEach((param) => {
const eqIdx = param.indexOf("=");
const [key, val] = eqIdx == -1 ? [codec.decodeKey(param), ""] : [codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))];
const list = map2.get(key) || [];
list.push(val);
map2.set(key, list);
});
}
return map2;
}
var STANDARD_ENCODING_REGEX = /%(\d[a-f0-9])/gi;
var STANDARD_ENCODING_REPLACEMENTS = {
"40": "@",
"3A": ":",
"24": "$",
"2C": ",",
"3B": ";",
"3D": "=",
"3F": "?",
"2F": "/"
};
function standardEncoding(v) {
return encodeURIComponent(v).replace(STANDARD_ENCODING_REGEX, (s, t) => STANDARD_ENCODING_REPLACEMENTS[t] ?? s);
}
function valueToString(value) {
return `${value}`;
}
var HttpParams = class _HttpParams {
map;
encoder;
updates = null;
cloneFrom = null;
constructor(options = {}) {
this.encoder = options.encoder || new HttpUrlEncodingCodec();
if (options.fromString) {
if (options.fromObject) {
throw new RuntimeError(2805, ngDevMode && "Cannot specify both fromString and fromObject.");
}
this.map = paramParser(options.fromString, this.encoder);
} else if (!!options.fromObject) {
this.map = /* @__PURE__ */ new Map();
Object.keys(options.fromObject).forEach((key) => {
const value = options.fromObject[key];
const values = Array.isArray(value) ? value.map(valueToString) : [valueToString(value)];
this.map.set(key, values);
});
} else {
this.map = null;
}
}
/**
* Reports whether the body includes one or more values for a given parameter.
* @param param The parameter name.
* @returns True if the parameter has one or more values,
* false if it has no value or is not present.
*/
has(param) {
this.init();
return this.map.has(param);
}
/**
* Retrieves the first value for a parameter.
* @param param The parameter name.
* @returns The first value of the given parameter,
* or `null` if the parameter is not present.
*/
get(param) {
this.init();
const res = this.map.get(param);
return !!res ? res[0] : null;
}
/**
* Retrieves all values for a parameter.
* @param param The parameter name.
* @returns All values in a string array,
* or `null` if the parameter not present.
*/
getAll(param) {
this.init();
return this.map.get(param) || null;
}
/**
* Retrieves all the parameters for this body.
* @returns The parameter names in a string array.
*/
keys() {
this.init();
return Array.from(this.map.keys());
}
/**
* Appends a new value to existing values for a parameter.
* @param param The parameter name.
* @param value The new value to add.
* @return A new body with the appended value.
*/
append(param, value) {
return this.clone({
param,
value,
op: "a"
});
}
/**
* Constructs a new body with appended values for the given parameter name.
* @param params parameters and values
* @return A new body with the new value.
*/
appendAll(params) {
const updates = [];
Object.keys(params).forEach((param) => {
const value = params[param];
if (Array.isArray(value)) {
value.forEach((_value) => {
updates.push({
param,
value: _value,
op: "a"
});
});
} else {
updates.push({
param,
value,
op: "a"
});
}
});
return this.clone(updates);
}
/**
* Replaces the value for a parameter.
* @param param The parameter name.
* @param value The new value.
* @return A new body with the new value.
*/
set(param, value) {
return this.clone({
param,
value,
op: "s"
});
}
/**
* Removes a given value or all values from a parameter.
* @param param The parameter name.
* @param value The value to remove, if provided.
* @return A new body with the given value removed, or with all values
* removed if no value is specified.
*/
delete(param, value) {
return this.clone({
param,
value,
op: "d"
});
}
/**
* Serializes the body to an encoded string, where key-value pairs (separated by `=`) are
* separated by `&`s.
*/
toString() {
this.init();
return this.keys().map((key) => {
const eKey = this.encoder.encodeKey(key);
return this.map.get(key).map((value) => eKey + "=" + this.encoder.encodeValue(value)).join("&");
}).filter((param) => param !== "").join("&");
}
clone(update) {
const clone = new _HttpParams({
encoder: this.encoder
});
clone.cloneFrom = this.cloneFrom || this;
clone.updates = (this.updates || []).concat(update);
return clone;
}
init() {
if (this.map === null) {
this.map = /* @__PURE__ */ new Map();
}
if (this.cloneFrom !== null) {
this.cloneFrom.init();
this.cloneFrom.keys().forEach((key) => this.map.set(key, this.cloneFrom.map.get(key)));
this.updates.forEach((update) => {
switch (update.op) {
case "a":
case "s":
const base = (update.op === "a" ? this.map.get(update.param) : void 0) || [];
base.push(valueToString(update.value));
this.map.set(update.param, base);
break;
case "d":
if (update.value !== void 0) {
let base2 = this.map.get(update.param) || [];
const idx = base2.indexOf(valueToString(update.value));
if (idx !== -1) {
base2.splice(idx, 1);
}
if (base2.length > 0) {
this.map.set(update.param, base2);
} else {
this.map.delete(update.param);
}
} else {
this.map.delete(update.param);
break;
}
}
});
this.cloneFrom = this.updates = null;
}
}
};
var HttpContext = class {
map = /* @__PURE__ */ new Map();
/**
* Store a value in the context. If a value is already present it will be overwritten.
*
* @param token The reference to an instance of `HttpContextToken`.
* @param value The value to store.
*
* @returns A reference to itself for easy chaining.
*/
set(token, value) {
this.map.set(token, value);
return this;
}
/**
* Retrieve the value associated with the given token.
*
* @param token The reference to an instance of `HttpContextToken`.
*
* @returns The stored value or default if one is defined.
*/
get(token) {
if (!this.map.has(token)) {
this.map.set(token, token.defaultValue());
}
return this.map.get(token);
}
/**
* Delete the value associated with the given token.
*
* @param token The reference to an instance of `HttpContextToken`.
*
* @returns A reference to itself for easy chaining.
*/
delete(token) {
this.map.delete(token);
return this;
}
/**
* Checks for existence of a given token.
*
* @param token The reference to an instance of `HttpContextToken`.
*
* @returns True if the token exists, false otherwise.
*/
has(token) {
return this.map.has(token);
}
/**
* @returns a list of tokens currently stored in the context.
*/
keys() {
return this.map.keys();
}
};
function mightHaveBody(method) {
switch (method) {
case "DELETE":
case "GET":
case "HEAD":
case "OPTIONS":
case "JSONP":
return false;
default:
return true;
}
}
function isArrayBuffer(value) {
return typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer;
}
function isBlob(value) {
return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value) {
return typeof FormData !== "undefined" && value instanceof FormData;
}
function isUrlSearchParams(value) {
return typeof URLSearchParams !== "undefined" && value instanceof URLSearchParams;
}
var CONTENT_TYPE_HEADER = "Content-Type";
var ACCEPT_HEADER = "Accept";
var X_REQUEST_URL_HEADER = "X-Request-URL";
var TEXT_CONTENT_TYPE = "text/plain";
var JSON_CONTENT_TYPE = "application/json";
var ACCEPT_HEADER_VALUE = `${JSON_CONTENT_TYPE}, ${TEXT_CONTENT_TYPE}, */*`;
var HttpRequest = class _HttpRequest {
url;
/**
* The request body, or `null` if one isn't set.
*
* Bodies are not enforced to be immutable, as they can include a reference to any
* user-defined data type. However, interceptors should take care to preserve
* idempotence by treating them as such.
*/
body = null;
/**
* Outgoing headers for this request.
*/
headers;
/**
* Shared and mutable context that can be used by interceptors
*/
context;
/**
* Whether this request should be made in a way that exposes progress events.
*
* Progress events are expensive (change detection runs on each event) and so
* they should only be requested if the consumer intends to monitor them.
*
* Note: The `FetchBackend` doesn't support progress report on uploads.
*/
reportProgress = false;
/**
* Whether this request should be sent with outgoing credentials (cookies).
*/
withCredentials = false;
/**
* The credentials mode of the request, which determines how cookies and HTTP authentication are handled.
* This can affect whether cookies are sent with the request, and how authentication is handled.
*/
credentials;
/**
* When using the fetch implementation and set to `true`, the browser will not abort the associated request if the page that initiated it is unloaded before the request is complete.
*/
keepalive = false;
/**
* Controls how the request will interact with the browser's HTTP cache.
* This affects whether a response is retrieved from the cache, how it is stored, or if it bypasses the cache altogether.
*/
cache;
/**
* Indicates the relative priority of the request. This may be used by the browser to decide the order in which requests are dispatched and resources fetched.
*/
priority;
/**
* The mode of the request, which determines how the request will interact with the browser's security model.
* This can affect things like CORS (Cross-Origin Resource Sharing) and same-origin policies.
*/
mode;
/**
* The redirect mode of the request, which determines how redirects are handled.
* This can affect whether the request follows redirects automatically, or if it fails when a redirect occurs.
*/
redirect;
/**
* The referrer of the request, which can be used to indicate the origin of the request.
* This is useful for security and analytics purposes.
* Value is a same-origin URL, "about:client", or the empty string, to set request's referrer.
*/
referrer;
/**
* The integrity metadata of the request, which can be used to ensure the request is made with the expected content.
* A cryptographic hash of the resource to be fetched by request
*/
integrity;
/**
* The expected response type of the server.
*
* This is used to parse the response appropriately before returning it to
* the requestee.
*/
responseType = "json";
/**
* The outgoing HTTP request method.
*/
method;
/**
* Outgoing URL parameters.
*
* To pass a string representation of HTTP parameters in the URL-query-string format,
* the `HttpParamsOptions`' `fromString` may be used. For example:
*
* ```ts
* new HttpParams({fromString: 'angular=awesome'})
* ```
*/
params;
/**
* The outgoing URL with all URL parameters set.
*/
urlWithParams;
/**
* The HttpTransferCache option for the request
*/
transferCache;
/**
* The timeout for the backend HTTP request in ms.
*/
timeout;
constructor(method, url, third, fourth) {
this.url = url;
this.method = method.toUpperCase();
let options;
if (mightHaveBody(this.method) || !!fourth) {
this.body = third !== void 0 ? third : null;
options = fourth;
} else {
options = third;
}
if (options) {
this.reportProgress = !!options.reportProgress;
this.withCredentials = !!options.withCredentials;
this.keepalive = !!options.keepalive;
if (!!options.responseType) {
this.responseType = options.responseType;
}
if (options.headers) {
this.headers = options.headers;
}
if (options.context) {
this.context = options.context;
}
if (options.params) {
this.params = options.params;
}
if (options.priority) {
this.priority = options.priority;
}
if (options.cache) {
this.cache = options.cache;
}
if (options.credentials) {
this.credentials = options.credentials;
}
if (typeof options.timeout === "number") {
if (options.timeout < 1 || !Number.isInteger(options.timeout)) {
throw new RuntimeError(2822, ngDevMode ? "`timeout` must be a positive integer value" : "");
}
this.timeout = options.timeout;
}
if (options.mode) {
this.mode = options.mode;
}
if (options.redirect) {
this.redirect = options.redirect;
}
if (options.integrity) {
this.integrity = options.integrity;
}
if (options.referrer) {
this.referrer = options.referrer;
}
this.transferCache = options.transferCache;
}
this.headers ??= new HttpHeaders();
this.context ??= new HttpContext();
if (!this.params) {
this.params = new HttpParams();
this.urlWithParams = url;
} else {
const params = this.params.toString();
if (params.length === 0) {
this.urlWithParams = url;
} else {
const qIdx = url.indexOf("?");
const sep = qIdx === -1 ? "?" : qIdx < url.length - 1 ? "&" : "";
this.urlWithParams = url + sep + params;
}
}
}
/**
* Transform the free-form body into a serialized format suitable for
* transmission to the server.
*/
serializeBody() {
if (this.body === null) {
return null;
}
if (typeof this.body === "string" || isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) || isUrlSearchParams(this.body)) {
return this.body;
}
if (this.body instanceof HttpParams) {
return this.body.toString();
}
if (typeof this.body === "object" || typeof this.body === "boolean" || Array.isArray(this.body)) {
return JSON.stringify(this.body);
}
return this.body.toString();
}
/**
* Examine the body and attempt to infer an appropriate MIME type
* for it.
*
* If no such type can be inferred, this method will return `null`.
*/
detectContentTypeHeader() {
if (this.body === null) {
return null;
}
if (isFormData(this.body)) {
return null;
}
if (isBlob(this.body)) {
return this.body.type || null;
}
if (isArrayBuffer(this.body)) {
return null;
}
if (typeof this.body === "string") {
return TEXT_CONTENT_TYPE;
}
if (this.body instanceof HttpParams) {
return "application/x-www-form-urlencoded;charset=UTF-8";
}
if (typeof this.body === "object" || typeof this.body === "number" || typeof this.body === "boolean") {
return JSON_CONTENT_TYPE;
}
return null;
}
clone(update = {}) {
const method = update.method || this.method;
const url = update.url || this.url;
const responseType = update.responseType || this.responseType;
const keepalive = update.keepalive ?? this.keepalive;
const priority = update.priority || this.priority;
const cache = update.cache || this.cache;
const mode = update.mode || this.mode;
const redirect = update.redirect || this.redirect;
const credentials = update.credentials || this.credentials;
const referrer = update.referrer || this.referrer;
const integrity = update.integrity || this.integrity;
const transferCache = update.transferCache ?? this.transferCache;
const timeout = update.timeout ?? this.timeout;
const body = update.body !== void 0 ? update.body : this.body;
const withCredentials = update.withCredentials ?? this.withCredentials;
const reportProgress = update.reportProgress ?? this.reportProgress;
let headers = update.headers || this.headers;
let params = update.params || this.params;
const context2 = update.context ?? this.context;
if (update.setHeaders !== void 0) {
headers = Object.keys(update.setHeaders).reduce((headers2, name) => headers2.set(name, update.setHeaders[name]), headers);
}
if (update.setParams) {
params = Object.keys(update.setParams).reduce((params2, param) => params2.set(param, update.setParams[param]), params);
}
return new _HttpRequest(method, url, body, {
params,
headers,
context: context2,
reportProgress,
responseType,
withCredentials,
transferCache,
keepalive,
cache,
priority,
timeout,
mode,
redirect,
credentials,
referrer,
integrity
});
}
};
var HttpEventType;
(function(HttpEventType2) {
HttpEventType2[HttpEventType2["Sent"] = 0] = "Sent";
HttpEventType2[HttpEventType2["UploadProgress"] = 1] = "UploadProgress";
HttpEventType2[HttpEventType2["ResponseHeader"] = 2] = "ResponseHeader";
HttpEventType2[HttpEventType2["DownloadProgress"] = 3] = "DownloadProgress";
HttpEventType2[HttpEventType2["Response"] = 4] = "Response";
HttpEventType2[HttpEventType2["User"] = 5] = "User";
})(HttpEventType || (HttpEventType = {}));
var HttpResponseBase = class {
/**
* All response headers.
*/
headers;
/**
* Response status code.
*/
status;
/**
* Textual description of response status code, defaults to OK.
*
* Do not depend on this.
*/
statusText;
/**
* URL of the resource retrieved, or null if not available.
*/
url;
/**
* Whether the status code falls in the 2xx range.
*/
ok;
/**
* Type of the response, narrowed to either the full response or the header.
*/
type;
/**
* Indicates whether the HTTP response was redirected during the request.
* This property is only available when using the Fetch API using `withFetch()`
* When using the default XHR Request this property will be `undefined`
*/
redirected;
/**
* Super-constructor for all responses.
*
* The single parameter accepted is an initialization hash. Any properties
* of the response passed there will override the default values.
*/
constructor(init, defaultStatus = 200, defaultStatusText = "OK") {
this.headers = init.headers || new HttpHeaders();
this.status = init.status !== void 0 ? init.status : defaultStatus;
this.statusText = init.statusText || defaultStatusText;
this.url = init.url || null;
this.redirected = init.redirected;
this.ok = this.status >= 200 && this.status < 300;
}
};
var HttpHeaderResponse = class _HttpHeaderResponse extends HttpResponseBase {
/**
* Create a new `HttpHeaderResponse` with the given parameters.
*/
constructor(init = {}) {
super(init);
}
type = HttpEventType.ResponseHeader;
/**
* Copy this `HttpHeaderResponse`, overriding its contents with the
* given parameter hash.
*/
clone(update = {}) {
return new _HttpHeaderResponse({
headers: update.headers || this.headers,
status: update.status !== void 0 ? update.status : this.status,
statusText: update.statusText || this.statusText,
url: update.url || this.url || void 0
});
}
};
var HttpResponse = class _HttpResponse extends HttpResponseBase {
/**
* The response body, or `null` if one was not returned.
*/
body;
/**
* Construct a new `HttpResponse`.
*/
constructor(init = {}) {
super(init);
this.body = init.body !== void 0 ? init.body : null;
}
type = HttpEventType.Response;
clone(update = {}) {
return new _HttpResponse({
body: update.body !== void 0 ? update.body : this.body,
headers: update.headers || this.headers,
status: update.status !== void 0 ? update.status : this.status,
statusText: update.statusText || this.statusText,
url: update.url || this.url || void 0,
redirected: update.redirected ?? this.redirected
});
}
};
var HttpErrorResponse = class extends HttpResponseBase {
name = "HttpErrorResponse";
message;
error;
/**
* Errors are never okay, even when the status code is in the 2xx success range.
*/
ok = false;
constructor(init) {
super(init, 0, "Unknown Error");
if (this.status >= 200 && this.status < 300) {
this.message = `Http failure during parsing for ${init.url || "(unknown url)"}`;
} else {
this.message = `Http failure response for ${init.url || "(unknown url)"}: ${init.status} ${init.statusText}`;
}
this.error = init.error || null;
}
};
var HTTP_STATUS_CODE_OK = 200;
var HTTP_STATUS_CODE_NO_CONTENT = 204;
var HttpStatusCode;
(function(HttpStatusCode2) {
HttpStatusCode2[HttpStatusCode2["Continue"] = 100] = "Continue";
HttpStatusCode2[HttpStatusCode2["SwitchingProtocols"] = 101] = "SwitchingProtocols";
HttpStatusCode2[HttpStatusCode2["Processing"] = 102] = "Processing";
HttpStatusCode2[HttpStatusCode2["EarlyHints"] = 103] = "EarlyHints";
HttpStatusCode2[HttpStatusCode2["Ok"] = 200] = "Ok";
HttpStatusCode2[HttpStatusCode2["Created"] = 201] = "Created";
HttpStatusCode2[HttpStatusCode2["Accepted"] = 202] = "Accepted";
HttpStatusCode2[HttpStatusCode2["NonAuthoritativeInformation"] = 203] = "NonAuthoritativeInformation";
HttpStatusCode2[HttpStatusCode2["NoContent"] = 204] = "NoContent";
HttpStatusCode2[HttpStatusCode2["ResetContent"] = 205] = "ResetContent";
HttpStatusCode2[HttpStatusCode2["PartialContent"] = 206] = "PartialContent";
HttpStatusCode2[HttpStatusCode2["MultiStatus"] = 207] = "MultiStatus";
HttpStatusCode2[HttpStatusCode2["AlreadyReported"] = 208] = "AlreadyReported";
HttpStatusCode2[HttpStatusCode2["ImUsed"] = 226] = "ImUsed";
HttpStatusCode2[HttpStatusCode2["MultipleChoices"] = 300] = "MultipleChoices";
HttpStatusCode2[HttpStatusCode2["MovedPermanently"] = 301] = "MovedPermanently";
HttpStatusCode2[HttpStatusCode2["Found"] = 302] = "Found";
HttpStatusCode2[HttpStatusCode2["SeeOther"] = 303] = "SeeOther";
HttpStatusCode2[HttpStatusCode2["NotModified"] = 304] = "NotModified";
HttpStatusCode2[HttpStatusCode2["UseProxy"] = 305] = "UseProxy";
HttpStatusCode2[HttpStatusCode2["Unused"] = 306] = "Unused";
HttpStatusCode2[HttpStatusCode2["TemporaryRedirect"] = 307] = "TemporaryRedirect";
HttpStatusCode2[HttpStatusCode2["PermanentRedirect"] = 308] = "PermanentRedirect";
HttpStatusCode2[HttpStatusCode2["BadRequest"] = 400] = "BadRequest";
HttpStatusCode2[HttpStatusCode2["Unauthorized"] = 401] = "Unauthorized";
HttpStatusCode2[HttpStatusCode2["PaymentRequired"] = 402] = "PaymentRequired";
HttpStatusCode2[HttpStatusCode2["Forbidden"] = 403] = "Forbidden";
HttpStatusCode2[HttpStatusCode2["NotFound"] = 404] = "NotFound";
HttpStatusCode2[HttpStatusCode2["MethodNotAllowed"] = 405] = "MethodNotAllowed";
HttpStatusCode2[HttpStatusCode2["NotAcceptable"] = 406] = "NotAcceptable";
HttpStatusCode2[HttpStatusCode2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
HttpStatusCode2[HttpStatusCode2["RequestTimeout"] = 408] = "RequestTimeout";
HttpStatusCode2[HttpStatusCode2["Conflict"] = 409] = "Conflict";
HttpStatusCode2[HttpStatusCode2["Gone"] = 410] = "Gone";
HttpStatusCode2[HttpStatusCode2["LengthRequired"] = 411] = "LengthRequired";
HttpStatusCode2[HttpStatusCode2["PreconditionFailed"] = 412] = "PreconditionFailed";
HttpStatusCode2[HttpStatusCode2["PayloadTooLarge"] = 413] = "PayloadTooLarge";
HttpStatusCode2[HttpStatusCode2["UriTooLong"] = 414] = "UriTooLong";
HttpStatusCode2[HttpStatusCode2["UnsupportedMediaType"] = 415] = "UnsupportedMediaType";
HttpStatusCode2[HttpStatusCode2["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
HttpStatusCode2[HttpStatusCode2["ExpectationFailed"] = 417] = "ExpectationFailed";
HttpStatusCode2[HttpStatusCode2["ImATeapot"] = 418] = "ImATeapot";
HttpStatusCode2[HttpStatusCode2["MisdirectedRequest"] = 421] = "MisdirectedRequest";
HttpStatusCode2[HttpStatusCode2["UnprocessableEntity"] = 422] = "UnprocessableEntity";
HttpStatusCode2[HttpStatusCode2["Locked"] = 423] = "Locked";
HttpStatusCode2[HttpStatusCode2["FailedDependency"] = 424] = "FailedDependency";
HttpStatusCode2[HttpStatusCode2["TooEarly"] = 425] = "TooEarly";
HttpStatusCode2[HttpStatusCode2["UpgradeRequired"] = 426] = "UpgradeRequired";
HttpStatusCode2[HttpStatusCode2["PreconditionRequired"] = 428] = "PreconditionRequired";
HttpStatusCode2[HttpStatusCode2["TooManyRequests"] = 429] = "TooManyRequests";
HttpStatusCode2[HttpStatusCode2["RequestHeaderFieldsTooLarge"] = 431] = "RequestHeaderFieldsTooLarge";
HttpStatusCode2[HttpStatusCode2["UnavailableForLegalReasons"] = 451] = "UnavailableForLegalReasons";
HttpStatusCode2[HttpStatusCode2["InternalServerError"] = 500] = "InternalServerError";
HttpStatusCode2[HttpStatusCode2["NotImplemented"] = 501] = "NotImplemented";
HttpStatusCode2[HttpStatusCode2["BadGateway"] = 502] = "BadGateway";
HttpStatusCode2[HttpStatusCode2["ServiceUnavailable"] = 503] = "ServiceUnavailable";
HttpStatusCode2[HttpStatusCode2["GatewayTimeout"] = 504] = "GatewayTimeout";
HttpStatusCode2[HttpStatusCode2["HttpVersionNotSupported"] = 505] = "HttpVersionNotSupported";
HttpStatusCode2[HttpStatusCode2["VariantAlsoNegotiates"] = 506] = "VariantAlsoNegotiates";
HttpStatusCode2[HttpStatusCode2["InsufficientStorage"] = 507] = "InsufficientStorage";
HttpStatusCode2[HttpStatusCode2["LoopDetected"] = 508] = "LoopDetected";
HttpStatusCode2[HttpStatusCode2["NotExtended"] = 510] = "NotExtended";
HttpStatusCode2[HttpStatusCode2["NetworkAuthenticationRequired"] = 511] = "NetworkAuthenticationRequired";
})(HttpStatusCode || (HttpStatusCode = {}));
function addBody(options, body) {
return {
body,
headers: options.headers,
context: options.context,
observe: options.observe,
params: options.params,
reportProgress: options.reportProgress,
responseType: options.responseType,
withCredentials: options.withCredentials,
credentials: options.credentials,
transferCache: options.transferCache,
timeout: options.timeout,
keepalive: options.keepalive,
priority: options.priority,
cache: options.cache,
mode: options.mode,
redirect: options.redirect,
integrity: options.integrity,
referrer: options.referrer
};
}
var HttpClient = class _HttpClient {
handler;
constructor(handler) {
this.handler = handler;
}
/**
* Constructs an observable for a generic HTTP request that, when subscribed,
* fires the request through the chain of registered interceptors and on to the
* server.
*
* You can pass an `HttpRequest` directly as the only parameter. In this case,
* the call returns an observable of the raw `HttpEvent` stream.
*
* Alternatively you can pass an HTTP method as the first parameter,
* a URL string as the second, and an options hash containing the request body as the third.
* See `addBody()`. In this case, the specified `responseType` and `observe` options determine the
* type of returned observable.
* * The `responseType` value determines how a successful response body is parsed.
* * If `responseType` is the default `json`, you can pass a type interface for the resulting
* object as a type parameter to the call.
*
* The `observe` value determines the return type, according to what you are interested in
* observing.
* * An `observe` value of events returns an observable of the raw `HttpEvent` stream, including
* progress events by default.
* * An `observe` value of response returns an observable of `HttpResponse<T>`,
* where the `T` parameter depends on the `responseType` and any optionally provided type
* parameter.
* * An `observe` value of body returns an observable of `<T>` with the same `T` body type.
*
*/
request(first2, url, options = {}) {
let req;
if (first2 instanceof HttpRequest) {
req = first2;
} else {
let headers = void 0;
if (options.headers instanceof HttpHeaders) {
headers = options.headers;
} else {
headers = new HttpHeaders(options.headers);
}
let params = void 0;
if (!!options.params) {
if (options.params instanceof HttpParams) {
params = options.params;
} else {
params = new HttpParams({
fromObject: options.params
});
}
}
req = new HttpRequest(first2, url, options.body !== void 0 ? options.body : null, {
headers,
context: options.context,
params,
reportProgress: options.reportProgress,
// By default, JSON is assumed to be returned for all calls.
responseType: options.responseType || "json",
withCredentials: options.withCredentials,
transferCache: options.transferCache,
keepalive: options.keepalive,
priority: options.priority,
cache: options.cache,
mode: options.mode,
redirect: options.redirect,
credentials: options.credentials,
referrer: options.referrer,
integrity: options.integrity,
timeout: options.timeout
});
}
const events$ = of(req).pipe(concatMap((req2) => this.handler.handle(req2)));
if (first2 instanceof HttpRequest || options.observe === "events") {
return events$;
}
const res$ = events$.pipe(filter((event) => event instanceof HttpResponse));
switch (options.observe || "body") {
case "body":
switch (req.responseType) {
case "arraybuffer":
return res$.pipe(map((res) => {
if (res.body !== null && !(res.body instanceof ArrayBuffer)) {
throw new RuntimeError(2806, ngDevMode && "Response is not an ArrayBuffer.");
}
return res.body;
}));
case "blob":
return res$.pipe(map((res) => {
if (res.body !== null && !(res.body instanceof Blob)) {
throw new RuntimeError(2807, ngDevMode && "Response is not a Blob.");
}
return res.body;
}));
case "text":
return res$.pipe(map((res) => {
if (res.body !== null && typeof res.body !== "string") {
throw new RuntimeError(2808, ngDevMode && "Response is not a string.");
}
return res.body;
}));
case "json":
default:
return res$.pipe(map((res) => res.body));
}
case "response":
return res$;
default:
throw new RuntimeError(2809, ngDevMode && `Unreachable: unhandled observe type ${options.observe}}`);
}
}
/**
* Constructs an observable that, when subscribed, causes the configured
* `DELETE` request to execute on the server. See the individual overloads for
* details on the return type.
*
* @param url The endpoint URL.
* @param options The HTTP options to send with the request.
*
*/
delete(url, options = {}) {
return this.request("DELETE", url, options);
}
/**
* Constructs an observable that, when subscribed, causes the configured
* `GET` request to execute on the server. See the individual overloads for
* details on the return type.
*/
get(url, options = {}) {
return this.request("GET", url, options);
}
/**
* Constructs an observable that, when subscribed, causes the configured
* `HEAD` request to execute on the server. The `HEAD` method returns
* meta information about the resource without transferring the
* resource itself. See the individual overloads for
* details on the return type.
*/
head(url, options = {}) {
return this.request("HEAD", url, options);
}
/**
* Constructs an `Observable` that, when subscribed, causes a request with the special method
* `JSONP` to be dispatched via the interceptor pipeline.
* The [JSONP pattern](https://en.wikipedia.org/wiki/JSONP) works around limitations of certain
* API endpoints that don't support newer,
* and preferable [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) protocol.
* JSONP treats the endpoint API as a JavaScript file and tricks the browser to process the
* requests even if the API endpoint is not located on the same domain (origin) as the client-side
* application making the request.
* The endpoint API must support JSONP callback for JSONP requests to work.
* The resource API returns the JSON response wrapped in a callback function.
* You can pass the callback function name as one of the query parameters.
* Note that JSONP requests can only be used with `GET` requests.
*
* @param url The resource URL.
* @param callbackParam The callback function name.
*
*/
jsonp(url, callbackParam) {
return this.request("JSONP", url, {
params: new HttpParams().append(callbackParam, "JSONP_CALLBACK"),
observe: "body",
responseType: "json"
});
}
/**
* Constructs an `Observable` that, when subscribed, causes the configured
* `OPTIONS` request to execute on the server. This method allows the client
* to determine the supported HTTP methods and other capabilities of an endpoint,
* without implying a resource action. See the individual overloads for
* details on the return type.
*/
options(url, options = {}) {
return this.request("OPTIONS", url, options);
}
/**
* Constructs an observable that, when subscribed, causes the configured
* `PATCH` request to execute on the server. See the individual overloads for
* details on the return type.
*/
patch(url, body, options = {}) {
return this.request("PATCH", url, addBody(options, body));
}
/**
* Constructs an observable that, when subscribed, causes the configured
* `POST` request to execute on the server. The server responds with the location of
* the replaced resource. See the individual overloads for
* details on the return type.
*/
post(url, body, options = {}) {
return this.request("POST", url, addBody(options, body));
}
/**
* Constructs an observable that, when subscribed, causes the configured
* `PUT` request to execute on the server. The `PUT` method replaces an existing resource
* with a new set of values.
* See the individual overloads for details on the return type.
*/
put(url, body, options = {}) {
return this.request("PUT", url, addBody(options, body));
}
static \u0275fac = function HttpClient_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _HttpClient)(\u0275\u0275inject(HttpHandler));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _HttpClient,
factory: _HttpClient.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpClient, [{
type: Injectable
}], () => [{
type: HttpHandler
}], null);
})();
var XSSI_PREFIX$1 = /^\)\]\}',?\n/;
function getResponseUrl$1(response) {
if (response.url) {
return response.url;
}
const xRequestUrl = X_REQUEST_URL_HEADER.toLocaleLowerCase();
return response.headers.get(xRequestUrl);
}
var FETCH_BACKEND = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "FETCH_BACKEND" : "");
var FetchBackend = class _FetchBackend {
// We use an arrow function to always reference the current global implementation of `fetch`.
// This is helpful for cases when the global `fetch` implementation is modified by external code,
// see https://github.com/angular/angular/issues/57527.
fetchImpl = inject2(FetchFactory, {
optional: true
})?.fetch ?? ((...args) => globalThis.fetch(...args));
ngZone = inject2(NgZone);
destroyRef = inject2(DestroyRef);
destroyed = false;
constructor() {
this.destroyRef.onDestroy(() => {
this.destroyed = true;
});
}
handle(request) {
return new Observable((observer) => {
const aborter = new AbortController();
this.doRequest(request, aborter.signal, observer).then(noop3, (error) => observer.error(new HttpErrorResponse({
error
})));
let timeoutId;
if (request.timeout) {
timeoutId = this.ngZone.runOutsideAngular(() => setTimeout(() => {
if (!aborter.signal.aborted) {
aborter.abort(new DOMException("signal timed out", "TimeoutError"));
}
}, request.timeout));
}
return () => {
if (timeoutId !== void 0) {
clearTimeout(timeoutId);
}
aborter.abort();
};
});
}
async doRequest(request, signal2, observer) {
const init = this.createRequestInit(request);
let response;
try {
const fetchPromise = this.ngZone.runOutsideAngular(() => this.fetchImpl(request.urlWithParams, __spreadValues({
signal: signal2
}, init)));
silenceSuperfluousUnhandledPromiseRejection(fetchPromise);
observer.next({
type: HttpEventType.Sent
});
response = await fetchPromise;
} catch (error) {
observer.error(new HttpErrorResponse({
error,
status: error.status ?? 0,
statusText: error.statusText,
url: request.urlWithParams,
headers: error.headers
}));
return;
}
const headers = new HttpHeaders(response.headers);
const statusText = response.statusText;
const url = getResponseUrl$1(response) ?? request.urlWithParams;
let status = response.status;
let body = null;
if (request.reportProgress) {
observer.next(new HttpHeaderResponse({
headers,
status,
statusText,
url
}));
}
if (response.body) {
const contentLength = response.headers.get("content-length");
const chunks = [];
const reader = response.body.getReader();
let receivedLength = 0;
let decoder;
let partialText;
const reqZone = typeof Zone !== "undefined" && Zone.current;
let canceled = false;
await this.ngZone.runOutsideAngular(async () => {
while (true) {
if (this.destroyed) {
await reader.cancel();
canceled = true;
break;
}
const {
done,
value
} = await reader.read();
if (done) {
break;
}
chunks.push(value);
receivedLength += value.length;
if (request.reportProgress) {
partialText = request.responseType === "text" ? (partialText ?? "") + (decoder ??= new TextDecoder()).decode(value, {
stream: true
}) : void 0;
const reportProgress = () => observer.next({
type: HttpEventType.DownloadProgress,
total: contentLength ? +contentLength : void 0,
loaded: receivedLength,
partialText
});
reqZone ? reqZone.run(reportProgress) : reportProgress();
}
}
});
if (canceled) {
observer.complete();
return;
}
const chunksAll = this.concatChunks(chunks, receivedLength);
try {
const contentType = response.headers.get(CONTENT_TYPE_HEADER) ?? "";
body = this.parseBody(request, chunksAll, contentType, status);
} catch (error) {
observer.error(new HttpErrorResponse({
error,
headers: new HttpHeaders(response.headers),
status: response.status,
statusText: response.statusText,
url: getResponseUrl$1(response) ?? request.urlWithParams
}));
return;
}
}
if (status === 0) {
status = body ? HTTP_STATUS_CODE_OK : 0;
}
const ok = status >= 200 && status < 300;
const redirected = response.redirected;
if (ok) {
observer.next(new HttpResponse({
body,
headers,
status,
statusText,
url,
redirected
}));
observer.complete();
} else {
observer.error(new HttpErrorResponse({
error: body,
headers,
status,
statusText,
url,
redirected
}));
}
}
parseBody(request, binContent, contentType, status) {
switch (request.responseType) {
case "json":
const text = new TextDecoder().decode(binContent).replace(XSSI_PREFIX$1, "");
if (text === "") {
return null;
}
try {
return JSON.parse(text);
} catch (e) {
if (status < 200 || status >= 300) {
return text;
}
throw e;
}
case "text":
return new TextDecoder().decode(binContent);
case "blob":
return new Blob([binContent], {
type: contentType
});
case "arraybuffer":
return binContent.buffer;
}
}
createRequestInit(req) {
const headers = {};
let credentials;
credentials = req.credentials;
if (req.withCredentials) {
(typeof ngDevMode === "undefined" || ngDevMode) && warningOptionsMessage(req);
credentials = "include";
}
req.headers.forEach((name, values) => headers[name] = values.join(","));
if (!req.headers.has(ACCEPT_HEADER)) {
headers[ACCEPT_HEADER] = ACCEPT_HEADER_VALUE;
}
if (!req.headers.has(CONTENT_TYPE_HEADER)) {
const detectedType = req.detectContentTypeHeader();
if (detectedType !== null) {
headers[CONTENT_TYPE_HEADER] = detectedType;
}
}
return {
body: req.serializeBody(),
method: req.method,
headers,
credentials,
keepalive: req.keepalive,
cache: req.cache,
priority: req.priority,
mode: req.mode,
redirect: req.redirect,
referrer: req.referrer,
integrity: req.integrity
};
}
concatChunks(chunks, totalLength) {
const chunksAll = new Uint8Array(totalLength);
let position = 0;
for (const chunk of chunks) {
chunksAll.set(chunk, position);
position += chunk.length;
}
return chunksAll;
}
static \u0275fac = function FetchBackend_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _FetchBackend)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _FetchBackend,
factory: _FetchBackend.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FetchBackend, [{
type: Injectable
}], () => [], null);
})();
var FetchFactory = class {
};
function noop3() {
}
function warningOptionsMessage(req) {
if (req.credentials && req.withCredentials) {
console.warn(formatRuntimeError(2819, `Angular detected that a \`HttpClient\` request has both \`withCredentials: true\` and \`credentials: '${req.credentials}'\` options. The \`withCredentials\` option is overriding the explicit \`credentials\` setting to 'include'. Consider removing \`withCredentials\` and using \`credentials: '${req.credentials}'\` directly for clarity.`));
}
}
function silenceSuperfluousUnhandledPromiseRejection(promise) {
promise.then(noop3, noop3);
}
function interceptorChainEndFn(req, finalHandlerFn) {
return finalHandlerFn(req);
}
function adaptLegacyInterceptorToChain(chainTailFn, interceptor) {
return (initialRequest, finalHandlerFn) => interceptor.intercept(initialRequest, {
handle: (downstreamRequest) => chainTailFn(downstreamRequest, finalHandlerFn)
});
}
function chainedInterceptorFn(chainTailFn, interceptorFn, injector) {
return (initialRequest, finalHandlerFn) => runInInjectionContext(injector, () => interceptorFn(initialRequest, (downstreamRequest) => chainTailFn(downstreamRequest, finalHandlerFn)));
}
var HTTP_INTERCEPTORS = new InjectionToken(ngDevMode ? "HTTP_INTERCEPTORS" : "");
var HTTP_INTERCEPTOR_FNS = new InjectionToken(ngDevMode ? "HTTP_INTERCEPTOR_FNS" : "");
var HTTP_ROOT_INTERCEPTOR_FNS = new InjectionToken(ngDevMode ? "HTTP_ROOT_INTERCEPTOR_FNS" : "");
var REQUESTS_CONTRIBUTE_TO_STABILITY = new InjectionToken(ngDevMode ? "REQUESTS_CONTRIBUTE_TO_STABILITY" : "", {
providedIn: "root",
factory: () => true
});
function legacyInterceptorFnFactory() {
let chain = null;
return (req, handler) => {
if (chain === null) {
const interceptors = inject2(HTTP_INTERCEPTORS, {
optional: true
}) ?? [];
chain = interceptors.reduceRight(adaptLegacyInterceptorToChain, interceptorChainEndFn);
}
const pendingTasks = inject2(PendingTasks);
const contributeToStability = inject2(REQUESTS_CONTRIBUTE_TO_STABILITY);
if (contributeToStability) {
const removeTask = pendingTasks.add();
return chain(req, handler).pipe(finalize(removeTask));
} else {
return chain(req, handler);
}
};
}
var fetchBackendWarningDisplayed = false;
var HttpInterceptorHandler = class _HttpInterceptorHandler extends HttpHandler {
backend;
injector;
chain = null;
pendingTasks = inject2(PendingTasks);
contributeToStability = inject2(REQUESTS_CONTRIBUTE_TO_STABILITY);
constructor(backend, injector) {
super();
this.backend = backend;
this.injector = injector;
if ((typeof ngDevMode === "undefined" || ngDevMode) && !fetchBackendWarningDisplayed) {
const isTestingBackend = this.backend.isTestingBackend;
if (false) {
fetchBackendWarningDisplayed = true;
injector.get(Console).warn(formatRuntimeError(2801, "Angular detected that `HttpClient` is not configured to use `fetch` APIs. It's strongly recommended to enable `fetch` for applications that use Server-Side Rendering for better performance and compatibility. To enable `fetch`, add the `withFetch()` to the `provideHttpClient()` call at the root of the application."));
}
}
}
handle(initialRequest) {
if (this.chain === null) {
const dedupedInterceptorFns = Array.from(/* @__PURE__ */ new Set([...this.injector.get(HTTP_INTERCEPTOR_FNS), ...this.injector.get(HTTP_ROOT_INTERCEPTOR_FNS, [])]));
this.chain = dedupedInterceptorFns.reduceRight((nextSequencedFn, interceptorFn) => chainedInterceptorFn(nextSequencedFn, interceptorFn, this.injector), interceptorChainEndFn);
}
if (this.contributeToStability) {
const removeTask = this.pendingTasks.add();
return this.chain(initialRequest, (downstreamRequest) => this.backend.handle(downstreamRequest)).pipe(finalize(removeTask));
} else {
return this.chain(initialRequest, (downstreamRequest) => this.backend.handle(downstreamRequest));
}
}
static \u0275fac = function HttpInterceptorHandler_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _HttpInterceptorHandler)(\u0275\u0275inject(HttpBackend), \u0275\u0275inject(EnvironmentInjector));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _HttpInterceptorHandler,
factory: _HttpInterceptorHandler.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpInterceptorHandler, [{
type: Injectable
}], () => [{
type: HttpBackend
}, {
type: EnvironmentInjector
}], null);
})();
var nextRequestId = 0;
var foreignDocument;
var JSONP_ERR_NO_CALLBACK = "JSONP injected script did not invoke callback.";
var JSONP_ERR_WRONG_METHOD = "JSONP requests must use JSONP request method.";
var JSONP_ERR_WRONG_RESPONSE_TYPE = "JSONP requests must use Json response type.";
var JSONP_ERR_HEADERS_NOT_SUPPORTED = "JSONP requests do not support headers.";
var JsonpCallbackContext = class {
};
function jsonpCallbackContext() {
if (typeof window === "object") {
return window;
}
return {};
}
var JsonpClientBackend = class _JsonpClientBackend {
callbackMap;
document;
/**
* A resolved promise that can be used to schedule microtasks in the event handlers.
*/
resolvedPromise = Promise.resolve();
constructor(callbackMap, document2) {
this.callbackMap = callbackMap;
this.document = document2;
}
/**
* Get the name of the next callback method, by incrementing the global `nextRequestId`.
*/
nextCallback() {
return `ng_jsonp_callback_${nextRequestId++}`;
}
/**
* Processes a JSONP request and returns an event stream of the results.
* @param req The request object.
* @returns An observable of the response events.
*
*/
handle(req) {
if (req.method !== "JSONP") {
throw new RuntimeError(2810, ngDevMode && JSONP_ERR_WRONG_METHOD);
} else if (req.responseType !== "json") {
throw new RuntimeError(2811, ngDevMode && JSONP_ERR_WRONG_RESPONSE_TYPE);
}
if (req.headers.keys().length > 0) {
throw new RuntimeError(2812, ngDevMode && JSONP_ERR_HEADERS_NOT_SUPPORTED);
}
return new Observable((observer) => {
const callback = this.nextCallback();
const url = req.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/, `=${callback}$1`);
const node = this.document.createElement("script");
node.src = url;
let body = null;
let finished = false;
this.callbackMap[callback] = (data) => {
delete this.callbackMap[callback];
body = data;
finished = true;
};
const cleanup = () => {
node.removeEventListener("load", onLoad);
node.removeEventListener("error", onError);
node.remove();
delete this.callbackMap[callback];
};
const onLoad = () => {
this.resolvedPromise.then(() => {
cleanup();
if (!finished) {
observer.error(new HttpErrorResponse({
url,
status: 0,
statusText: "JSONP Error",
error: new Error(JSONP_ERR_NO_CALLBACK)
}));
return;
}
observer.next(new HttpResponse({
body,
status: HTTP_STATUS_CODE_OK,
statusText: "OK",
url
}));
observer.complete();
});
};
const onError = (error) => {
cleanup();
observer.error(new HttpErrorResponse({
error,
status: 0,
statusText: "JSONP Error",
url
}));
};
node.addEventListener("load", onLoad);
node.addEventListener("error", onError);
this.document.body.appendChild(node);
observer.next({
type: HttpEventType.Sent
});
return () => {
if (!finished) {
this.removeListeners(node);
}
cleanup();
};
});
}
removeListeners(script) {
foreignDocument ??= this.document.implementation.createHTMLDocument();
foreignDocument.adoptNode(script);
}
static \u0275fac = function JsonpClientBackend_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _JsonpClientBackend)(\u0275\u0275inject(JsonpCallbackContext), \u0275\u0275inject(DOCUMENT));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _JsonpClientBackend,
factory: _JsonpClientBackend.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(JsonpClientBackend, [{
type: Injectable
}], () => [{
type: JsonpCallbackContext
}, {
type: void 0,
decorators: [{
type: Inject,
args: [DOCUMENT]
}]
}], null);
})();
function jsonpInterceptorFn(req, next) {
if (req.method === "JSONP") {
return inject2(JsonpClientBackend).handle(req);
}
return next(req);
}
var JsonpInterceptor = class _JsonpInterceptor {
injector;
constructor(injector) {
this.injector = injector;
}
/**
* Identifies and handles a given JSONP request.
* @param initialRequest The outgoing request object to handle.
* @param next The next interceptor in the chain, or the backend
* if no interceptors remain in the chain.
* @returns An observable of the event stream.
*/
intercept(initialRequest, next) {
return runInInjectionContext(this.injector, () => jsonpInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
}
static \u0275fac = function JsonpInterceptor_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _JsonpInterceptor)(\u0275\u0275inject(EnvironmentInjector));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _JsonpInterceptor,
factory: _JsonpInterceptor.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(JsonpInterceptor, [{
type: Injectable
}], () => [{
type: EnvironmentInjector
}], null);
})();
var XSSI_PREFIX = /^\)\]\}',?\n/;
var X_REQUEST_URL_REGEXP = RegExp(`^${X_REQUEST_URL_HEADER}:`, "m");
function getResponseUrl(xhr) {
if ("responseURL" in xhr && xhr.responseURL) {
return xhr.responseURL;
}
if (X_REQUEST_URL_REGEXP.test(xhr.getAllResponseHeaders())) {
return xhr.getResponseHeader(X_REQUEST_URL_HEADER);
}
return null;
}
function validateXhrCompatibility(req) {
const unsupportedOptions = [{
property: "keepalive",
errorCode: 2813
/* RuntimeErrorCode.KEEPALIVE_NOT_SUPPORTED_WITH_XHR */
}, {
property: "cache",
errorCode: 2814
/* RuntimeErrorCode.CACHE_NOT_SUPPORTED_WITH_XHR */
}, {
property: "priority",
errorCode: 2815
/* RuntimeErrorCode.PRIORITY_NOT_SUPPORTED_WITH_XHR */
}, {
property: "mode",
errorCode: 2816
/* RuntimeErrorCode.MODE_NOT_SUPPORTED_WITH_XHR */
}, {
property: "redirect",
errorCode: 2817
/* RuntimeErrorCode.REDIRECT_NOT_SUPPORTED_WITH_XHR */
}, {
property: "credentials",
errorCode: 2818
/* RuntimeErrorCode.CREDENTIALS_NOT_SUPPORTED_WITH_XHR */
}, {
property: "integrity",
errorCode: 2820
/* RuntimeErrorCode.INTEGRITY_NOT_SUPPORTED_WITH_XHR */
}, {
property: "referrer",
errorCode: 2821
/* RuntimeErrorCode.REFERRER_NOT_SUPPORTED_WITH_XHR */
}];
for (const {
property,
errorCode
} of unsupportedOptions) {
if (req[property]) {
console.warn(formatRuntimeError(errorCode, `Angular detected that a \`HttpClient\` request with the \`${property}\` option was sent using XHR, which does not support it. To use the \`${property}\` option, enable Fetch API support by passing \`withFetch()\` as an argument to \`provideHttpClient()\`.`));
}
}
}
var HttpXhrBackend = class _HttpXhrBackend {
xhrFactory;
constructor(xhrFactory) {
this.xhrFactory = xhrFactory;
}
/**
* Processes a request and returns a stream of response events.
* @param req The request object.
* @returns An observable of the response events.
*/
handle(req) {
if (req.method === "JSONP") {
throw new RuntimeError(-2800, (typeof ngDevMode === "undefined" || ngDevMode) && `Cannot make a JSONP request without JSONP support. To fix the problem, either add the \`withJsonpSupport()\` call (if \`provideHttpClient()\` is used) or import the \`HttpClientJsonpModule\` in the root NgModule.`);
}
ngDevMode && validateXhrCompatibility(req);
const xhrFactory = this.xhrFactory;
const source = (
// Note that `ɵloadImpl` is never defined in client bundles and can be
// safely dropped whenever we're running in the browser.
// This branching is redundant.
// The `ngServerMode` guard also enables tree-shaking of the `from()`
// function from the common bundle, as it's only used in server code.
false ? from(xhrFactory.\u0275loadImpl()) : of(null)
);
return source.pipe(switchMap(() => {
return new Observable((observer) => {
const xhr = xhrFactory.build();
xhr.open(req.method, req.urlWithParams);
if (req.withCredentials) {
xhr.withCredentials = true;
}
req.headers.forEach((name, values) => xhr.setRequestHeader(name, values.join(",")));
if (!req.headers.has(ACCEPT_HEADER)) {
xhr.setRequestHeader(ACCEPT_HEADER, ACCEPT_HEADER_VALUE);
}
if (!req.headers.has(CONTENT_TYPE_HEADER)) {
const detectedType = req.detectContentTypeHeader();
if (detectedType !== null) {
xhr.setRequestHeader(CONTENT_TYPE_HEADER, detectedType);
}
}
if (req.timeout) {
xhr.timeout = req.timeout;
}
if (req.responseType) {
const responseType = req.responseType.toLowerCase();
xhr.responseType = responseType !== "json" ? responseType : "text";
}
const reqBody = req.serializeBody();
let headerResponse = null;
const partialFromXhr = () => {
if (headerResponse !== null) {
return headerResponse;
}
const statusText = xhr.statusText || "OK";
const headers = new HttpHeaders(xhr.getAllResponseHeaders());
const url = getResponseUrl(xhr) || req.url;
headerResponse = new HttpHeaderResponse({
headers,
status: xhr.status,
statusText,
url
});
return headerResponse;
};
const onLoad = () => {
let {
headers,
status,
statusText,
url
} = partialFromXhr();
let body = null;
if (status !== HTTP_STATUS_CODE_NO_CONTENT) {
body = typeof xhr.response === "undefined" ? xhr.responseText : xhr.response;
}
if (status === 0) {
status = !!body ? HTTP_STATUS_CODE_OK : 0;
}
let ok = status >= 200 && status < 300;
if (req.responseType === "json" && typeof body === "string") {
const originalBody = body;
body = body.replace(XSSI_PREFIX, "");
try {
body = body !== "" ? JSON.parse(body) : null;
} catch (error) {
body = originalBody;
if (ok) {
ok = false;
body = {
error,
text: body
};
}
}
}
if (ok) {
observer.next(new HttpResponse({
body,
headers,
status,
statusText,
url: url || void 0
}));
observer.complete();
} else {
observer.error(new HttpErrorResponse({
// The error in this case is the response body (error from the server).
error: body,
headers,
status,
statusText,
url: url || void 0
}));
}
};
const onError = (error) => {
const {
url
} = partialFromXhr();
const res = new HttpErrorResponse({
error,
status: xhr.status || 0,
statusText: xhr.statusText || "Unknown Error",
url: url || void 0
});
observer.error(res);
};
let onTimeout = onError;
if (req.timeout) {
onTimeout = (_) => {
const {
url
} = partialFromXhr();
const res = new HttpErrorResponse({
error: new DOMException("Request timed out", "TimeoutError"),
status: xhr.status || 0,
statusText: xhr.statusText || "Request timeout",
url: url || void 0
});
observer.error(res);
};
}
let sentHeaders = false;
const onDownProgress = (event) => {
if (!sentHeaders) {
observer.next(partialFromXhr());
sentHeaders = true;
}
let progressEvent = {
type: HttpEventType.DownloadProgress,
loaded: event.loaded
};
if (event.lengthComputable) {
progressEvent.total = event.total;
}
if (req.responseType === "text" && !!xhr.responseText) {
progressEvent.partialText = xhr.responseText;
}
observer.next(progressEvent);
};
const onUpProgress = (event) => {
let progress = {
type: HttpEventType.UploadProgress,
loaded: event.loaded
};
if (event.lengthComputable) {
progress.total = event.total;
}
observer.next(progress);
};
xhr.addEventListener("load", onLoad);
xhr.addEventListener("error", onError);
xhr.addEventListener("timeout", onTimeout);
xhr.addEventListener("abort", onError);
if (req.reportProgress) {
xhr.addEventListener("progress", onDownProgress);
if (reqBody !== null && xhr.upload) {
xhr.upload.addEventListener("progress", onUpProgress);
}
}
xhr.send(reqBody);
observer.next({
type: HttpEventType.Sent
});
return () => {
xhr.removeEventListener("error", onError);
xhr.removeEventListener("abort", onError);
xhr.removeEventListener("load", onLoad);
xhr.removeEventListener("timeout", onTimeout);
if (req.reportProgress) {
xhr.removeEventListener("progress", onDownProgress);
if (reqBody !== null && xhr.upload) {
xhr.upload.removeEventListener("progress", onUpProgress);
}
}
if (xhr.readyState !== xhr.DONE) {
xhr.abort();
}
};
});
}));
}
static \u0275fac = function HttpXhrBackend_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _HttpXhrBackend)(\u0275\u0275inject(XhrFactory));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _HttpXhrBackend,
factory: _HttpXhrBackend.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpXhrBackend, [{
type: Injectable
}], () => [{
type: XhrFactory
}], null);
})();
var XSRF_ENABLED = new InjectionToken(ngDevMode ? "XSRF_ENABLED" : "");
var XSRF_DEFAULT_COOKIE_NAME = "XSRF-TOKEN";
var XSRF_COOKIE_NAME = new InjectionToken(ngDevMode ? "XSRF_COOKIE_NAME" : "", {
providedIn: "root",
factory: () => XSRF_DEFAULT_COOKIE_NAME
});
var XSRF_DEFAULT_HEADER_NAME = "X-XSRF-TOKEN";
var XSRF_HEADER_NAME = new InjectionToken(ngDevMode ? "XSRF_HEADER_NAME" : "", {
providedIn: "root",
factory: () => XSRF_DEFAULT_HEADER_NAME
});
var HttpXsrfTokenExtractor = class {
};
var HttpXsrfCookieExtractor = class _HttpXsrfCookieExtractor {
doc;
cookieName;
lastCookieString = "";
lastToken = null;
/**
* @internal for testing
*/
parseCount = 0;
constructor(doc, cookieName) {
this.doc = doc;
this.cookieName = cookieName;
}
getToken() {
if (false) {
return null;
}
const cookieString = this.doc.cookie || "";
if (cookieString !== this.lastCookieString) {
this.parseCount++;
this.lastToken = parseCookieValue(cookieString, this.cookieName);
this.lastCookieString = cookieString;
}
return this.lastToken;
}
static \u0275fac = function HttpXsrfCookieExtractor_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _HttpXsrfCookieExtractor)(\u0275\u0275inject(DOCUMENT), \u0275\u0275inject(XSRF_COOKIE_NAME));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _HttpXsrfCookieExtractor,
factory: _HttpXsrfCookieExtractor.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpXsrfCookieExtractor, [{
type: Injectable
}], () => [{
type: void 0,
decorators: [{
type: Inject,
args: [DOCUMENT]
}]
}, {
type: void 0,
decorators: [{
type: Inject,
args: [XSRF_COOKIE_NAME]
}]
}], null);
})();
function xsrfInterceptorFn(req, next) {
const lcUrl = req.url.toLowerCase();
if (!inject2(XSRF_ENABLED) || req.method === "GET" || req.method === "HEAD" || lcUrl.startsWith("http://") || lcUrl.startsWith("https://")) {
return next(req);
}
const token = inject2(HttpXsrfTokenExtractor).getToken();
const headerName = inject2(XSRF_HEADER_NAME);
if (token != null && !req.headers.has(headerName)) {
req = req.clone({
headers: req.headers.set(headerName, token)
});
}
return next(req);
}
var HttpXsrfInterceptor = class _HttpXsrfInterceptor {
injector;
constructor(injector) {
this.injector = injector;
}
intercept(initialRequest, next) {
return runInInjectionContext(this.injector, () => xsrfInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
}
static \u0275fac = function HttpXsrfInterceptor_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _HttpXsrfInterceptor)(\u0275\u0275inject(EnvironmentInjector));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _HttpXsrfInterceptor,
factory: _HttpXsrfInterceptor.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpXsrfInterceptor, [{
type: Injectable
}], () => [{
type: EnvironmentInjector
}], null);
})();
var HttpFeatureKind;
(function(HttpFeatureKind2) {
HttpFeatureKind2[HttpFeatureKind2["Interceptors"] = 0] = "Interceptors";
HttpFeatureKind2[HttpFeatureKind2["LegacyInterceptors"] = 1] = "LegacyInterceptors";
HttpFeatureKind2[HttpFeatureKind2["CustomXsrfConfiguration"] = 2] = "CustomXsrfConfiguration";
HttpFeatureKind2[HttpFeatureKind2["NoXsrfProtection"] = 3] = "NoXsrfProtection";
HttpFeatureKind2[HttpFeatureKind2["JsonpSupport"] = 4] = "JsonpSupport";
HttpFeatureKind2[HttpFeatureKind2["RequestsMadeViaParent"] = 5] = "RequestsMadeViaParent";
HttpFeatureKind2[HttpFeatureKind2["Fetch"] = 6] = "Fetch";
})(HttpFeatureKind || (HttpFeatureKind = {}));
function makeHttpFeature(kind, providers) {
return {
\u0275kind: kind,
\u0275providers: providers
};
}
function provideHttpClient(...features) {
if (ngDevMode) {
const featureKinds = new Set(features.map((f) => f.\u0275kind));
if (featureKinds.has(HttpFeatureKind.NoXsrfProtection) && featureKinds.has(HttpFeatureKind.CustomXsrfConfiguration)) {
throw new Error(ngDevMode ? `Configuration error: found both withXsrfConfiguration() and withNoXsrfProtection() in the same call to provideHttpClient(), which is a contradiction.` : "");
}
}
const providers = [HttpClient, HttpXhrBackend, HttpInterceptorHandler, {
provide: HttpHandler,
useExisting: HttpInterceptorHandler
}, {
provide: HttpBackend,
useFactory: () => {
return inject2(FETCH_BACKEND, {
optional: true
}) ?? inject2(HttpXhrBackend);
}
}, {
provide: HTTP_INTERCEPTOR_FNS,
useValue: xsrfInterceptorFn,
multi: true
}, {
provide: XSRF_ENABLED,
useValue: true
}, {
provide: HttpXsrfTokenExtractor,
useClass: HttpXsrfCookieExtractor
}];
for (const feature of features) {
providers.push(...feature.\u0275providers);
}
return makeEnvironmentProviders(providers);
}
var LEGACY_INTERCEPTOR_FN = new InjectionToken(ngDevMode ? "LEGACY_INTERCEPTOR_FN" : "");
function withInterceptorsFromDi() {
return makeHttpFeature(HttpFeatureKind.LegacyInterceptors, [{
provide: LEGACY_INTERCEPTOR_FN,
useFactory: legacyInterceptorFnFactory
}, {
provide: HTTP_INTERCEPTOR_FNS,
useExisting: LEGACY_INTERCEPTOR_FN,
multi: true
}]);
}
function withXsrfConfiguration({
cookieName,
headerName
}) {
const providers = [];
if (cookieName !== void 0) {
providers.push({
provide: XSRF_COOKIE_NAME,
useValue: cookieName
});
}
if (headerName !== void 0) {
providers.push({
provide: XSRF_HEADER_NAME,
useValue: headerName
});
}
return makeHttpFeature(HttpFeatureKind.CustomXsrfConfiguration, providers);
}
function withNoXsrfProtection() {
return makeHttpFeature(HttpFeatureKind.NoXsrfProtection, [{
provide: XSRF_ENABLED,
useValue: false
}]);
}
function withJsonpSupport() {
return makeHttpFeature(HttpFeatureKind.JsonpSupport, [JsonpClientBackend, {
provide: JsonpCallbackContext,
useFactory: jsonpCallbackContext
}, {
provide: HTTP_INTERCEPTOR_FNS,
useValue: jsonpInterceptorFn,
multi: true
}]);
}
function withFetch() {
return makeHttpFeature(HttpFeatureKind.Fetch, [FetchBackend, {
provide: FETCH_BACKEND,
useExisting: FetchBackend
}, {
provide: HttpBackend,
useExisting: FetchBackend
}]);
}
var HttpClientXsrfModule = class _HttpClientXsrfModule {
/**
* Disable the default XSRF protection.
*/
static disable() {
return {
ngModule: _HttpClientXsrfModule,
providers: [withNoXsrfProtection().\u0275providers]
};
}
/**
* Configure XSRF protection.
* @param options An object that can specify either or both
* cookie name or header name.
* - Cookie name default is `XSRF-TOKEN`.
* - Header name default is `X-XSRF-TOKEN`.
*
*/
static withOptions(options = {}) {
return {
ngModule: _HttpClientXsrfModule,
providers: withXsrfConfiguration(options).\u0275providers
};
}
static \u0275fac = function HttpClientXsrfModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _HttpClientXsrfModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _HttpClientXsrfModule
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
providers: [HttpXsrfInterceptor, {
provide: HTTP_INTERCEPTORS,
useExisting: HttpXsrfInterceptor,
multi: true
}, {
provide: HttpXsrfTokenExtractor,
useClass: HttpXsrfCookieExtractor
}, withXsrfConfiguration({
cookieName: XSRF_DEFAULT_COOKIE_NAME,
headerName: XSRF_DEFAULT_HEADER_NAME
}).\u0275providers, {
provide: XSRF_ENABLED,
useValue: true
}]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpClientXsrfModule, [{
type: NgModule,
args: [{
providers: [HttpXsrfInterceptor, {
provide: HTTP_INTERCEPTORS,
useExisting: HttpXsrfInterceptor,
multi: true
}, {
provide: HttpXsrfTokenExtractor,
useClass: HttpXsrfCookieExtractor
}, withXsrfConfiguration({
cookieName: XSRF_DEFAULT_COOKIE_NAME,
headerName: XSRF_DEFAULT_HEADER_NAME
}).\u0275providers, {
provide: XSRF_ENABLED,
useValue: true
}]
}]
}], null, null);
})();
var HttpClientModule = class _HttpClientModule {
static \u0275fac = function HttpClientModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _HttpClientModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _HttpClientModule
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
providers: [provideHttpClient(withInterceptorsFromDi())]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpClientModule, [{
type: NgModule,
args: [{
/**
* Configures the dependency injector where it is imported
* with supporting services for HTTP communications.
*/
providers: [provideHttpClient(withInterceptorsFromDi())]
}]
}], null, null);
})();
var HttpClientJsonpModule = class _HttpClientJsonpModule {
static \u0275fac = function HttpClientJsonpModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _HttpClientJsonpModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _HttpClientJsonpModule
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
providers: [withJsonpSupport().\u0275providers]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpClientJsonpModule, [{
type: NgModule,
args: [{
providers: [withJsonpSupport().\u0275providers]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs@7.8.2__rxjs@7.8.2/node_modules/@angular/common/fesm2022/http.mjs
var httpResource = (() => {
const jsonFn = makeHttpResourceFn("json");
jsonFn.arrayBuffer = makeHttpResourceFn("arraybuffer");
jsonFn.blob = makeHttpResourceFn("blob");
jsonFn.text = makeHttpResourceFn("text");
return jsonFn;
})();
function makeHttpResourceFn(responseType) {
return function httpResource2(request, options) {
if (ngDevMode && !options?.injector) {
assertInInjectionContext(httpResource2);
}
const injector = options?.injector ?? inject2(Injector);
return new HttpResourceImpl(injector, () => normalizeRequest(request, responseType), options?.defaultValue, options?.parse, options?.equal);
};
}
function normalizeRequest(request, responseType) {
let unwrappedRequest = typeof request === "function" ? request() : request;
if (unwrappedRequest === void 0) {
return void 0;
} else if (typeof unwrappedRequest === "string") {
unwrappedRequest = { url: unwrappedRequest };
}
const headers = unwrappedRequest.headers instanceof HttpHeaders ? unwrappedRequest.headers : new HttpHeaders(unwrappedRequest.headers);
const params = unwrappedRequest.params instanceof HttpParams ? unwrappedRequest.params : new HttpParams({ fromObject: unwrappedRequest.params });
return new HttpRequest(unwrappedRequest.method ?? "GET", unwrappedRequest.url, unwrappedRequest.body ?? null, {
headers,
params,
reportProgress: unwrappedRequest.reportProgress,
withCredentials: unwrappedRequest.withCredentials,
keepalive: unwrappedRequest.keepalive,
cache: unwrappedRequest.cache,
priority: unwrappedRequest.priority,
mode: unwrappedRequest.mode,
redirect: unwrappedRequest.redirect,
responseType,
context: unwrappedRequest.context,
transferCache: unwrappedRequest.transferCache,
credentials: unwrappedRequest.credentials,
referrer: unwrappedRequest.referrer,
integrity: unwrappedRequest.integrity,
timeout: unwrappedRequest.timeout
});
}
var HttpResourceImpl = class extends ResourceImpl {
client;
_headers = linkedSignal({
source: this.extRequest,
computation: () => void 0
});
_progress = linkedSignal({
source: this.extRequest,
computation: () => void 0
});
_statusCode = linkedSignal({
source: this.extRequest,
computation: () => void 0
});
headers = computed(() => this.status() === "resolved" || this.status() === "error" ? this._headers() : void 0, ...ngDevMode ? [{ debugName: "headers" }] : []);
progress = this._progress.asReadonly();
statusCode = this._statusCode.asReadonly();
constructor(injector, request, defaultValue, parse, equal) {
super(request, ({ params: request2, abortSignal }) => {
let sub;
const onAbort = () => sub.unsubscribe();
abortSignal.addEventListener("abort", onAbort);
const stream = signal({ value: void 0 }, ...ngDevMode ? [{ debugName: "stream" }] : []);
let resolve;
const promise = new Promise((r) => resolve = r);
const send = (value) => {
stream.set(value);
resolve?.(stream);
resolve = void 0;
};
sub = this.client.request(request2).subscribe({
next: (event) => {
switch (event.type) {
case HttpEventType.Response:
this._headers.set(event.headers);
this._statusCode.set(event.status);
try {
send({ value: parse ? parse(event.body) : event.body });
} catch (error) {
send({ error: encapsulateResourceError(error) });
}
break;
case HttpEventType.DownloadProgress:
this._progress.set(event);
break;
}
},
error: (error) => {
if (error instanceof HttpErrorResponse) {
this._headers.set(error.headers);
this._statusCode.set(error.status);
}
send({ error });
abortSignal.removeEventListener("abort", onAbort);
},
complete: () => {
if (resolve) {
send({
error: new RuntimeError(991, ngDevMode && "Resource completed before producing a value")
});
}
abortSignal.removeEventListener("abort", onAbort);
}
});
return promise;
}, defaultValue, equal, injector);
this.client = injector.get(HttpClient);
}
set(value) {
super.set(value);
this._headers.set(void 0);
this._progress.set(void 0);
this._statusCode.set(void 0);
}
};
var HTTP_TRANSFER_CACHE_ORIGIN_MAP = new InjectionToken(ngDevMode ? "HTTP_TRANSFER_CACHE_ORIGIN_MAP" : "");
var CACHE_OPTIONS = new InjectionToken(ngDevMode ? "HTTP_TRANSFER_STATE_CACHE_OPTIONS" : "");
// node_modules/.pnpm/@angular+platform-browser@20.2.1_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compile_b4fkdnyec4c2x5ti6yyl4kmq7u/node_modules/@angular/platform-browser/fesm2022/platform-browser.mjs
var Meta = class _Meta {
_doc;
_dom;
constructor(_doc) {
this._doc = _doc;
this._dom = getDOM();
}
/**
* Retrieves or creates a specific `<meta>` 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 `<meta>` 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 `<meta>` 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 `<meta>` 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 `<meta>` 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 = this._doc.querySelectorAll(`meta[${attrSelector}]`);
return list ? [].slice.call(list) : [];
}
/**
* Modifies an existing `<meta>` 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 `<meta>` 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 `<meta>` 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);
const elem = this.getTags(selector).filter((elem2) => this._containsAttributes(meta, elem2))[0];
if (elem !== void 0) 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;
}
static \u0275fac = function Meta_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _Meta)(\u0275\u0275inject(DOCUMENT));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _Meta,
factory: _Meta.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Meta, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [{
type: void 0,
decorators: [{
type: Inject,
args: [DOCUMENT]
}]
}], null);
})();
var META_KEYS_MAP = {
httpEquiv: "http-equiv"
};
var Title = class _Title {
_doc;
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 || "";
}
static \u0275fac = function Title_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _Title)(\u0275\u0275inject(DOCUMENT));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _Title,
factory: _Title.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Title, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [{
type: void 0,
decorators: [{
type: Inject,
args: [DOCUMENT]
}]
}], null);
})();
var 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
};
var HAMMER_GESTURE_CONFIG = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "HammerGestureConfig" : "");
var HAMMER_LOADER = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "HammerLoader" : "");
var HammerGestureConfig = class _HammerGestureConfig {
/**
* 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/).
*/
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/).
*
*/
overrides = {};
/**
* Properties whose default values can be overridden for a given event.
* Different sets of properties apply to different events.
* For information about which properties are supported for which events,
* and their allowed and default values, see
* [HammerJS documentation](https://hammerjs.github.io/).
*/
options;
/**
* 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;
}
static \u0275fac = function HammerGestureConfig_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _HammerGestureConfig)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _HammerGestureConfig,
factory: _HammerGestureConfig.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HammerGestureConfig, [{
type: Injectable
}], null, null);
})();
var HammerGesturesPlugin = class _HammerGesturesPlugin extends EventManagerPlugin {
_config;
_injector;
loader;
_loaderPromise = null;
constructor(doc, _config, _injector, loader) {
super(doc);
this._config = _config;
this._injector = _injector;
this.loader = loader;
}
supports(eventName) {
if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {
return false;
}
if (!window.Hammer && !this.loader) {
if (typeof ngDevMode === "undefined" || ngDevMode) {
const _console = this._injector.get(Console);
_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 (!window.Hammer && this.loader) {
this._loaderPromise = this._loaderPromise || zone.runOutsideAngular(() => this.loader());
let cancelRegistration = false;
let deregister = () => {
cancelRegistration = true;
};
zone.runOutsideAngular(() => this._loaderPromise.then(() => {
if (!window.Hammer) {
if (typeof ngDevMode === "undefined" || ngDevMode) {
const _console = this._injector.get(Console);
_console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`);
}
deregister = () => {
};
return;
}
if (!cancelRegistration) {
deregister = this.addEventListener(element, eventName, handler);
}
}).catch(() => {
if (typeof ngDevMode === "undefined" || ngDevMode) {
const _console = this._injector.get(Console);
_console.warn(`The "${eventName}" event cannot be bound because the custom Hammer.JS loader failed.`);
}
deregister = () => {
};
}));
return () => {
deregister();
};
}
return zone.runOutsideAngular(() => {
const mc = this._config.buildHammer(element);
const callback = function(eventObj) {
zone.runGuarded(function() {
handler(eventObj);
});
};
mc.on(eventName, callback);
return () => {
mc.off(eventName, callback);
if (typeof mc.destroy === "function") {
mc.destroy();
}
};
});
}
isCustomEvent(eventName) {
return this._config.events.indexOf(eventName) > -1;
}
static \u0275fac = function HammerGesturesPlugin_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _HammerGesturesPlugin)(\u0275\u0275inject(DOCUMENT), \u0275\u0275inject(HAMMER_GESTURE_CONFIG), \u0275\u0275inject(Injector), \u0275\u0275inject(HAMMER_LOADER, 8));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _HammerGesturesPlugin,
factory: _HammerGesturesPlugin.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HammerGesturesPlugin, [{
type: Injectable
}], () => [{
type: void 0,
decorators: [{
type: Inject,
args: [DOCUMENT]
}]
}, {
type: HammerGestureConfig,
decorators: [{
type: Inject,
args: [HAMMER_GESTURE_CONFIG]
}]
}, {
type: Injector
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Inject,
args: [HAMMER_LOADER]
}]
}], null);
})();
var HammerModule = class _HammerModule {
static \u0275fac = function HammerModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _HammerModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _HammerModule
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
providers: [{
provide: EVENT_MANAGER_PLUGINS,
useClass: HammerGesturesPlugin,
multi: true,
deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, Injector, [new Optional(), HAMMER_LOADER]]
}, {
provide: HAMMER_GESTURE_CONFIG,
useClass: HammerGestureConfig
}]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HammerModule, [{
type: NgModule,
args: [{
providers: [{
provide: EVENT_MANAGER_PLUGINS,
useClass: HammerGesturesPlugin,
multi: true,
deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, Injector, [new Optional(), HAMMER_LOADER]]
}, {
provide: HAMMER_GESTURE_CONFIG,
useClass: HammerGestureConfig
}]
}]
}], null, null);
})();
var DomSanitizer = class _DomSanitizer {
static \u0275fac = function DomSanitizer_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _DomSanitizer)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _DomSanitizer,
factory: function DomSanitizer_Factory(__ngFactoryType__) {
let __ngConditionalFactory__ = null;
if (__ngFactoryType__) {
__ngConditionalFactory__ = new (__ngFactoryType__ || _DomSanitizer)();
} else {
__ngConditionalFactory__ = \u0275\u0275inject(DomSanitizerImpl);
}
return __ngConditionalFactory__;
},
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DomSanitizer, [{
type: Injectable,
args: [{
providedIn: "root",
useExisting: forwardRef(() => DomSanitizerImpl)
}]
}], null, null);
})();
var DomSanitizerImpl = class _DomSanitizerImpl extends DomSanitizer {
_doc;
constructor(_doc) {
super();
this._doc = _doc;
}
sanitize(ctx, value) {
if (value == null) return null;
switch (ctx) {
case SecurityContext.NONE:
return value;
case SecurityContext.HTML:
if (allowSanitizationBypassAndThrow(
value,
"HTML"
/* BypassType.Html */
)) {
return unwrapSafeValue(value);
}
return _sanitizeHtml(this._doc, String(value)).toString();
case SecurityContext.STYLE:
if (allowSanitizationBypassAndThrow(
value,
"Style"
/* BypassType.Style */
)) {
return unwrapSafeValue(value);
}
return value;
case SecurityContext.SCRIPT:
if (allowSanitizationBypassAndThrow(
value,
"Script"
/* BypassType.Script */
)) {
return unwrapSafeValue(value);
}
throw new RuntimeError(5200, (typeof ngDevMode === "undefined" || ngDevMode) && "unsafe value used in a script context");
case SecurityContext.URL:
if (allowSanitizationBypassAndThrow(
value,
"URL"
/* BypassType.Url */
)) {
return unwrapSafeValue(value);
}
return _sanitizeUrl(String(value));
case SecurityContext.RESOURCE_URL:
if (allowSanitizationBypassAndThrow(
value,
"ResourceURL"
/* BypassType.ResourceUrl */
)) {
return unwrapSafeValue(value);
}
throw new RuntimeError(5201, (typeof ngDevMode === "undefined" || ngDevMode) && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);
default:
throw new RuntimeError(5202, (typeof ngDevMode === "undefined" || ngDevMode) && `Unexpected SecurityContext ${ctx} (see ${XSS_SECURITY_URL})`);
}
}
bypassSecurityTrustHtml(value) {
return bypassSanitizationTrustHtml(value);
}
bypassSecurityTrustStyle(value) {
return bypassSanitizationTrustStyle(value);
}
bypassSecurityTrustScript(value) {
return bypassSanitizationTrustScript(value);
}
bypassSecurityTrustUrl(value) {
return bypassSanitizationTrustUrl(value);
}
bypassSecurityTrustResourceUrl(value) {
return bypassSanitizationTrustResourceUrl(value);
}
static \u0275fac = function DomSanitizerImpl_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _DomSanitizerImpl)(\u0275\u0275inject(DOCUMENT));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _DomSanitizerImpl,
factory: _DomSanitizerImpl.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DomSanitizerImpl, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [{
type: void 0,
decorators: [{
type: Inject,
args: [DOCUMENT]
}]
}], null);
})();
var HydrationFeatureKind;
(function(HydrationFeatureKind2) {
HydrationFeatureKind2[HydrationFeatureKind2["NoHttpTransferCache"] = 0] = "NoHttpTransferCache";
HydrationFeatureKind2[HydrationFeatureKind2["HttpTransferCacheOptions"] = 1] = "HttpTransferCacheOptions";
HydrationFeatureKind2[HydrationFeatureKind2["I18nSupport"] = 2] = "I18nSupport";
HydrationFeatureKind2[HydrationFeatureKind2["EventReplay"] = 3] = "EventReplay";
HydrationFeatureKind2[HydrationFeatureKind2["IncrementalHydration"] = 4] = "IncrementalHydration";
})(HydrationFeatureKind || (HydrationFeatureKind = {}));
var VERSION3 = new Version("20.2.1");
// src/app/app.config.ts
var appConfig = {
providers: [
provideBrowserGlobalErrorListeners(),
provideZonelessChangeDetection(),
// provideRouter(routes),
provideHttpClient(withFetch())
]
};
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/clipboard.mjs
var PendingCopy = class {
_document;
_textarea;
constructor(text, _document2) {
this._document = _document2;
const textarea = this._textarea = this._document.createElement("textarea");
const styles = textarea.style;
styles.position = "fixed";
styles.top = styles.opacity = "0";
styles.left = "-999em";
textarea.setAttribute("aria-hidden", "true");
textarea.value = text;
textarea.readOnly = true;
(this._document.fullscreenElement || this._document.body).appendChild(textarea);
}
/** Finishes copying the text. */
copy() {
const textarea = this._textarea;
let successful = false;
try {
if (textarea) {
const currentFocus = this._document.activeElement;
textarea.select();
textarea.setSelectionRange(0, textarea.value.length);
successful = this._document.execCommand("copy");
if (currentFocus) {
currentFocus.focus();
}
}
} catch {
}
return successful;
}
/** Cleans up DOM changes used to perform the copy operation. */
destroy() {
const textarea = this._textarea;
if (textarea) {
textarea.remove();
this._textarea = void 0;
}
}
};
var Clipboard = class _Clipboard {
_document = inject2(DOCUMENT);
constructor() {
}
/**
* Copies the provided text into the user's clipboard.
*
* @param text The string to copy.
* @returns Whether the operation was successful.
*/
copy(text) {
const pendingCopy = this.beginCopy(text);
const successful = pendingCopy.copy();
pendingCopy.destroy();
return successful;
}
/**
* Prepares a string to be copied later. This is useful for large strings
* which take too long to successfully render and be copied in the same tick.
*
* The caller must call `destroy` on the returned `PendingCopy`.
*
* @param text The string to copy.
* @returns the pending copy operation.
*/
beginCopy(text) {
return new PendingCopy(text, this._document);
}
static \u0275fac = function Clipboard_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _Clipboard)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _Clipboard,
factory: _Clipboard.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Clipboard, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var CDK_COPY_TO_CLIPBOARD_CONFIG = new InjectionToken("CDK_COPY_TO_CLIPBOARD_CONFIG");
var CdkCopyToClipboard = class _CdkCopyToClipboard {
_clipboard = inject2(Clipboard);
_ngZone = inject2(NgZone);
/** Content to be copied. */
text = "";
/**
* How many times to attempt to copy the text. This may be necessary for longer text, because
* the browser needs time to fill an intermediate textarea element and copy the content.
*/
attempts = 1;
/**
* Emits when some text is copied to the clipboard. The
* emitted value indicates whether copying was successful.
*/
copied = new EventEmitter();
/** Copies that are currently being attempted. */
_pending = /* @__PURE__ */ new Set();
/** Whether the directive has been destroyed. */
_destroyed;
/** Timeout for the current copy attempt. */
_currentTimeout;
constructor() {
const config2 = inject2(CDK_COPY_TO_CLIPBOARD_CONFIG, {
optional: true
});
if (config2 && config2.attempts != null) {
this.attempts = config2.attempts;
}
}
/** Copies the current text to the clipboard. */
copy(attempts = this.attempts) {
if (attempts > 1) {
let remainingAttempts = attempts;
const pending = this._clipboard.beginCopy(this.text);
this._pending.add(pending);
const attempt = () => {
const successful = pending.copy();
if (!successful && --remainingAttempts && !this._destroyed) {
this._currentTimeout = this._ngZone.runOutsideAngular(() => setTimeout(attempt, 1));
} else {
this._currentTimeout = null;
this._pending.delete(pending);
pending.destroy();
this.copied.emit(successful);
}
};
attempt();
} else {
this.copied.emit(this._clipboard.copy(this.text));
}
}
ngOnDestroy() {
if (this._currentTimeout) {
clearTimeout(this._currentTimeout);
}
this._pending.forEach((copy) => copy.destroy());
this._pending.clear();
this._destroyed = true;
}
static \u0275fac = function CdkCopyToClipboard_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkCopyToClipboard)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkCopyToClipboard,
selectors: [["", "cdkCopyToClipboard", ""]],
hostBindings: function CdkCopyToClipboard_HostBindings(rf, ctx) {
if (rf & 1) {
\u0275\u0275listener("click", function CdkCopyToClipboard_click_HostBindingHandler() {
return ctx.copy();
});
}
},
inputs: {
text: [0, "cdkCopyToClipboard", "text"],
attempts: [0, "cdkCopyToClipboardAttempts", "attempts"]
},
outputs: {
copied: "cdkCopyToClipboardCopied"
}
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkCopyToClipboard, [{
type: Directive,
args: [{
selector: "[cdkCopyToClipboard]",
host: {
"(click)": "copy()"
}
}]
}], () => [], {
text: [{
type: Input,
args: ["cdkCopyToClipboard"]
}],
attempts: [{
type: Input,
args: ["cdkCopyToClipboardAttempts"]
}],
copied: [{
type: Output,
args: ["cdkCopyToClipboardCopied"]
}]
});
})();
var ClipboardModule = class _ClipboardModule {
static \u0275fac = function ClipboardModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ClipboardModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _ClipboardModule,
imports: [CdkCopyToClipboard],
exports: [CdkCopyToClipboard]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ClipboardModule, [{
type: NgModule,
args: [{
imports: [CdkCopyToClipboard],
exports: [CdkCopyToClipboard]
}]
}], null, null);
})();
// src/app/service/env.service.ts
var EnvService = class _EnvService {
document;
platformId;
host;
userAgent;
constructor(document2, platformId) {
this.document = document2;
this.platformId = platformId;
this.host = new BehaviorSubject(this.getHost() ?? "");
this.userAgent = new BehaviorSubject(this.getUserAgent() ?? "");
}
getHost() {
return isPlatformBrowser(this.platformId) ? this.document.location.host : null;
}
getUserAgent() {
return isPlatformBrowser(this.platformId) ? navigator.userAgent : null;
}
static \u0275fac = function EnvService_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _EnvService)(\u0275\u0275inject(DOCUMENT), \u0275\u0275inject(PLATFORM_ID));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _EnvService, factory: _EnvService.\u0275fac, providedIn: "root" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(EnvService, [{
type: Injectable,
args: [{ providedIn: "root" }]
}], () => [{ type: Document, decorators: [{
type: Inject,
args: [DOCUMENT]
}] }, { type: Object, decorators: [{
type: Inject,
args: [PLATFORM_ID]
}] }], null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/fake-event-detection.mjs
function isFakeMousedownFromScreenReader(event) {
return event.buttons === 0 || event.detail === 0;
}
function isFakeTouchstartFromScreenReader(event) {
const touch = event.touches && event.touches[0] || event.changedTouches && event.changedTouches[0];
return !!touch && touch.identifier === -1 && (touch.radiusX == null || touch.radiusX === 1) && (touch.radiusY == null || touch.radiusY === 1);
}
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/keycodes2.mjs
var TAB = 9;
var ENTER = 13;
var SHIFT = 16;
var CONTROL = 17;
var ALT = 18;
var ESCAPE = 27;
var SPACE = 32;
var PAGE_UP = 33;
var PAGE_DOWN = 34;
var END = 35;
var HOME = 36;
var LEFT_ARROW = 37;
var UP_ARROW = 38;
var RIGHT_ARROW = 39;
var DOWN_ARROW = 40;
var ZERO = 48;
var NINE = 57;
var A = 65;
var Z = 90;
var META = 91;
var MAC_META = 224;
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/shadow-dom.mjs
var shadowDomIsSupported;
function _supportsShadowDom() {
if (shadowDomIsSupported == null) {
const head = typeof document !== "undefined" ? document.head : null;
shadowDomIsSupported = !!(head && (head.createShadowRoot || head.attachShadow));
}
return shadowDomIsSupported;
}
function _getShadowRoot(element) {
if (_supportsShadowDom()) {
const rootNode = element.getRootNode ? element.getRootNode() : null;
if (typeof ShadowRoot !== "undefined" && ShadowRoot && rootNode instanceof ShadowRoot) {
return rootNode;
}
}
return null;
}
function _getFocusedElementPierceShadowDom() {
let activeElement = typeof document !== "undefined" && document ? document.activeElement : null;
while (activeElement && activeElement.shadowRoot) {
const newActiveElement = activeElement.shadowRoot.activeElement;
if (newActiveElement === activeElement) {
break;
} else {
activeElement = newActiveElement;
}
}
return activeElement;
}
function _getEventTarget(event) {
return event.composedPath ? event.composedPath()[0] : event.target;
}
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/platform2.mjs
var hasV8BreakIterator;
try {
hasV8BreakIterator = typeof Intl !== "undefined" && Intl.v8BreakIterator;
} catch {
hasV8BreakIterator = false;
}
var Platform = class _Platform {
_platformId = inject2(PLATFORM_ID);
// We want to use the Angular platform check because if the Document is shimmed
// without the navigator, the following checks will fail. This is preferred because
// sometimes the Document may be shimmed without the user's knowledge or intention
/** Whether the Angular application is being rendered in the browser. */
isBrowser = this._platformId ? isPlatformBrowser(this._platformId) : typeof document === "object" && !!document;
/** Whether the current browser is Microsoft Edge. */
EDGE = this.isBrowser && /(edge)/i.test(navigator.userAgent);
/** Whether the current rendering engine is Microsoft Trident. */
TRIDENT = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);
// EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.
/** Whether the current rendering engine is Blink. */
BLINK = this.isBrowser && !!(window.chrome || hasV8BreakIterator) && typeof CSS !== "undefined" && !this.EDGE && !this.TRIDENT;
// Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to
// ensure that Webkit runs standalone and is not used as another engine's base.
/** Whether the current rendering engine is WebKit. */
WEBKIT = this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;
/** Whether the current platform is Apple iOS. */
IOS = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !("MSStream" in window);
// It's difficult to detect the plain Gecko engine, because most of the browsers identify
// them self as Gecko-like browsers and modify the userAgent's according to that.
// Since we only cover one explicit Firefox case, we can simply check for Firefox
// instead of having an unstable check for Gecko.
/** Whether the current browser is Firefox. */
FIREFOX = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);
/** Whether the current platform is Android. */
// Trident on mobile adds the android platform to the userAgent to trick detections.
ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;
// Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake
// this and just place the Safari keyword in the userAgent. To be more safe about Safari every
// Safari browser should also use Webkit as its layout engine.
/** Whether the current browser is Safari. */
SAFARI = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;
constructor() {
}
static \u0275fac = function Platform_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _Platform)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _Platform,
factory: _Platform.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Platform, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/passive-listeners.mjs
var supportsPassiveEvents;
function supportsPassiveEventListeners() {
if (supportsPassiveEvents == null && typeof window !== "undefined") {
try {
window.addEventListener("test", null, Object.defineProperty({}, "passive", {
get: () => supportsPassiveEvents = true
}));
} finally {
supportsPassiveEvents = supportsPassiveEvents || false;
}
}
return supportsPassiveEvents;
}
function normalizePassiveListenerOptions(options) {
return supportsPassiveEventListeners() ? options : !!options.capture;
}
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/element.mjs
function coerceNumberProperty(value, fallbackValue = 0) {
if (_isNumberValue(value)) {
return Number(value);
}
return arguments.length === 2 ? fallbackValue : 0;
}
function _isNumberValue(value) {
return !isNaN(parseFloat(value)) && !isNaN(Number(value));
}
function coerceElement(elementOrRef) {
return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;
}
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/focus-monitor.mjs
var INPUT_MODALITY_DETECTOR_OPTIONS = new InjectionToken("cdk-input-modality-detector-options");
var INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS = {
ignoreKeys: [ALT, CONTROL, MAC_META, META, SHIFT]
};
var TOUCH_BUFFER_MS = 650;
var modalityEventListenerOptions = {
passive: true,
capture: true
};
var InputModalityDetector = class _InputModalityDetector {
_platform = inject2(Platform);
_listenerCleanups;
/** Emits whenever an input modality is detected. */
modalityDetected;
/** Emits when the input modality changes. */
modalityChanged;
/** The most recently detected input modality. */
get mostRecentModality() {
return this._modality.value;
}
/**
* The most recently detected input modality event target. Is null if no input modality has been
* detected or if the associated event target is null for some unknown reason.
*/
_mostRecentTarget = null;
/** The underlying BehaviorSubject that emits whenever an input modality is detected. */
_modality = new BehaviorSubject(null);
/** Options for this InputModalityDetector. */
_options;
/**
* The timestamp of the last touch input modality. Used to determine whether mousedown events
* should be attributed to mouse or touch.
*/
_lastTouchMs = 0;
/**
* Handles keydown events. Must be an arrow function in order to preserve the context when it gets
* bound.
*/
_onKeydown = (event) => {
if (this._options?.ignoreKeys?.some((keyCode) => keyCode === event.keyCode)) {
return;
}
this._modality.next("keyboard");
this._mostRecentTarget = _getEventTarget(event);
};
/**
* Handles mousedown events. Must be an arrow function in order to preserve the context when it
* gets bound.
*/
_onMousedown = (event) => {
if (Date.now() - this._lastTouchMs < TOUCH_BUFFER_MS) {
return;
}
this._modality.next(isFakeMousedownFromScreenReader(event) ? "keyboard" : "mouse");
this._mostRecentTarget = _getEventTarget(event);
};
/**
* Handles touchstart events. Must be an arrow function in order to preserve the context when it
* gets bound.
*/
_onTouchstart = (event) => {
if (isFakeTouchstartFromScreenReader(event)) {
this._modality.next("keyboard");
return;
}
this._lastTouchMs = Date.now();
this._modality.next("touch");
this._mostRecentTarget = _getEventTarget(event);
};
constructor() {
const ngZone = inject2(NgZone);
const document2 = inject2(DOCUMENT);
const options = inject2(INPUT_MODALITY_DETECTOR_OPTIONS, {
optional: true
});
this._options = __spreadValues(__spreadValues({}, INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS), options);
this.modalityDetected = this._modality.pipe(skip(1));
this.modalityChanged = this.modalityDetected.pipe(distinctUntilChanged());
if (this._platform.isBrowser) {
const renderer = inject2(RendererFactory2).createRenderer(null, null);
this._listenerCleanups = ngZone.runOutsideAngular(() => {
return [renderer.listen(document2, "keydown", this._onKeydown, modalityEventListenerOptions), renderer.listen(document2, "mousedown", this._onMousedown, modalityEventListenerOptions), renderer.listen(document2, "touchstart", this._onTouchstart, modalityEventListenerOptions)];
});
}
}
ngOnDestroy() {
this._modality.complete();
this._listenerCleanups?.forEach((cleanup) => cleanup());
}
static \u0275fac = function InputModalityDetector_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _InputModalityDetector)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _InputModalityDetector,
factory: _InputModalityDetector.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(InputModalityDetector, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var FocusMonitorDetectionMode;
(function(FocusMonitorDetectionMode2) {
FocusMonitorDetectionMode2[FocusMonitorDetectionMode2["IMMEDIATE"] = 0] = "IMMEDIATE";
FocusMonitorDetectionMode2[FocusMonitorDetectionMode2["EVENTUAL"] = 1] = "EVENTUAL";
})(FocusMonitorDetectionMode || (FocusMonitorDetectionMode = {}));
var FOCUS_MONITOR_DEFAULT_OPTIONS = new InjectionToken("cdk-focus-monitor-default-options");
var captureEventListenerOptions = normalizePassiveListenerOptions({
passive: true,
capture: true
});
var FocusMonitor = class _FocusMonitor {
_ngZone = inject2(NgZone);
_platform = inject2(Platform);
_inputModalityDetector = inject2(InputModalityDetector);
/** The focus origin that the next focus event is a result of. */
_origin = null;
/** The FocusOrigin of the last focus event tracked by the FocusMonitor. */
_lastFocusOrigin;
/** Whether the window has just been focused. */
_windowFocused = false;
/** The timeout id of the window focus timeout. */
_windowFocusTimeoutId;
/** The timeout id of the origin clearing timeout. */
_originTimeoutId;
/**
* Whether the origin was determined via a touch interaction. Necessary as properly attributing
* focus events to touch interactions requires special logic.
*/
_originFromTouchInteraction = false;
/** Map of elements being monitored to their info. */
_elementInfo = /* @__PURE__ */ new Map();
/** The number of elements currently being monitored. */
_monitoredElementCount = 0;
/**
* Keeps track of the root nodes to which we've currently bound a focus/blur handler,
* as well as the number of monitored elements that they contain. We have to treat focus/blur
* handlers differently from the rest of the events, because the browser won't emit events
* to the document when focus moves inside of a shadow root.
*/
_rootNodeFocusListenerCount = /* @__PURE__ */ new Map();
/**
* The specified detection mode, used for attributing the origin of a focus
* event.
*/
_detectionMode;
/**
* Event listener for `focus` events on the window.
* Needs to be an arrow function in order to preserve the context when it gets bound.
*/
_windowFocusListener = () => {
this._windowFocused = true;
this._windowFocusTimeoutId = setTimeout(() => this._windowFocused = false);
};
/** Used to reference correct document/window */
_document = inject2(DOCUMENT);
/** Subject for stopping our InputModalityDetector subscription. */
_stopInputModalityDetector = new Subject();
constructor() {
const options = inject2(FOCUS_MONITOR_DEFAULT_OPTIONS, {
optional: true
});
this._detectionMode = options?.detectionMode || FocusMonitorDetectionMode.IMMEDIATE;
}
/**
* Event listener for `focus` and 'blur' events on the document.
* Needs to be an arrow function in order to preserve the context when it gets bound.
*/
_rootNodeFocusAndBlurListener = (event) => {
const target = _getEventTarget(event);
for (let element = target; element; element = element.parentElement) {
if (event.type === "focus") {
this._onFocus(event, element);
} else {
this._onBlur(event, element);
}
}
};
monitor(element, checkChildren = false) {
const nativeElement = coerceElement(element);
if (!this._platform.isBrowser || nativeElement.nodeType !== 1) {
return of();
}
const rootNode = _getShadowRoot(nativeElement) || this._document;
const cachedInfo = this._elementInfo.get(nativeElement);
if (cachedInfo) {
if (checkChildren) {
cachedInfo.checkChildren = true;
}
return cachedInfo.subject;
}
const info = {
checkChildren,
subject: new Subject(),
rootNode
};
this._elementInfo.set(nativeElement, info);
this._registerGlobalListeners(info);
return info.subject;
}
stopMonitoring(element) {
const nativeElement = coerceElement(element);
const elementInfo = this._elementInfo.get(nativeElement);
if (elementInfo) {
elementInfo.subject.complete();
this._setClasses(nativeElement);
this._elementInfo.delete(nativeElement);
this._removeGlobalListeners(elementInfo);
}
}
focusVia(element, origin, options) {
const nativeElement = coerceElement(element);
const focusedElement = this._document.activeElement;
if (nativeElement === focusedElement) {
this._getClosestElementsInfo(nativeElement).forEach(([currentElement, info]) => this._originChanged(currentElement, origin, info));
} else {
this._setOrigin(origin);
if (typeof nativeElement.focus === "function") {
nativeElement.focus(options);
}
}
}
ngOnDestroy() {
this._elementInfo.forEach((_info, element) => this.stopMonitoring(element));
}
/** Use defaultView of injected document if available or fallback to global window reference */
_getWindow() {
return this._document.defaultView || window;
}
_getFocusOrigin(focusEventTarget) {
if (this._origin) {
if (this._originFromTouchInteraction) {
return this._shouldBeAttributedToTouch(focusEventTarget) ? "touch" : "program";
} else {
return this._origin;
}
}
if (this._windowFocused && this._lastFocusOrigin) {
return this._lastFocusOrigin;
}
if (focusEventTarget && this._isLastInteractionFromInputLabel(focusEventTarget)) {
return "mouse";
}
return "program";
}
/**
* Returns whether the focus event should be attributed to touch. Recall that in IMMEDIATE mode, a
* touch origin isn't immediately reset at the next tick (see _setOrigin). This means that when we
* handle a focus event following a touch interaction, we need to determine whether (1) the focus
* event was directly caused by the touch interaction or (2) the focus event was caused by a
* subsequent programmatic focus call triggered by the touch interaction.
* @param focusEventTarget The target of the focus event under examination.
*/
_shouldBeAttributedToTouch(focusEventTarget) {
return this._detectionMode === FocusMonitorDetectionMode.EVENTUAL || !!focusEventTarget?.contains(this._inputModalityDetector._mostRecentTarget);
}
/**
* Sets the focus classes on the element based on the given focus origin.
* @param element The element to update the classes on.
* @param origin The focus origin.
*/
_setClasses(element, origin) {
element.classList.toggle("cdk-focused", !!origin);
element.classList.toggle("cdk-touch-focused", origin === "touch");
element.classList.toggle("cdk-keyboard-focused", origin === "keyboard");
element.classList.toggle("cdk-mouse-focused", origin === "mouse");
element.classList.toggle("cdk-program-focused", origin === "program");
}
/**
* Updates the focus origin. If we're using immediate detection mode, we schedule an async
* function to clear the origin at the end of a timeout. The duration of the timeout depends on
* the origin being set.
* @param origin The origin to set.
* @param isFromInteraction Whether we are setting the origin from an interaction event.
*/
_setOrigin(origin, isFromInteraction = false) {
this._ngZone.runOutsideAngular(() => {
this._origin = origin;
this._originFromTouchInteraction = origin === "touch" && isFromInteraction;
if (this._detectionMode === FocusMonitorDetectionMode.IMMEDIATE) {
clearTimeout(this._originTimeoutId);
const ms = this._originFromTouchInteraction ? TOUCH_BUFFER_MS : 1;
this._originTimeoutId = setTimeout(() => this._origin = null, ms);
}
});
}
/**
* Handles focus events on a registered element.
* @param event The focus event.
* @param element The monitored element.
*/
_onFocus(event, element) {
const elementInfo = this._elementInfo.get(element);
const focusEventTarget = _getEventTarget(event);
if (!elementInfo || !elementInfo.checkChildren && element !== focusEventTarget) {
return;
}
this._originChanged(element, this._getFocusOrigin(focusEventTarget), elementInfo);
}
/**
* Handles blur events on a registered element.
* @param event The blur event.
* @param element The monitored element.
*/
_onBlur(event, element) {
const elementInfo = this._elementInfo.get(element);
if (!elementInfo || elementInfo.checkChildren && event.relatedTarget instanceof Node && element.contains(event.relatedTarget)) {
return;
}
this._setClasses(element);
this._emitOrigin(elementInfo, null);
}
_emitOrigin(info, origin) {
if (info.subject.observers.length) {
this._ngZone.run(() => info.subject.next(origin));
}
}
_registerGlobalListeners(elementInfo) {
if (!this._platform.isBrowser) {
return;
}
const rootNode = elementInfo.rootNode;
const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode) || 0;
if (!rootNodeFocusListeners) {
this._ngZone.runOutsideAngular(() => {
rootNode.addEventListener("focus", this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
rootNode.addEventListener("blur", this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
});
}
this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners + 1);
if (++this._monitoredElementCount === 1) {
this._ngZone.runOutsideAngular(() => {
const window2 = this._getWindow();
window2.addEventListener("focus", this._windowFocusListener);
});
this._inputModalityDetector.modalityDetected.pipe(takeUntil(this._stopInputModalityDetector)).subscribe((modality) => {
this._setOrigin(
modality,
true
/* isFromInteraction */
);
});
}
}
_removeGlobalListeners(elementInfo) {
const rootNode = elementInfo.rootNode;
if (this._rootNodeFocusListenerCount.has(rootNode)) {
const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode);
if (rootNodeFocusListeners > 1) {
this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners - 1);
} else {
rootNode.removeEventListener("focus", this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
rootNode.removeEventListener("blur", this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
this._rootNodeFocusListenerCount.delete(rootNode);
}
}
if (!--this._monitoredElementCount) {
const window2 = this._getWindow();
window2.removeEventListener("focus", this._windowFocusListener);
this._stopInputModalityDetector.next();
clearTimeout(this._windowFocusTimeoutId);
clearTimeout(this._originTimeoutId);
}
}
/** Updates all the state on an element once its focus origin has changed. */
_originChanged(element, origin, elementInfo) {
this._setClasses(element, origin);
this._emitOrigin(elementInfo, origin);
this._lastFocusOrigin = origin;
}
/**
* Collects the `MonitoredElementInfo` of a particular element and
* all of its ancestors that have enabled `checkChildren`.
* @param element Element from which to start the search.
*/
_getClosestElementsInfo(element) {
const results = [];
this._elementInfo.forEach((info, currentElement) => {
if (currentElement === element || info.checkChildren && currentElement.contains(element)) {
results.push([currentElement, info]);
}
});
return results;
}
/**
* Returns whether an interaction is likely to have come from the user clicking the `label` of
* an `input` or `textarea` in order to focus it.
* @param focusEventTarget Target currently receiving focus.
*/
_isLastInteractionFromInputLabel(focusEventTarget) {
const {
_mostRecentTarget: mostRecentTarget,
mostRecentModality
} = this._inputModalityDetector;
if (mostRecentModality !== "mouse" || !mostRecentTarget || mostRecentTarget === focusEventTarget || focusEventTarget.nodeName !== "INPUT" && focusEventTarget.nodeName !== "TEXTAREA" || focusEventTarget.disabled) {
return false;
}
const labels = focusEventTarget.labels;
if (labels) {
for (let i = 0; i < labels.length; i++) {
if (labels[i].contains(mostRecentTarget)) {
return true;
}
}
}
return false;
}
static \u0275fac = function FocusMonitor_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _FocusMonitor)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _FocusMonitor,
factory: _FocusMonitor.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FocusMonitor, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var CdkMonitorFocus = class _CdkMonitorFocus {
_elementRef = inject2(ElementRef);
_focusMonitor = inject2(FocusMonitor);
_monitorSubscription;
_focusOrigin = null;
cdkFocusChange = new EventEmitter();
constructor() {
}
get focusOrigin() {
return this._focusOrigin;
}
ngAfterViewInit() {
const element = this._elementRef.nativeElement;
this._monitorSubscription = this._focusMonitor.monitor(element, element.nodeType === 1 && element.hasAttribute("cdkMonitorSubtreeFocus")).subscribe((origin) => {
this._focusOrigin = origin;
this.cdkFocusChange.emit(origin);
});
}
ngOnDestroy() {
this._focusMonitor.stopMonitoring(this._elementRef);
if (this._monitorSubscription) {
this._monitorSubscription.unsubscribe();
}
}
static \u0275fac = function CdkMonitorFocus_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkMonitorFocus)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkMonitorFocus,
selectors: [["", "cdkMonitorElementFocus", ""], ["", "cdkMonitorSubtreeFocus", ""]],
outputs: {
cdkFocusChange: "cdkFocusChange"
},
exportAs: ["cdkMonitorFocus"]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkMonitorFocus, [{
type: Directive,
args: [{
selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]",
exportAs: "cdkMonitorFocus"
}]
}], () => [], {
cdkFocusChange: [{
type: Output
}]
});
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/style-loader.mjs
var appsWithLoaders = /* @__PURE__ */ new WeakMap();
var _CdkPrivateStyleLoader = class __CdkPrivateStyleLoader {
_appRef;
_injector = inject2(Injector);
_environmentInjector = inject2(EnvironmentInjector);
/**
* Loads a set of styles.
* @param loader Component which will be instantiated to load the styles.
*/
load(loader) {
const appRef = this._appRef = this._appRef || this._injector.get(ApplicationRef);
let data = appsWithLoaders.get(appRef);
if (!data) {
data = {
loaders: /* @__PURE__ */ new Set(),
refs: []
};
appsWithLoaders.set(appRef, data);
appRef.onDestroy(() => {
appsWithLoaders.get(appRef)?.refs.forEach((ref) => ref.destroy());
appsWithLoaders.delete(appRef);
});
}
if (!data.loaders.has(loader)) {
data.loaders.add(loader);
data.refs.push(createComponent(loader, {
environmentInjector: this._environmentInjector
}));
}
}
static \u0275fac = function _CdkPrivateStyleLoader_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || __CdkPrivateStyleLoader)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: __CdkPrivateStyleLoader,
factory: __CdkPrivateStyleLoader.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(_CdkPrivateStyleLoader, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/private.mjs
var _VisuallyHiddenLoader = class __VisuallyHiddenLoader {
static \u0275fac = function _VisuallyHiddenLoader_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || __VisuallyHiddenLoader)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: __VisuallyHiddenLoader,
selectors: [["ng-component"]],
exportAs: ["cdkVisuallyHidden"],
decls: 0,
vars: 0,
template: function _VisuallyHiddenLoader_Template(rf, ctx) {
},
styles: [".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}\n"],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(_VisuallyHiddenLoader, [{
type: Component,
args: [{
exportAs: "cdkVisuallyHidden",
encapsulation: ViewEncapsulation.None,
template: "",
changeDetection: ChangeDetectionStrategy.OnPush,
styles: [".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}\n"]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/array.mjs
function coerceArray(value) {
return Array.isArray(value) ? value : [value];
}
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/breakpoints-observer.mjs
var mediaQueriesForWebkitCompatibility = /* @__PURE__ */ new Set();
var mediaQueryStyleNode;
var MediaMatcher = class _MediaMatcher {
_platform = inject2(Platform);
_nonce = inject2(CSP_NONCE, {
optional: true
});
/** The internal matchMedia method to return back a MediaQueryList like object. */
_matchMedia;
constructor() {
this._matchMedia = this._platform.isBrowser && window.matchMedia ? (
// matchMedia is bound to the window scope intentionally as it is an illegal invocation to
// call it from a different scope.
window.matchMedia.bind(window)
) : noopMatchMedia;
}
/**
* Evaluates the given media query and returns the native MediaQueryList from which results
* can be retrieved.
* Confirms the layout engine will trigger for the selector query provided and returns the
* MediaQueryList for the query provided.
*/
matchMedia(query) {
if (this._platform.WEBKIT || this._platform.BLINK) {
createEmptyStyleRule(query, this._nonce);
}
return this._matchMedia(query);
}
static \u0275fac = function MediaMatcher_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MediaMatcher)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _MediaMatcher,
factory: _MediaMatcher.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MediaMatcher, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
function createEmptyStyleRule(query, nonce) {
if (mediaQueriesForWebkitCompatibility.has(query)) {
return;
}
try {
if (!mediaQueryStyleNode) {
mediaQueryStyleNode = document.createElement("style");
if (nonce) {
mediaQueryStyleNode.setAttribute("nonce", nonce);
}
mediaQueryStyleNode.setAttribute("type", "text/css");
document.head.appendChild(mediaQueryStyleNode);
}
if (mediaQueryStyleNode.sheet) {
mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);
mediaQueriesForWebkitCompatibility.add(query);
}
} catch (e) {
console.error(e);
}
}
function noopMatchMedia(query) {
return {
matches: query === "all" || query === "",
media: query,
addListener: () => {
},
removeListener: () => {
}
};
}
var BreakpointObserver = class _BreakpointObserver {
_mediaMatcher = inject2(MediaMatcher);
_zone = inject2(NgZone);
/** A map of all media queries currently being listened for. */
_queries = /* @__PURE__ */ new Map();
/** A subject for all other observables to takeUntil based on. */
_destroySubject = new Subject();
constructor() {
}
/** Completes the active subject, signalling to all other observables to complete. */
ngOnDestroy() {
this._destroySubject.next();
this._destroySubject.complete();
}
/**
* Whether one or more media queries match the current viewport size.
* @param value One or more media queries to check.
* @returns Whether any of the media queries match.
*/
isMatched(value) {
const queries = splitQueries(coerceArray(value));
return queries.some((mediaQuery) => this._registerQuery(mediaQuery).mql.matches);
}
/**
* Gets an observable of results for the given queries that will emit new results for any changes
* in matching of the given queries.
* @param value One or more media queries to check.
* @returns A stream of matches for the given queries.
*/
observe(value) {
const queries = splitQueries(coerceArray(value));
const observables = queries.map((query) => this._registerQuery(query).observable);
let stateObservable = combineLatest(observables);
stateObservable = concat(stateObservable.pipe(take(1)), stateObservable.pipe(skip(1), debounceTime(0)));
return stateObservable.pipe(map((breakpointStates) => {
const response = {
matches: false,
breakpoints: {}
};
breakpointStates.forEach(({
matches,
query
}) => {
response.matches = response.matches || matches;
response.breakpoints[query] = matches;
});
return response;
}));
}
/** Registers a specific query to be listened for. */
_registerQuery(query) {
if (this._queries.has(query)) {
return this._queries.get(query);
}
const mql = this._mediaMatcher.matchMedia(query);
const queryObservable = new Observable((observer) => {
const handler = (e) => this._zone.run(() => observer.next(e));
mql.addListener(handler);
return () => {
mql.removeListener(handler);
};
}).pipe(startWith(mql), map(({
matches
}) => ({
query,
matches
})), takeUntil(this._destroySubject));
const output = {
observable: queryObservable,
mql
};
this._queries.set(query, output);
return output;
}
static \u0275fac = function BreakpointObserver_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _BreakpointObserver)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _BreakpointObserver,
factory: _BreakpointObserver.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BreakpointObserver, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
function splitQueries(queries) {
return queries.map((query) => query.split(",")).reduce((a1, a2) => a1.concat(a2)).map((query) => query.trim());
}
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/observers.mjs
function shouldIgnoreRecord(record) {
if (record.type === "characterData" && record.target instanceof Comment) {
return true;
}
if (record.type === "childList") {
for (let i = 0; i < record.addedNodes.length; i++) {
if (!(record.addedNodes[i] instanceof Comment)) {
return false;
}
}
for (let i = 0; i < record.removedNodes.length; i++) {
if (!(record.removedNodes[i] instanceof Comment)) {
return false;
}
}
return true;
}
return false;
}
var MutationObserverFactory = class _MutationObserverFactory {
create(callback) {
return typeof MutationObserver === "undefined" ? null : new MutationObserver(callback);
}
static \u0275fac = function MutationObserverFactory_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MutationObserverFactory)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _MutationObserverFactory,
factory: _MutationObserverFactory.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MutationObserverFactory, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], null, null);
})();
var ContentObserver = class _ContentObserver {
_mutationObserverFactory = inject2(MutationObserverFactory);
/** Keeps track of the existing MutationObservers so they can be reused. */
_observedElements = /* @__PURE__ */ new Map();
_ngZone = inject2(NgZone);
constructor() {
}
ngOnDestroy() {
this._observedElements.forEach((_, element) => this._cleanupObserver(element));
}
observe(elementOrRef) {
const element = coerceElement(elementOrRef);
return new Observable((observer) => {
const stream = this._observeElement(element);
const subscription = stream.pipe(map((records) => records.filter((record) => !shouldIgnoreRecord(record))), filter((records) => !!records.length)).subscribe((records) => {
this._ngZone.run(() => {
observer.next(records);
});
});
return () => {
subscription.unsubscribe();
this._unobserveElement(element);
};
});
}
/**
* Observes the given element by using the existing MutationObserver if available, or creating a
* new one if not.
*/
_observeElement(element) {
return this._ngZone.runOutsideAngular(() => {
if (!this._observedElements.has(element)) {
const stream = new Subject();
const observer = this._mutationObserverFactory.create((mutations) => stream.next(mutations));
if (observer) {
observer.observe(element, {
characterData: true,
childList: true,
subtree: true
});
}
this._observedElements.set(element, {
observer,
stream,
count: 1
});
} else {
this._observedElements.get(element).count++;
}
return this._observedElements.get(element).stream;
});
}
/**
* Un-observes the given element and cleans up the underlying MutationObserver if nobody else is
* observing this element.
*/
_unobserveElement(element) {
if (this._observedElements.has(element)) {
this._observedElements.get(element).count--;
if (!this._observedElements.get(element).count) {
this._cleanupObserver(element);
}
}
}
/** Clean up the underlying MutationObserver for the specified element. */
_cleanupObserver(element) {
if (this._observedElements.has(element)) {
const {
observer,
stream
} = this._observedElements.get(element);
if (observer) {
observer.disconnect();
}
stream.complete();
this._observedElements.delete(element);
}
}
static \u0275fac = function ContentObserver_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ContentObserver)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _ContentObserver,
factory: _ContentObserver.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ContentObserver, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var CdkObserveContent = class _CdkObserveContent {
_contentObserver = inject2(ContentObserver);
_elementRef = inject2(ElementRef);
/** Event emitted for each change in the element's content. */
event = new EventEmitter();
/**
* Whether observing content is disabled. This option can be used
* to disconnect the underlying MutationObserver until it is needed.
*/
get disabled() {
return this._disabled;
}
set disabled(value) {
this._disabled = value;
this._disabled ? this._unsubscribe() : this._subscribe();
}
_disabled = false;
/** Debounce interval for emitting the changes. */
get debounce() {
return this._debounce;
}
set debounce(value) {
this._debounce = coerceNumberProperty(value);
this._subscribe();
}
_debounce;
_currentSubscription = null;
constructor() {
}
ngAfterContentInit() {
if (!this._currentSubscription && !this.disabled) {
this._subscribe();
}
}
ngOnDestroy() {
this._unsubscribe();
}
_subscribe() {
this._unsubscribe();
const stream = this._contentObserver.observe(this._elementRef);
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);
}
_unsubscribe() {
this._currentSubscription?.unsubscribe();
}
static \u0275fac = function CdkObserveContent_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkObserveContent)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkObserveContent,
selectors: [["", "cdkObserveContent", ""]],
inputs: {
disabled: [2, "cdkObserveContentDisabled", "disabled", booleanAttribute],
debounce: "debounce"
},
outputs: {
event: "cdkObserveContent"
},
exportAs: ["cdkObserveContent"]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkObserveContent, [{
type: Directive,
args: [{
selector: "[cdkObserveContent]",
exportAs: "cdkObserveContent"
}]
}], () => [], {
event: [{
type: Output,
args: ["cdkObserveContent"]
}],
disabled: [{
type: Input,
args: [{
alias: "cdkObserveContentDisabled",
transform: booleanAttribute
}]
}],
debounce: [{
type: Input
}]
});
})();
var ObserversModule = class _ObserversModule {
static \u0275fac = function ObserversModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ObserversModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _ObserversModule,
imports: [CdkObserveContent],
exports: [CdkObserveContent]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
providers: [MutationObserverFactory]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ObserversModule, [{
type: NgModule,
args: [{
imports: [CdkObserveContent],
exports: [CdkObserveContent],
providers: [MutationObserverFactory]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/a11y-module.mjs
var InteractivityChecker = class _InteractivityChecker {
_platform = inject2(Platform);
constructor() {
}
/**
* Gets whether an element is disabled.
*
* @param element Element to be checked.
* @returns Whether the element is disabled.
*/
isDisabled(element) {
return element.hasAttribute("disabled");
}
/**
* Gets whether an element is visible for the purposes of interactivity.
*
* This will capture states like `display: none` and `visibility: hidden`, but not things like
* being clipped by an `overflow: hidden` parent or being outside the viewport.
*
* @returns Whether the element is visible.
*/
isVisible(element) {
return hasGeometry(element) && getComputedStyle(element).visibility === "visible";
}
/**
* Gets whether an element can be reached via Tab key.
* Assumes that the element has already been checked with isFocusable.
*
* @param element Element to be checked.
* @returns Whether the element is tabbable.
*/
isTabbable(element) {
if (!this._platform.isBrowser) {
return false;
}
const frameElement = getFrameElement(getWindow(element));
if (frameElement) {
if (getTabIndexValue(frameElement) === -1) {
return false;
}
if (!this.isVisible(frameElement)) {
return false;
}
}
let nodeName = element.nodeName.toLowerCase();
let tabIndexValue = getTabIndexValue(element);
if (element.hasAttribute("contenteditable")) {
return tabIndexValue !== -1;
}
if (nodeName === "iframe" || nodeName === "object") {
return false;
}
if (this._platform.WEBKIT && this._platform.IOS && !isPotentiallyTabbableIOS(element)) {
return false;
}
if (nodeName === "audio") {
if (!element.hasAttribute("controls")) {
return false;
}
return tabIndexValue !== -1;
}
if (nodeName === "video") {
if (tabIndexValue === -1) {
return false;
}
if (tabIndexValue !== null) {
return true;
}
return this._platform.FIREFOX || element.hasAttribute("controls");
}
return element.tabIndex >= 0;
}
/**
* Gets whether an element can be focused by the user.
*
* @param element Element to be checked.
* @param config The config object with options to customize this method's behavior
* @returns Whether the element is focusable.
*/
isFocusable(element, config2) {
return isPotentiallyFocusable(element) && !this.isDisabled(element) && (config2?.ignoreVisibility || this.isVisible(element));
}
static \u0275fac = function InteractivityChecker_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _InteractivityChecker)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _InteractivityChecker,
factory: _InteractivityChecker.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(InteractivityChecker, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
function getFrameElement(window2) {
try {
return window2.frameElement;
} catch {
return null;
}
}
function hasGeometry(element) {
return !!(element.offsetWidth || element.offsetHeight || typeof element.getClientRects === "function" && element.getClientRects().length);
}
function isNativeFormElement(element) {
let nodeName = element.nodeName.toLowerCase();
return nodeName === "input" || nodeName === "select" || nodeName === "button" || nodeName === "textarea";
}
function isHiddenInput(element) {
return isInputElement(element) && element.type == "hidden";
}
function isAnchorWithHref(element) {
return isAnchorElement(element) && element.hasAttribute("href");
}
function isInputElement(element) {
return element.nodeName.toLowerCase() == "input";
}
function isAnchorElement(element) {
return element.nodeName.toLowerCase() == "a";
}
function hasValidTabIndex(element) {
if (!element.hasAttribute("tabindex") || element.tabIndex === void 0) {
return false;
}
let tabIndex = element.getAttribute("tabindex");
return !!(tabIndex && !isNaN(parseInt(tabIndex, 10)));
}
function getTabIndexValue(element) {
if (!hasValidTabIndex(element)) {
return null;
}
const tabIndex = parseInt(element.getAttribute("tabindex") || "", 10);
return isNaN(tabIndex) ? -1 : tabIndex;
}
function isPotentiallyTabbableIOS(element) {
let nodeName = element.nodeName.toLowerCase();
let inputType = nodeName === "input" && element.type;
return inputType === "text" || inputType === "password" || nodeName === "select" || nodeName === "textarea";
}
function isPotentiallyFocusable(element) {
if (isHiddenInput(element)) {
return false;
}
return isNativeFormElement(element) || isAnchorWithHref(element) || element.hasAttribute("contenteditable") || hasValidTabIndex(element);
}
function getWindow(node) {
return node.ownerDocument && node.ownerDocument.defaultView || window;
}
var FocusTrap = class {
_element;
_checker;
_ngZone;
_document;
_injector;
_startAnchor;
_endAnchor;
_hasAttached = false;
// Event listeners for the anchors. Need to be regular functions so that we can unbind them later.
startAnchorListener = () => this.focusLastTabbableElement();
endAnchorListener = () => this.focusFirstTabbableElement();
/** Whether the focus trap is active. */
get enabled() {
return this._enabled;
}
set enabled(value) {
this._enabled = value;
if (this._startAnchor && this._endAnchor) {
this._toggleAnchorTabIndex(value, this._startAnchor);
this._toggleAnchorTabIndex(value, this._endAnchor);
}
}
_enabled = true;
constructor(_element, _checker, _ngZone, _document2, deferAnchors = false, _injector) {
this._element = _element;
this._checker = _checker;
this._ngZone = _ngZone;
this._document = _document2;
this._injector = _injector;
if (!deferAnchors) {
this.attachAnchors();
}
}
/** Destroys the focus trap by cleaning up the anchors. */
destroy() {
const startAnchor = this._startAnchor;
const endAnchor = this._endAnchor;
if (startAnchor) {
startAnchor.removeEventListener("focus", this.startAnchorListener);
startAnchor.remove();
}
if (endAnchor) {
endAnchor.removeEventListener("focus", this.endAnchorListener);
endAnchor.remove();
}
this._startAnchor = this._endAnchor = null;
this._hasAttached = false;
}
/**
* Inserts the anchors into the DOM. This is usually done automatically
* in the constructor, but can be deferred for cases like directives with `*ngIf`.
* @returns Whether the focus trap managed to attach successfully. This may not be the case
* if the target element isn't currently in the DOM.
*/
attachAnchors() {
if (this._hasAttached) {
return true;
}
this._ngZone.runOutsideAngular(() => {
if (!this._startAnchor) {
this._startAnchor = this._createAnchor();
this._startAnchor.addEventListener("focus", this.startAnchorListener);
}
if (!this._endAnchor) {
this._endAnchor = this._createAnchor();
this._endAnchor.addEventListener("focus", this.endAnchorListener);
}
});
if (this._element.parentNode) {
this._element.parentNode.insertBefore(this._startAnchor, this._element);
this._element.parentNode.insertBefore(this._endAnchor, this._element.nextSibling);
this._hasAttached = true;
}
return this._hasAttached;
}
/**
* Waits for the zone to stabilize, then focuses the first tabbable element.
* @returns Returns a promise that resolves with a boolean, depending
* on whether focus was moved successfully.
*/
focusInitialElementWhenReady(options) {
return new Promise((resolve) => {
this._executeOnStable(() => resolve(this.focusInitialElement(options)));
});
}
/**
* Waits for the zone to stabilize, then focuses
* the first tabbable element within the focus trap region.
* @returns Returns a promise that resolves with a boolean, depending
* on whether focus was moved successfully.
*/
focusFirstTabbableElementWhenReady(options) {
return new Promise((resolve) => {
this._executeOnStable(() => resolve(this.focusFirstTabbableElement(options)));
});
}
/**
* Waits for the zone to stabilize, then focuses
* the last tabbable element within the focus trap region.
* @returns Returns a promise that resolves with a boolean, depending
* on whether focus was moved successfully.
*/
focusLastTabbableElementWhenReady(options) {
return new Promise((resolve) => {
this._executeOnStable(() => resolve(this.focusLastTabbableElement(options)));
});
}
/**
* Get the specified boundary element of the trapped region.
* @param bound The boundary to get (start or end of trapped region).
* @returns The boundary element.
*/
_getRegionBoundary(bound) {
const markers = this._element.querySelectorAll(`[cdk-focus-region-${bound}], [cdkFocusRegion${bound}], [cdk-focus-${bound}]`);
if (typeof ngDevMode === "undefined" || ngDevMode) {
for (let i = 0; i < markers.length; i++) {
if (markers[i].hasAttribute(`cdk-focus-${bound}`)) {
console.warn(`Found use of deprecated attribute 'cdk-focus-${bound}', use 'cdkFocusRegion${bound}' instead. The deprecated attribute will be removed in 8.0.0.`, markers[i]);
} else if (markers[i].hasAttribute(`cdk-focus-region-${bound}`)) {
console.warn(`Found use of deprecated attribute 'cdk-focus-region-${bound}', use 'cdkFocusRegion${bound}' instead. The deprecated attribute will be removed in 8.0.0.`, markers[i]);
}
}
}
if (bound == "start") {
return markers.length ? markers[0] : this._getFirstTabbableElement(this._element);
}
return markers.length ? markers[markers.length - 1] : this._getLastTabbableElement(this._element);
}
/**
* Focuses the element that should be focused when the focus trap is initialized.
* @returns Whether focus was moved successfully.
*/
focusInitialElement(options) {
const redirectToElement = this._element.querySelector(`[cdk-focus-initial], [cdkFocusInitial]`);
if (redirectToElement) {
if ((typeof ngDevMode === "undefined" || ngDevMode) && redirectToElement.hasAttribute(`cdk-focus-initial`)) {
console.warn(`Found use of deprecated attribute 'cdk-focus-initial', use 'cdkFocusInitial' instead. The deprecated attribute will be removed in 8.0.0`, redirectToElement);
}
if ((typeof ngDevMode === "undefined" || ngDevMode) && !this._checker.isFocusable(redirectToElement)) {
console.warn(`Element matching '[cdkFocusInitial]' is not focusable.`, redirectToElement);
}
if (!this._checker.isFocusable(redirectToElement)) {
const focusableChild = this._getFirstTabbableElement(redirectToElement);
focusableChild?.focus(options);
return !!focusableChild;
}
redirectToElement.focus(options);
return true;
}
return this.focusFirstTabbableElement(options);
}
/**
* Focuses the first tabbable element within the focus trap region.
* @returns Whether focus was moved successfully.
*/
focusFirstTabbableElement(options) {
const redirectToElement = this._getRegionBoundary("start");
if (redirectToElement) {
redirectToElement.focus(options);
}
return !!redirectToElement;
}
/**
* Focuses the last tabbable element within the focus trap region.
* @returns Whether focus was moved successfully.
*/
focusLastTabbableElement(options) {
const redirectToElement = this._getRegionBoundary("end");
if (redirectToElement) {
redirectToElement.focus(options);
}
return !!redirectToElement;
}
/**
* Checks whether the focus trap has successfully been attached.
*/
hasAttached() {
return this._hasAttached;
}
/** Get the first tabbable element from a DOM subtree (inclusive). */
_getFirstTabbableElement(root) {
if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) {
return root;
}
const children = root.children;
for (let i = 0; i < children.length; i++) {
const tabbableChild = children[i].nodeType === this._document.ELEMENT_NODE ? this._getFirstTabbableElement(children[i]) : null;
if (tabbableChild) {
return tabbableChild;
}
}
return null;
}
/** Get the last tabbable element from a DOM subtree (inclusive). */
_getLastTabbableElement(root) {
if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) {
return root;
}
const children = root.children;
for (let i = children.length - 1; i >= 0; i--) {
const tabbableChild = children[i].nodeType === this._document.ELEMENT_NODE ? this._getLastTabbableElement(children[i]) : null;
if (tabbableChild) {
return tabbableChild;
}
}
return null;
}
/** Creates an anchor element. */
_createAnchor() {
const anchor = this._document.createElement("div");
this._toggleAnchorTabIndex(this._enabled, anchor);
anchor.classList.add("cdk-visually-hidden");
anchor.classList.add("cdk-focus-trap-anchor");
anchor.setAttribute("aria-hidden", "true");
return anchor;
}
/**
* Toggles the `tabindex` of an anchor, based on the enabled state of the focus trap.
* @param isEnabled Whether the focus trap is enabled.
* @param anchor Anchor on which to toggle the tabindex.
*/
_toggleAnchorTabIndex(isEnabled, anchor) {
isEnabled ? anchor.setAttribute("tabindex", "0") : anchor.removeAttribute("tabindex");
}
/**
* Toggles the`tabindex` of both anchors to either trap Tab focus or allow it to escape.
* @param enabled: Whether the anchors should trap Tab.
*/
toggleAnchors(enabled) {
if (this._startAnchor && this._endAnchor) {
this._toggleAnchorTabIndex(enabled, this._startAnchor);
this._toggleAnchorTabIndex(enabled, this._endAnchor);
}
}
/** Executes a function when the zone is stable. */
_executeOnStable(fn) {
if (this._injector) {
afterNextRender(fn, {
injector: this._injector
});
} else {
setTimeout(fn);
}
}
};
var FocusTrapFactory = class _FocusTrapFactory {
_checker = inject2(InteractivityChecker);
_ngZone = inject2(NgZone);
_document = inject2(DOCUMENT);
_injector = inject2(Injector);
constructor() {
inject2(_CdkPrivateStyleLoader).load(_VisuallyHiddenLoader);
}
/**
* Creates a focus-trapped region around the given element.
* @param element The element around which focus will be trapped.
* @param deferCaptureElements Defers the creation of focus-capturing elements to be done
* manually by the user.
* @returns The created focus trap instance.
*/
create(element, deferCaptureElements = false) {
return new FocusTrap(element, this._checker, this._ngZone, this._document, deferCaptureElements, this._injector);
}
static \u0275fac = function FocusTrapFactory_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _FocusTrapFactory)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _FocusTrapFactory,
factory: _FocusTrapFactory.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FocusTrapFactory, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var CdkTrapFocus = class _CdkTrapFocus {
_elementRef = inject2(ElementRef);
_focusTrapFactory = inject2(FocusTrapFactory);
/** Underlying FocusTrap instance. */
focusTrap;
/** Previously focused element to restore focus to upon destroy when using autoCapture. */
_previouslyFocusedElement = null;
/** Whether the focus trap is active. */
get enabled() {
return this.focusTrap?.enabled || false;
}
set enabled(value) {
if (this.focusTrap) {
this.focusTrap.enabled = value;
}
}
/**
* Whether the directive should automatically move focus into the trapped region upon
* initialization and return focus to the previous activeElement upon destruction.
*/
autoCapture;
constructor() {
const platform = inject2(Platform);
if (platform.isBrowser) {
this.focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement, true);
}
}
ngOnDestroy() {
this.focusTrap?.destroy();
if (this._previouslyFocusedElement) {
this._previouslyFocusedElement.focus();
this._previouslyFocusedElement = null;
}
}
ngAfterContentInit() {
this.focusTrap?.attachAnchors();
if (this.autoCapture) {
this._captureFocus();
}
}
ngDoCheck() {
if (this.focusTrap && !this.focusTrap.hasAttached()) {
this.focusTrap.attachAnchors();
}
}
ngOnChanges(changes) {
const autoCaptureChange = changes["autoCapture"];
if (autoCaptureChange && !autoCaptureChange.firstChange && this.autoCapture && this.focusTrap?.hasAttached()) {
this._captureFocus();
}
}
_captureFocus() {
this._previouslyFocusedElement = _getFocusedElementPierceShadowDom();
this.focusTrap?.focusInitialElementWhenReady();
}
static \u0275fac = function CdkTrapFocus_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkTrapFocus)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkTrapFocus,
selectors: [["", "cdkTrapFocus", ""]],
inputs: {
enabled: [2, "cdkTrapFocus", "enabled", booleanAttribute],
autoCapture: [2, "cdkTrapFocusAutoCapture", "autoCapture", booleanAttribute]
},
exportAs: ["cdkTrapFocus"],
features: [\u0275\u0275NgOnChangesFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkTrapFocus, [{
type: Directive,
args: [{
selector: "[cdkTrapFocus]",
exportAs: "cdkTrapFocus"
}]
}], () => [], {
enabled: [{
type: Input,
args: [{
alias: "cdkTrapFocus",
transform: booleanAttribute
}]
}],
autoCapture: [{
type: Input,
args: [{
alias: "cdkTrapFocusAutoCapture",
transform: booleanAttribute
}]
}]
});
})();
var LIVE_ANNOUNCER_ELEMENT_TOKEN = new InjectionToken("liveAnnouncerElement", {
providedIn: "root",
factory: LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY
});
function LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY() {
return null;
}
var LIVE_ANNOUNCER_DEFAULT_OPTIONS = new InjectionToken("LIVE_ANNOUNCER_DEFAULT_OPTIONS");
var uniqueIds = 0;
var LiveAnnouncer = class _LiveAnnouncer {
_ngZone = inject2(NgZone);
_defaultOptions = inject2(LIVE_ANNOUNCER_DEFAULT_OPTIONS, {
optional: true
});
_liveElement;
_document = inject2(DOCUMENT);
_previousTimeout;
_currentPromise;
_currentResolve;
constructor() {
const elementToken = inject2(LIVE_ANNOUNCER_ELEMENT_TOKEN, {
optional: true
});
this._liveElement = elementToken || this._createLiveElement();
}
announce(message, ...args) {
const defaultOptions = this._defaultOptions;
let politeness;
let duration;
if (args.length === 1 && typeof args[0] === "number") {
duration = args[0];
} else {
[politeness, duration] = args;
}
this.clear();
clearTimeout(this._previousTimeout);
if (!politeness) {
politeness = defaultOptions && defaultOptions.politeness ? defaultOptions.politeness : "polite";
}
if (duration == null && defaultOptions) {
duration = defaultOptions.duration;
}
this._liveElement.setAttribute("aria-live", politeness);
if (this._liveElement.id) {
this._exposeAnnouncerToModals(this._liveElement.id);
}
return this._ngZone.runOutsideAngular(() => {
if (!this._currentPromise) {
this._currentPromise = new Promise((resolve) => this._currentResolve = resolve);
}
clearTimeout(this._previousTimeout);
this._previousTimeout = setTimeout(() => {
this._liveElement.textContent = message;
if (typeof duration === "number") {
this._previousTimeout = setTimeout(() => this.clear(), duration);
}
this._currentResolve?.();
this._currentPromise = this._currentResolve = void 0;
}, 100);
return this._currentPromise;
});
}
/**
* Clears the current text from the announcer element. Can be used to prevent
* screen readers from reading the text out again while the user is going
* through the page landmarks.
*/
clear() {
if (this._liveElement) {
this._liveElement.textContent = "";
}
}
ngOnDestroy() {
clearTimeout(this._previousTimeout);
this._liveElement?.remove();
this._liveElement = null;
this._currentResolve?.();
this._currentPromise = this._currentResolve = void 0;
}
_createLiveElement() {
const elementClass = "cdk-live-announcer-element";
const previousElements = this._document.getElementsByClassName(elementClass);
const liveEl = this._document.createElement("div");
for (let i = 0; i < previousElements.length; i++) {
previousElements[i].remove();
}
liveEl.classList.add(elementClass);
liveEl.classList.add("cdk-visually-hidden");
liveEl.setAttribute("aria-atomic", "true");
liveEl.setAttribute("aria-live", "polite");
liveEl.id = `cdk-live-announcer-${uniqueIds++}`;
this._document.body.appendChild(liveEl);
return liveEl;
}
/**
* Some browsers won't expose the accessibility node of the live announcer element if there is an
* `aria-modal` and the live announcer is outside of it. This method works around the issue by
* pointing the `aria-owns` of all modals to the live announcer element.
*/
_exposeAnnouncerToModals(id) {
const modals = this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');
for (let i = 0; i < modals.length; i++) {
const modal = modals[i];
const ariaOwns = modal.getAttribute("aria-owns");
if (!ariaOwns) {
modal.setAttribute("aria-owns", id);
} else if (ariaOwns.indexOf(id) === -1) {
modal.setAttribute("aria-owns", ariaOwns + " " + id);
}
}
}
static \u0275fac = function LiveAnnouncer_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _LiveAnnouncer)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _LiveAnnouncer,
factory: _LiveAnnouncer.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LiveAnnouncer, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var CdkAriaLive = class _CdkAriaLive {
_elementRef = inject2(ElementRef);
_liveAnnouncer = inject2(LiveAnnouncer);
_contentObserver = inject2(ContentObserver);
_ngZone = inject2(NgZone);
/** The aria-live politeness level to use when announcing messages. */
get politeness() {
return this._politeness;
}
set politeness(value) {
this._politeness = value === "off" || value === "assertive" ? value : "polite";
if (this._politeness === "off") {
if (this._subscription) {
this._subscription.unsubscribe();
this._subscription = null;
}
} else if (!this._subscription) {
this._subscription = this._ngZone.runOutsideAngular(() => {
return this._contentObserver.observe(this._elementRef).subscribe(() => {
const elementText = this._elementRef.nativeElement.textContent;
if (elementText !== this._previousAnnouncedText) {
this._liveAnnouncer.announce(elementText, this._politeness, this.duration);
this._previousAnnouncedText = elementText;
}
});
});
}
}
_politeness = "polite";
/** Time in milliseconds after which to clear out the announcer element. */
duration;
_previousAnnouncedText;
_subscription;
constructor() {
inject2(_CdkPrivateStyleLoader).load(_VisuallyHiddenLoader);
}
ngOnDestroy() {
if (this._subscription) {
this._subscription.unsubscribe();
}
}
static \u0275fac = function CdkAriaLive_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkAriaLive)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkAriaLive,
selectors: [["", "cdkAriaLive", ""]],
inputs: {
politeness: [0, "cdkAriaLive", "politeness"],
duration: [0, "cdkAriaLiveDuration", "duration"]
},
exportAs: ["cdkAriaLive"]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkAriaLive, [{
type: Directive,
args: [{
selector: "[cdkAriaLive]",
exportAs: "cdkAriaLive"
}]
}], () => [], {
politeness: [{
type: Input,
args: ["cdkAriaLive"]
}],
duration: [{
type: Input,
args: ["cdkAriaLiveDuration"]
}]
});
})();
var HighContrastMode;
(function(HighContrastMode2) {
HighContrastMode2[HighContrastMode2["NONE"] = 0] = "NONE";
HighContrastMode2[HighContrastMode2["BLACK_ON_WHITE"] = 1] = "BLACK_ON_WHITE";
HighContrastMode2[HighContrastMode2["WHITE_ON_BLACK"] = 2] = "WHITE_ON_BLACK";
})(HighContrastMode || (HighContrastMode = {}));
var BLACK_ON_WHITE_CSS_CLASS = "cdk-high-contrast-black-on-white";
var WHITE_ON_BLACK_CSS_CLASS = "cdk-high-contrast-white-on-black";
var HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS = "cdk-high-contrast-active";
var HighContrastModeDetector = class _HighContrastModeDetector {
_platform = inject2(Platform);
/**
* Figuring out the high contrast mode and adding the body classes can cause
* some expensive layouts. This flag is used to ensure that we only do it once.
*/
_hasCheckedHighContrastMode;
_document = inject2(DOCUMENT);
_breakpointSubscription;
constructor() {
this._breakpointSubscription = inject2(BreakpointObserver).observe("(forced-colors: active)").subscribe(() => {
if (this._hasCheckedHighContrastMode) {
this._hasCheckedHighContrastMode = false;
this._applyBodyHighContrastModeCssClasses();
}
});
}
/** Gets the current high-contrast-mode for the page. */
getHighContrastMode() {
if (!this._platform.isBrowser) {
return HighContrastMode.NONE;
}
const testElement = this._document.createElement("div");
testElement.style.backgroundColor = "rgb(1,2,3)";
testElement.style.position = "absolute";
this._document.body.appendChild(testElement);
const documentWindow = this._document.defaultView || window;
const computedStyle = documentWindow && documentWindow.getComputedStyle ? documentWindow.getComputedStyle(testElement) : null;
const computedColor = (computedStyle && computedStyle.backgroundColor || "").replace(/ /g, "");
testElement.remove();
switch (computedColor) {
// Pre Windows 11 dark theme.
case "rgb(0,0,0)":
// Windows 11 dark themes.
case "rgb(45,50,54)":
case "rgb(32,32,32)":
return HighContrastMode.WHITE_ON_BLACK;
// Pre Windows 11 light theme.
case "rgb(255,255,255)":
// Windows 11 light theme.
case "rgb(255,250,239)":
return HighContrastMode.BLACK_ON_WHITE;
}
return HighContrastMode.NONE;
}
ngOnDestroy() {
this._breakpointSubscription.unsubscribe();
}
/** Applies CSS classes indicating high-contrast mode to document body (browser-only). */
_applyBodyHighContrastModeCssClasses() {
if (!this._hasCheckedHighContrastMode && this._platform.isBrowser && this._document.body) {
const bodyClasses = this._document.body.classList;
bodyClasses.remove(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, BLACK_ON_WHITE_CSS_CLASS, WHITE_ON_BLACK_CSS_CLASS);
this._hasCheckedHighContrastMode = true;
const mode = this.getHighContrastMode();
if (mode === HighContrastMode.BLACK_ON_WHITE) {
bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, BLACK_ON_WHITE_CSS_CLASS);
} else if (mode === HighContrastMode.WHITE_ON_BLACK) {
bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, WHITE_ON_BLACK_CSS_CLASS);
}
}
}
static \u0275fac = function HighContrastModeDetector_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _HighContrastModeDetector)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _HighContrastModeDetector,
factory: _HighContrastModeDetector.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HighContrastModeDetector, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var A11yModule = class _A11yModule {
constructor() {
inject2(HighContrastModeDetector)._applyBodyHighContrastModeCssClasses();
}
static \u0275fac = function A11yModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _A11yModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _A11yModule,
imports: [ObserversModule, CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
imports: [ObserversModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(A11yModule, [{
type: NgModule,
args: [{
imports: [ObserversModule, CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus]
}]
}], () => [], null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/id-generator.mjs
var counters = {};
var _IdGenerator = class __IdGenerator {
_appId = inject2(APP_ID);
/**
* Generates a unique ID with a specific prefix.
* @param prefix Prefix to add to the ID.
*/
getId(prefix) {
if (this._appId !== "ng") {
prefix += this._appId;
}
if (!counters.hasOwnProperty(prefix)) {
counters[prefix] = 0;
}
return `${prefix}${counters[prefix]++}`;
}
static \u0275fac = function _IdGenerator_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || __IdGenerator)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: __IdGenerator,
factory: __IdGenerator.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(_IdGenerator, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/typeahead.mjs
var DEFAULT_TYPEAHEAD_DEBOUNCE_INTERVAL_MS = 200;
var Typeahead = class {
_letterKeyStream = new Subject();
_items = [];
_selectedItemIndex = -1;
/** Buffer for the letters that the user has pressed */
_pressedLetters = [];
_skipPredicateFn;
_selectedItem = new Subject();
selectedItem = this._selectedItem;
constructor(initialItems, config2) {
const typeAheadInterval = typeof config2?.debounceInterval === "number" ? config2.debounceInterval : DEFAULT_TYPEAHEAD_DEBOUNCE_INTERVAL_MS;
if (config2?.skipPredicate) {
this._skipPredicateFn = config2.skipPredicate;
}
if ((typeof ngDevMode === "undefined" || ngDevMode) && initialItems.length && initialItems.some((item) => typeof item.getLabel !== "function")) {
throw new Error("KeyManager items in typeahead mode must implement the `getLabel` method.");
}
this.setItems(initialItems);
this._setupKeyHandler(typeAheadInterval);
}
destroy() {
this._pressedLetters = [];
this._letterKeyStream.complete();
this._selectedItem.complete();
}
setCurrentSelectedItemIndex(index) {
this._selectedItemIndex = index;
}
setItems(items) {
this._items = items;
}
handleKey(event) {
const keyCode = event.keyCode;
if (event.key && event.key.length === 1) {
this._letterKeyStream.next(event.key.toLocaleUpperCase());
} else if (keyCode >= A && keyCode <= Z || keyCode >= ZERO && keyCode <= NINE) {
this._letterKeyStream.next(String.fromCharCode(keyCode));
}
}
/** Gets whether the user is currently typing into the manager using the typeahead feature. */
isTyping() {
return this._pressedLetters.length > 0;
}
/** Resets the currently stored sequence of typed letters. */
reset() {
this._pressedLetters = [];
}
_setupKeyHandler(typeAheadInterval) {
this._letterKeyStream.pipe(tap((letter) => this._pressedLetters.push(letter)), debounceTime(typeAheadInterval), filter(() => this._pressedLetters.length > 0), map(() => this._pressedLetters.join("").toLocaleUpperCase())).subscribe((inputString) => {
for (let i = 1; i < this._items.length + 1; i++) {
const index = (this._selectedItemIndex + i) % this._items.length;
const item = this._items[index];
if (!this._skipPredicateFn?.(item) && item.getLabel?.().toLocaleUpperCase().trim().indexOf(inputString) === 0) {
this._selectedItem.next(item);
break;
}
}
this._pressedLetters = [];
});
}
};
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/keycodes.mjs
function hasModifierKey(event, ...modifiers) {
if (modifiers.length) {
return modifiers.some((modifier) => event[modifier]);
}
return event.altKey || event.shiftKey || event.ctrlKey || event.metaKey;
}
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/list-key-manager.mjs
var ListKeyManager = class {
_items;
_activeItemIndex = signal(-1, ...ngDevMode ? [{ debugName: "_activeItemIndex" }] : []);
_activeItem = signal(null, ...ngDevMode ? [{ debugName: "_activeItem" }] : []);
_wrap = false;
_typeaheadSubscription = Subscription.EMPTY;
_itemChangesSubscription;
_vertical = true;
_horizontal;
_allowedModifierKeys = [];
_homeAndEnd = false;
_pageUpAndDown = { enabled: false, delta: 10 };
_effectRef;
_typeahead;
/**
* Predicate function that can be used to check whether an item should be skipped
* by the key manager. By default, disabled items are skipped.
*/
_skipPredicateFn = (item) => item.disabled;
constructor(_items, injector) {
this._items = _items;
if (_items instanceof QueryList) {
this._itemChangesSubscription = _items.changes.subscribe((newItems) => this._itemsChanged(newItems.toArray()));
} else if (isSignal(_items)) {
if (!injector && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw new Error("ListKeyManager constructed with a signal must receive an injector");
}
this._effectRef = effect(() => this._itemsChanged(_items()), ...ngDevMode ? [{ debugName: "_effectRef", injector }] : [{ injector }]);
}
}
/**
* Stream that emits any time the TAB key is pressed, so components can react
* when focus is shifted off of the list.
*/
tabOut = new Subject();
/** Stream that emits whenever the active item of the list manager changes. */
change = new Subject();
/**
* Sets the predicate function that determines which items should be skipped by the
* list key manager.
* @param predicate Function that determines whether the given item should be skipped.
*/
skipPredicate(predicate) {
this._skipPredicateFn = predicate;
return this;
}
/**
* Configures wrapping mode, which determines whether the active item will wrap to
* the other end of list when there are no more items in the given direction.
* @param shouldWrap Whether the list should wrap when reaching the end.
*/
withWrap(shouldWrap = true) {
this._wrap = shouldWrap;
return this;
}
/**
* Configures whether the key manager should be able to move the selection vertically.
* @param enabled Whether vertical selection should be enabled.
*/
withVerticalOrientation(enabled = true) {
this._vertical = enabled;
return this;
}
/**
* Configures the key manager to move the selection horizontally.
* Passing in `null` will disable horizontal movement.
* @param direction Direction in which the selection can be moved.
*/
withHorizontalOrientation(direction) {
this._horizontal = direction;
return this;
}
/**
* Modifier keys which are allowed to be held down and whose default actions will be prevented
* as the user is pressing the arrow keys. Defaults to not allowing any modifier keys.
*/
withAllowedModifierKeys(keys) {
this._allowedModifierKeys = keys;
return this;
}
/**
* Turns on typeahead mode which allows users to set the active item by typing.
* @param debounceInterval Time to wait after the last keystroke before setting the active item.
*/
withTypeAhead(debounceInterval = 200) {
if (typeof ngDevMode === "undefined" || ngDevMode) {
const items2 = this._getItemsArray();
if (items2.length > 0 && items2.some((item) => typeof item.getLabel !== "function")) {
throw Error("ListKeyManager items in typeahead mode must implement the `getLabel` method.");
}
}
this._typeaheadSubscription.unsubscribe();
const items = this._getItemsArray();
this._typeahead = new Typeahead(items, {
debounceInterval: typeof debounceInterval === "number" ? debounceInterval : void 0,
skipPredicate: (item) => this._skipPredicateFn(item)
});
this._typeaheadSubscription = this._typeahead.selectedItem.subscribe((item) => {
this.setActiveItem(item);
});
return this;
}
/** Cancels the current typeahead sequence. */
cancelTypeahead() {
this._typeahead?.reset();
return this;
}
/**
* Configures the key manager to activate the first and last items
* respectively when the Home or End key is pressed.
* @param enabled Whether pressing the Home or End key activates the first/last item.
*/
withHomeAndEnd(enabled = true) {
this._homeAndEnd = enabled;
return this;
}
/**
* Configures the key manager to activate every 10th, configured or first/last element in up/down direction
* respectively when the Page-Up or Page-Down key is pressed.
* @param enabled Whether pressing the Page-Up or Page-Down key activates the first/last item.
* @param delta Whether pressing the Home or End key activates the first/last item.
*/
withPageUpDown(enabled = true, delta = 10) {
this._pageUpAndDown = { enabled, delta };
return this;
}
setActiveItem(item) {
const previousActiveItem = this._activeItem();
this.updateActiveItem(item);
if (this._activeItem() !== previousActiveItem) {
this.change.next(this._activeItemIndex());
}
}
/**
* Sets the active item depending on the key event passed in.
* @param event Keyboard event to be used for determining which element should be active.
*/
onKeydown(event) {
const keyCode = event.keyCode;
const modifiers = ["altKey", "ctrlKey", "metaKey", "shiftKey"];
const isModifierAllowed = modifiers.every((modifier) => {
return !event[modifier] || this._allowedModifierKeys.indexOf(modifier) > -1;
});
switch (keyCode) {
case TAB:
this.tabOut.next();
return;
case DOWN_ARROW:
if (this._vertical && isModifierAllowed) {
this.setNextItemActive();
break;
} else {
return;
}
case UP_ARROW:
if (this._vertical && isModifierAllowed) {
this.setPreviousItemActive();
break;
} else {
return;
}
case RIGHT_ARROW:
if (this._horizontal && isModifierAllowed) {
this._horizontal === "rtl" ? this.setPreviousItemActive() : this.setNextItemActive();
break;
} else {
return;
}
case LEFT_ARROW:
if (this._horizontal && isModifierAllowed) {
this._horizontal === "rtl" ? this.setNextItemActive() : this.setPreviousItemActive();
break;
} else {
return;
}
case HOME:
if (this._homeAndEnd && isModifierAllowed) {
this.setFirstItemActive();
break;
} else {
return;
}
case END:
if (this._homeAndEnd && isModifierAllowed) {
this.setLastItemActive();
break;
} else {
return;
}
case PAGE_UP:
if (this._pageUpAndDown.enabled && isModifierAllowed) {
const targetIndex = this._activeItemIndex() - this._pageUpAndDown.delta;
this._setActiveItemByIndex(targetIndex > 0 ? targetIndex : 0, 1);
break;
} else {
return;
}
case PAGE_DOWN:
if (this._pageUpAndDown.enabled && isModifierAllowed) {
const targetIndex = this._activeItemIndex() + this._pageUpAndDown.delta;
const itemsLength = this._getItemsArray().length;
this._setActiveItemByIndex(targetIndex < itemsLength ? targetIndex : itemsLength - 1, -1);
break;
} else {
return;
}
default:
if (isModifierAllowed || hasModifierKey(event, "shiftKey")) {
this._typeahead?.handleKey(event);
}
return;
}
this._typeahead?.reset();
event.preventDefault();
}
/** Index of the currently active item. */
get activeItemIndex() {
return this._activeItemIndex();
}
/** The active item. */
get activeItem() {
return this._activeItem();
}
/** Gets whether the user is currently typing into the manager using the typeahead feature. */
isTyping() {
return !!this._typeahead && this._typeahead.isTyping();
}
/** Sets the active item to the first enabled item in the list. */
setFirstItemActive() {
this._setActiveItemByIndex(0, 1);
}
/** Sets the active item to the last enabled item in the list. */
setLastItemActive() {
this._setActiveItemByIndex(this._getItemsArray().length - 1, -1);
}
/** Sets the active item to the next enabled item in the list. */
setNextItemActive() {
this._activeItemIndex() < 0 ? this.setFirstItemActive() : this._setActiveItemByDelta(1);
}
/** Sets the active item to a previous enabled item in the list. */
setPreviousItemActive() {
this._activeItemIndex() < 0 && this._wrap ? this.setLastItemActive() : this._setActiveItemByDelta(-1);
}
updateActiveItem(item) {
const itemArray = this._getItemsArray();
const index = typeof item === "number" ? item : itemArray.indexOf(item);
const activeItem = itemArray[index];
this._activeItem.set(activeItem == null ? null : activeItem);
this._activeItemIndex.set(index);
this._typeahead?.setCurrentSelectedItemIndex(index);
}
/** Cleans up the key manager. */
destroy() {
this._typeaheadSubscription.unsubscribe();
this._itemChangesSubscription?.unsubscribe();
this._effectRef?.destroy();
this._typeahead?.destroy();
this.tabOut.complete();
this.change.complete();
}
/**
* This method sets the active item, given a list of items and the delta between the
* currently active item and the new active item. It will calculate differently
* depending on whether wrap mode is turned on.
*/
_setActiveItemByDelta(delta) {
this._wrap ? this._setActiveInWrapMode(delta) : this._setActiveInDefaultMode(delta);
}
/**
* Sets the active item properly given "wrap" mode. In other words, it will continue to move
* down the list until it finds an item that is not disabled, and it will wrap if it
* encounters either end of the list.
*/
_setActiveInWrapMode(delta) {
const items = this._getItemsArray();
for (let i = 1; i <= items.length; i++) {
const index = (this._activeItemIndex() + delta * i + items.length) % items.length;
const item = items[index];
if (!this._skipPredicateFn(item)) {
this.setActiveItem(index);
return;
}
}
}
/**
* Sets the active item properly given the default mode. In other words, it will
* continue to move down the list until it finds an item that is not disabled. If
* it encounters either end of the list, it will stop and not wrap.
*/
_setActiveInDefaultMode(delta) {
this._setActiveItemByIndex(this._activeItemIndex() + delta, delta);
}
/**
* Sets the active item to the first enabled item starting at the index specified. If the
* item is disabled, it will move in the fallbackDelta direction until it either
* finds an enabled item or encounters the end of the list.
*/
_setActiveItemByIndex(index, fallbackDelta) {
const items = this._getItemsArray();
if (!items[index]) {
return;
}
while (this._skipPredicateFn(items[index])) {
index += fallbackDelta;
if (!items[index]) {
return;
}
}
this.setActiveItem(index);
}
/** Returns the items as an array. */
_getItemsArray() {
if (isSignal(this._items)) {
return this._items();
}
return this._items instanceof QueryList ? this._items.toArray() : this._items;
}
/** Callback for when the items have changed. */
_itemsChanged(newItems) {
this._typeahead?.setItems(newItems);
const activeItem = this._activeItem();
if (activeItem) {
const newIndex = newItems.indexOf(activeItem);
if (newIndex > -1 && newIndex !== this._activeItemIndex()) {
this._activeItemIndex.set(newIndex);
this._typeahead?.setCurrentSelectedItemIndex(newIndex);
}
}
}
};
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/activedescendant-key-manager.mjs
var ActiveDescendantKeyManager = class extends ListKeyManager {
setActiveItem(index) {
if (this.activeItem) {
this.activeItem.setInactiveStyles();
}
super.setActiveItem(index);
if (this.activeItem) {
this.activeItem.setActiveStyles();
}
}
};
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/a11y.mjs
var ID_DELIMITER = " ";
function addAriaReferencedId(el, attr, id) {
const ids = getAriaReferenceIds(el, attr);
id = id.trim();
if (ids.some((existingId) => existingId.trim() === id)) {
return;
}
ids.push(id);
el.setAttribute(attr, ids.join(ID_DELIMITER));
}
function removeAriaReferencedId(el, attr, id) {
const ids = getAriaReferenceIds(el, attr);
id = id.trim();
const filteredIds = ids.filter((val) => val !== id);
if (filteredIds.length) {
el.setAttribute(attr, filteredIds.join(ID_DELIMITER));
} else {
el.removeAttribute(attr);
}
}
function getAriaReferenceIds(el, attr) {
const attrValue = el.getAttribute(attr);
return attrValue?.match(/\S+/g) ?? [];
}
var CDK_DESCRIBEDBY_ID_PREFIX = "cdk-describedby-message";
var CDK_DESCRIBEDBY_HOST_ATTRIBUTE = "cdk-describedby-host";
var nextId = 0;
var AriaDescriber = class _AriaDescriber {
_platform = inject2(Platform);
_document = inject2(DOCUMENT);
/** Map of all registered message elements that have been placed into the document. */
_messageRegistry = /* @__PURE__ */ new Map();
/** Container for all registered messages. */
_messagesContainer = null;
/** Unique ID for the service. */
_id = `${nextId++}`;
constructor() {
inject2(_CdkPrivateStyleLoader).load(_VisuallyHiddenLoader);
this._id = inject2(APP_ID) + "-" + nextId++;
}
describe(hostElement, message, role) {
if (!this._canBeDescribed(hostElement, message)) {
return;
}
const key = getKey(message, role);
if (typeof message !== "string") {
setMessageId(message, this._id);
this._messageRegistry.set(key, {
messageElement: message,
referenceCount: 0
});
} else if (!this._messageRegistry.has(key)) {
this._createMessageElement(message, role);
}
if (!this._isElementDescribedByMessage(hostElement, key)) {
this._addMessageReference(hostElement, key);
}
}
removeDescription(hostElement, message, role) {
if (!message || !this._isElementNode(hostElement)) {
return;
}
const key = getKey(message, role);
if (this._isElementDescribedByMessage(hostElement, key)) {
this._removeMessageReference(hostElement, key);
}
if (typeof message === "string") {
const registeredMessage = this._messageRegistry.get(key);
if (registeredMessage && registeredMessage.referenceCount === 0) {
this._deleteMessageElement(key);
}
}
if (this._messagesContainer?.childNodes.length === 0) {
this._messagesContainer.remove();
this._messagesContainer = null;
}
}
/** Unregisters all created message elements and removes the message container. */
ngOnDestroy() {
const describedElements = this._document.querySelectorAll(`[${CDK_DESCRIBEDBY_HOST_ATTRIBUTE}="${this._id}"]`);
for (let i = 0; i < describedElements.length; i++) {
this._removeCdkDescribedByReferenceIds(describedElements[i]);
describedElements[i].removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);
}
this._messagesContainer?.remove();
this._messagesContainer = null;
this._messageRegistry.clear();
}
/**
* Creates a new element in the visually hidden message container element with the message
* as its content and adds it to the message registry.
*/
_createMessageElement(message, role) {
const messageElement = this._document.createElement("div");
setMessageId(messageElement, this._id);
messageElement.textContent = message;
if (role) {
messageElement.setAttribute("role", role);
}
this._createMessagesContainer();
this._messagesContainer.appendChild(messageElement);
this._messageRegistry.set(getKey(message, role), {
messageElement,
referenceCount: 0
});
}
/** Deletes the message element from the global messages container. */
_deleteMessageElement(key) {
this._messageRegistry.get(key)?.messageElement?.remove();
this._messageRegistry.delete(key);
}
/** Creates the global container for all aria-describedby messages. */
_createMessagesContainer() {
if (this._messagesContainer) {
return;
}
const containerClassName = "cdk-describedby-message-container";
const serverContainers = this._document.querySelectorAll(`.${containerClassName}[platform="server"]`);
for (let i = 0; i < serverContainers.length; i++) {
serverContainers[i].remove();
}
const messagesContainer = this._document.createElement("div");
messagesContainer.style.visibility = "hidden";
messagesContainer.classList.add(containerClassName);
messagesContainer.classList.add("cdk-visually-hidden");
if (!this._platform.isBrowser) {
messagesContainer.setAttribute("platform", "server");
}
this._document.body.appendChild(messagesContainer);
this._messagesContainer = messagesContainer;
}
/** Removes all cdk-describedby messages that are hosted through the element. */
_removeCdkDescribedByReferenceIds(element) {
const originalReferenceIds = getAriaReferenceIds(element, "aria-describedby").filter((id) => id.indexOf(CDK_DESCRIBEDBY_ID_PREFIX) != 0);
element.setAttribute("aria-describedby", originalReferenceIds.join(" "));
}
/**
* Adds a message reference to the element using aria-describedby and increments the registered
* message's reference count.
*/
_addMessageReference(element, key) {
const registeredMessage = this._messageRegistry.get(key);
addAriaReferencedId(element, "aria-describedby", registeredMessage.messageElement.id);
element.setAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE, this._id);
registeredMessage.referenceCount++;
}
/**
* Removes a message reference from the element using aria-describedby
* and decrements the registered message's reference count.
*/
_removeMessageReference(element, key) {
const registeredMessage = this._messageRegistry.get(key);
registeredMessage.referenceCount--;
removeAriaReferencedId(element, "aria-describedby", registeredMessage.messageElement.id);
element.removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);
}
/** Returns true if the element has been described by the provided message ID. */
_isElementDescribedByMessage(element, key) {
const referenceIds = getAriaReferenceIds(element, "aria-describedby");
const registeredMessage = this._messageRegistry.get(key);
const messageId = registeredMessage && registeredMessage.messageElement.id;
return !!messageId && referenceIds.indexOf(messageId) != -1;
}
/** Determines whether a message can be described on a particular element. */
_canBeDescribed(element, message) {
if (!this._isElementNode(element)) {
return false;
}
if (message && typeof message === "object") {
return true;
}
const trimmedMessage = message == null ? "" : `${message}`.trim();
const ariaLabel = element.getAttribute("aria-label");
return trimmedMessage ? !ariaLabel || ariaLabel.trim() !== trimmedMessage : false;
}
/** Checks whether a node is an Element node. */
_isElementNode(element) {
return element.nodeType === this._document.ELEMENT_NODE;
}
static \u0275fac = function AriaDescriber_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _AriaDescriber)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _AriaDescriber,
factory: _AriaDescriber.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AriaDescriber, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
function getKey(message, role) {
return typeof message === "string" ? `${role || ""}/${message}` : message;
}
function setMessageId(element, serviceId) {
if (!element.id) {
element.id = `${CDK_DESCRIBEDBY_ID_PREFIX}-${serviceId}-${nextId++}`;
}
}
var ConfigurableFocusTrap = class extends FocusTrap {
_focusTrapManager;
_inertStrategy;
/** Whether the FocusTrap is enabled. */
get enabled() {
return this._enabled;
}
set enabled(value) {
this._enabled = value;
if (this._enabled) {
this._focusTrapManager.register(this);
} else {
this._focusTrapManager.deregister(this);
}
}
constructor(_element, _checker, _ngZone, _document2, _focusTrapManager, _inertStrategy, config2, injector) {
super(_element, _checker, _ngZone, _document2, config2.defer, injector);
this._focusTrapManager = _focusTrapManager;
this._inertStrategy = _inertStrategy;
this._focusTrapManager.register(this);
}
/** Notifies the FocusTrapManager that this FocusTrap will be destroyed. */
destroy() {
this._focusTrapManager.deregister(this);
super.destroy();
}
/** @docs-private Implemented as part of ManagedFocusTrap. */
_enable() {
this._inertStrategy.preventFocus(this);
this.toggleAnchors(true);
}
/** @docs-private Implemented as part of ManagedFocusTrap. */
_disable() {
this._inertStrategy.allowFocus(this);
this.toggleAnchors(false);
}
};
var EventListenerFocusTrapInertStrategy = class {
/** Focus event handler. */
_listener = null;
/** Adds a document event listener that keeps focus inside the FocusTrap. */
preventFocus(focusTrap) {
if (this._listener) {
focusTrap._document.removeEventListener("focus", this._listener, true);
}
this._listener = (e) => this._trapFocus(focusTrap, e);
focusTrap._ngZone.runOutsideAngular(() => {
focusTrap._document.addEventListener("focus", this._listener, true);
});
}
/** Removes the event listener added in preventFocus. */
allowFocus(focusTrap) {
if (!this._listener) {
return;
}
focusTrap._document.removeEventListener("focus", this._listener, true);
this._listener = null;
}
/**
* Refocuses the first element in the FocusTrap if the focus event target was outside
* the FocusTrap.
*
* This is an event listener callback. The event listener is added in runOutsideAngular,
* so all this code runs outside Angular as well.
*/
_trapFocus(focusTrap, event) {
const target = event.target;
const focusTrapRoot = focusTrap._element;
if (target && !focusTrapRoot.contains(target) && !target.closest?.("div.cdk-overlay-pane")) {
setTimeout(() => {
if (focusTrap.enabled && !focusTrapRoot.contains(focusTrap._document.activeElement)) {
focusTrap.focusFirstTabbableElement();
}
});
}
}
};
var FOCUS_TRAP_INERT_STRATEGY = new InjectionToken("FOCUS_TRAP_INERT_STRATEGY");
var FocusTrapManager = class _FocusTrapManager {
// A stack of the FocusTraps on the page. Only the FocusTrap at the
// top of the stack is active.
_focusTrapStack = [];
/**
* Disables the FocusTrap at the top of the stack, and then pushes
* the new FocusTrap onto the stack.
*/
register(focusTrap) {
this._focusTrapStack = this._focusTrapStack.filter((ft) => ft !== focusTrap);
let stack = this._focusTrapStack;
if (stack.length) {
stack[stack.length - 1]._disable();
}
stack.push(focusTrap);
focusTrap._enable();
}
/**
* Removes the FocusTrap from the stack, and activates the
* FocusTrap that is the new top of the stack.
*/
deregister(focusTrap) {
focusTrap._disable();
const stack = this._focusTrapStack;
const i = stack.indexOf(focusTrap);
if (i !== -1) {
stack.splice(i, 1);
if (stack.length) {
stack[stack.length - 1]._enable();
}
}
}
static \u0275fac = function FocusTrapManager_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _FocusTrapManager)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _FocusTrapManager,
factory: _FocusTrapManager.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FocusTrapManager, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], null, null);
})();
var ConfigurableFocusTrapFactory = class _ConfigurableFocusTrapFactory {
_checker = inject2(InteractivityChecker);
_ngZone = inject2(NgZone);
_focusTrapManager = inject2(FocusTrapManager);
_document = inject2(DOCUMENT);
_inertStrategy;
_injector = inject2(Injector);
constructor() {
const inertStrategy = inject2(FOCUS_TRAP_INERT_STRATEGY, {
optional: true
});
this._inertStrategy = inertStrategy || new EventListenerFocusTrapInertStrategy();
}
create(element, config2 = {
defer: false
}) {
let configObject;
if (typeof config2 === "boolean") {
configObject = {
defer: config2
};
} else {
configObject = config2;
}
return new ConfigurableFocusTrap(element, this._checker, this._ngZone, this._document, this._focusTrapManager, this._inertStrategy, configObject, this._injector);
}
static \u0275fac = function ConfigurableFocusTrapFactory_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ConfigurableFocusTrapFactory)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _ConfigurableFocusTrapFactory,
factory: _ConfigurableFocusTrapFactory.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ConfigurableFocusTrapFactory, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/scrolling2.mjs
var RtlScrollAxisType;
(function(RtlScrollAxisType2) {
RtlScrollAxisType2[RtlScrollAxisType2["NORMAL"] = 0] = "NORMAL";
RtlScrollAxisType2[RtlScrollAxisType2["NEGATED"] = 1] = "NEGATED";
RtlScrollAxisType2[RtlScrollAxisType2["INVERTED"] = 2] = "INVERTED";
})(RtlScrollAxisType || (RtlScrollAxisType = {}));
var rtlScrollAxisType;
var scrollBehaviorSupported;
function supportsScrollBehavior() {
if (scrollBehaviorSupported == null) {
if (typeof document !== "object" || !document || typeof Element !== "function" || !Element) {
scrollBehaviorSupported = false;
return scrollBehaviorSupported;
}
if ("scrollBehavior" in document.documentElement.style) {
scrollBehaviorSupported = true;
} else {
const scrollToFunction = Element.prototype.scrollTo;
if (scrollToFunction) {
scrollBehaviorSupported = !/\{\s*\[native code\]\s*\}/.test(scrollToFunction.toString());
} else {
scrollBehaviorSupported = false;
}
}
}
return scrollBehaviorSupported;
}
function getRtlScrollAxisType() {
if (typeof document !== "object" || !document) {
return RtlScrollAxisType.NORMAL;
}
if (rtlScrollAxisType == null) {
const scrollContainer = document.createElement("div");
const containerStyle = scrollContainer.style;
scrollContainer.dir = "rtl";
containerStyle.width = "1px";
containerStyle.overflow = "auto";
containerStyle.visibility = "hidden";
containerStyle.pointerEvents = "none";
containerStyle.position = "absolute";
const content = document.createElement("div");
const contentStyle = content.style;
contentStyle.width = "2px";
contentStyle.height = "1px";
scrollContainer.appendChild(content);
document.body.appendChild(scrollContainer);
rtlScrollAxisType = RtlScrollAxisType.NORMAL;
if (scrollContainer.scrollLeft === 0) {
scrollContainer.scrollLeft = 1;
rtlScrollAxisType = scrollContainer.scrollLeft === 0 ? RtlScrollAxisType.NEGATED : RtlScrollAxisType.INVERTED;
}
scrollContainer.remove();
}
return rtlScrollAxisType;
}
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/test-environment.mjs
function _isTestEnvironment() {
return (
// @ts-ignore
typeof __karma__ !== "undefined" && !!__karma__ || // @ts-ignore
typeof jasmine !== "undefined" && !!jasmine || // @ts-ignore
typeof jest !== "undefined" && !!jest || // @ts-ignore
typeof Mocha !== "undefined" && !!Mocha
);
}
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/platform.mjs
var PlatformModule = class _PlatformModule {
static \u0275fac = function PlatformModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _PlatformModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _PlatformModule
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformModule, [{
type: NgModule,
args: [{}]
}], null, null);
})();
var supportedInputTypes;
var candidateInputTypes = [
// `color` must come first. Chrome 56 shows a warning if we change the type to `color` after
// first changing it to something else:
// The specified value "" does not conform to the required format.
// The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
"color",
"button",
"checkbox",
"date",
"datetime-local",
"email",
"file",
"hidden",
"image",
"month",
"number",
"password",
"radio",
"range",
"reset",
"search",
"submit",
"tel",
"text",
"time",
"url",
"week"
];
function getSupportedInputTypes() {
if (supportedInputTypes) {
return supportedInputTypes;
}
if (typeof document !== "object" || !document) {
supportedInputTypes = new Set(candidateInputTypes);
return supportedInputTypes;
}
let featureTestInput = document.createElement("input");
supportedInputTypes = new Set(candidateInputTypes.filter((value) => {
featureTestInput.setAttribute("type", value);
return featureTestInput.type === value;
}));
return supportedInputTypes;
}
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/layout.mjs
var LayoutModule = class _LayoutModule {
static \u0275fac = function LayoutModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _LayoutModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _LayoutModule
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LayoutModule, [{
type: NgModule,
args: [{}]
}], null, null);
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/animation.mjs
var MATERIAL_ANIMATIONS = new InjectionToken("MATERIAL_ANIMATIONS");
var reducedMotion = null;
function _getAnimationsState() {
if (inject2(MATERIAL_ANIMATIONS, { optional: true })?.animationsDisabled || inject2(ANIMATION_MODULE_TYPE, { optional: true }) === "NoopAnimations") {
return "di-disabled";
}
reducedMotion ??= inject2(MediaMatcher).matchMedia("(prefers-reduced-motion)").matches;
return reducedMotion ? "reduced-motion" : "enabled";
}
function _animationsDisabled() {
return _getAnimationsState() !== "enabled";
}
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/css-pixel-value.mjs
function coerceCssPixelValue(value) {
if (value == null) {
return "";
}
return typeof value === "string" ? value : `${value}px`;
}
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/coercion.mjs
function coerceBooleanProperty(value) {
return value != null && `${value}` !== "false";
}
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/ripple.mjs
var RippleState;
(function(RippleState2) {
RippleState2[RippleState2["FADING_IN"] = 0] = "FADING_IN";
RippleState2[RippleState2["VISIBLE"] = 1] = "VISIBLE";
RippleState2[RippleState2["FADING_OUT"] = 2] = "FADING_OUT";
RippleState2[RippleState2["HIDDEN"] = 3] = "HIDDEN";
})(RippleState || (RippleState = {}));
var RippleRef = class {
_renderer;
element;
config;
_animationForciblyDisabledThroughCss;
/** Current state of the ripple. */
state = RippleState.HIDDEN;
constructor(_renderer, element, config2, _animationForciblyDisabledThroughCss = false) {
this._renderer = _renderer;
this.element = element;
this.config = config2;
this._animationForciblyDisabledThroughCss = _animationForciblyDisabledThroughCss;
}
/** Fades out the ripple element. */
fadeOut() {
this._renderer.fadeOutRipple(this);
}
};
var passiveCapturingEventOptions$1 = normalizePassiveListenerOptions({
passive: true,
capture: true
});
var RippleEventManager = class {
_events = /* @__PURE__ */ new Map();
/** Adds an event handler. */
addHandler(ngZone, name, element, handler) {
const handlersForEvent = this._events.get(name);
if (handlersForEvent) {
const handlersForElement = handlersForEvent.get(element);
if (handlersForElement) {
handlersForElement.add(handler);
} else {
handlersForEvent.set(element, /* @__PURE__ */ new Set([handler]));
}
} else {
this._events.set(name, /* @__PURE__ */ new Map([[element, /* @__PURE__ */ new Set([handler])]]));
ngZone.runOutsideAngular(() => {
document.addEventListener(name, this._delegateEventHandler, passiveCapturingEventOptions$1);
});
}
}
/** Removes an event handler. */
removeHandler(name, element, handler) {
const handlersForEvent = this._events.get(name);
if (!handlersForEvent) {
return;
}
const handlersForElement = handlersForEvent.get(element);
if (!handlersForElement) {
return;
}
handlersForElement.delete(handler);
if (handlersForElement.size === 0) {
handlersForEvent.delete(element);
}
if (handlersForEvent.size === 0) {
this._events.delete(name);
document.removeEventListener(name, this._delegateEventHandler, passiveCapturingEventOptions$1);
}
}
/** Event handler that is bound and which dispatches the events to the different targets. */
_delegateEventHandler = (event) => {
const target = _getEventTarget(event);
if (target) {
this._events.get(event.type)?.forEach((handlers, element) => {
if (element === target || element.contains(target)) {
handlers.forEach((handler) => handler.handleEvent(event));
}
});
}
};
};
var defaultRippleAnimationConfig = {
enterDuration: 225,
exitDuration: 150
};
var ignoreMouseEventsTimeout = 800;
var passiveCapturingEventOptions = normalizePassiveListenerOptions({
passive: true,
capture: true
});
var pointerDownEvents = ["mousedown", "touchstart"];
var pointerUpEvents = ["mouseup", "mouseleave", "touchend", "touchcancel"];
var _MatRippleStylesLoader = class __MatRippleStylesLoader {
static \u0275fac = function _MatRippleStylesLoader_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || __MatRippleStylesLoader)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: __MatRippleStylesLoader,
selectors: [["ng-component"]],
hostAttrs: ["mat-ripple-style-loader", ""],
decls: 0,
vars: 0,
template: function _MatRippleStylesLoader_Template(rf, ctx) {
},
styles: [".mat-ripple{overflow:hidden;position:relative}.mat-ripple:not(:empty){transform:translateZ(0)}.mat-ripple.mat-ripple-unbounded{overflow:visible}.mat-ripple-element{position:absolute;border-radius:50%;pointer-events:none;transition:opacity,transform 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale3d(0, 0, 0);background-color:var(--mat-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface) 10%, transparent))}@media(forced-colors: active){.mat-ripple-element{display:none}}.cdk-drag-preview .mat-ripple-element,.cdk-drag-placeholder .mat-ripple-element{display:none}\n"],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(_MatRippleStylesLoader, [{
type: Component,
args: [{
template: "",
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
"mat-ripple-style-loader": ""
},
styles: [".mat-ripple{overflow:hidden;position:relative}.mat-ripple:not(:empty){transform:translateZ(0)}.mat-ripple.mat-ripple-unbounded{overflow:visible}.mat-ripple-element{position:absolute;border-radius:50%;pointer-events:none;transition:opacity,transform 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale3d(0, 0, 0);background-color:var(--mat-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface) 10%, transparent))}@media(forced-colors: active){.mat-ripple-element{display:none}}.cdk-drag-preview .mat-ripple-element,.cdk-drag-placeholder .mat-ripple-element{display:none}\n"]
}]
}], null, null);
})();
var RippleRenderer = class _RippleRenderer {
_target;
_ngZone;
_platform;
/** Element where the ripples are being added to. */
_containerElement;
/** Element which triggers the ripple elements on mouse events. */
_triggerElement;
/** Whether the pointer is currently down or not. */
_isPointerDown = false;
/**
* Map of currently active ripple references.
* The ripple reference is mapped to its element event listeners.
* The reason why `| null` is used is that event listeners are added only
* when the condition is truthy (see the `_startFadeOutTransition` method).
*/
_activeRipples = /* @__PURE__ */ new Map();
/** Latest non-persistent ripple that was triggered. */
_mostRecentTransientRipple;
/** Time in milliseconds when the last touchstart event happened. */
_lastTouchStartEvent;
/** Whether pointer-up event listeners have been registered. */
_pointerUpEventsRegistered = false;
/**
* Cached dimensions of the ripple container. Set when the first
* ripple is shown and cleared once no more ripples are visible.
*/
_containerRect;
static _eventManager = new RippleEventManager();
constructor(_target, _ngZone, elementOrElementRef, _platform, injector) {
this._target = _target;
this._ngZone = _ngZone;
this._platform = _platform;
if (_platform.isBrowser) {
this._containerElement = coerceElement(elementOrElementRef);
}
if (injector) {
injector.get(_CdkPrivateStyleLoader).load(_MatRippleStylesLoader);
}
}
/**
* Fades in a ripple at the given coordinates.
* @param x Coordinate within the element, along the X axis at which to start the ripple.
* @param y Coordinate within the element, along the Y axis at which to start the ripple.
* @param config Extra ripple options.
*/
fadeInRipple(x, y, config2 = {}) {
const containerRect = this._containerRect = this._containerRect || this._containerElement.getBoundingClientRect();
const animationConfig = __spreadValues(__spreadValues({}, defaultRippleAnimationConfig), config2.animation);
if (config2.centered) {
x = containerRect.left + containerRect.width / 2;
y = containerRect.top + containerRect.height / 2;
}
const radius = config2.radius || distanceToFurthestCorner(x, y, containerRect);
const offsetX = x - containerRect.left;
const offsetY = y - containerRect.top;
const enterDuration = animationConfig.enterDuration;
const ripple = document.createElement("div");
ripple.classList.add("mat-ripple-element");
ripple.style.left = `${offsetX - radius}px`;
ripple.style.top = `${offsetY - radius}px`;
ripple.style.height = `${radius * 2}px`;
ripple.style.width = `${radius * 2}px`;
if (config2.color != null) {
ripple.style.backgroundColor = config2.color;
}
ripple.style.transitionDuration = `${enterDuration}ms`;
this._containerElement.appendChild(ripple);
const computedStyles = window.getComputedStyle(ripple);
const userTransitionProperty = computedStyles.transitionProperty;
const userTransitionDuration = computedStyles.transitionDuration;
const animationForciblyDisabledThroughCss = userTransitionProperty === "none" || // Note: The canonical unit for serialized CSS `<time>` properties is seconds. Additionally
// some browsers expand the duration for every property (in our case `opacity` and `transform`).
userTransitionDuration === "0s" || userTransitionDuration === "0s, 0s" || // If the container is 0x0, it's likely `display: none`.
containerRect.width === 0 && containerRect.height === 0;
const rippleRef = new RippleRef(this, ripple, config2, animationForciblyDisabledThroughCss);
ripple.style.transform = "scale3d(1, 1, 1)";
rippleRef.state = RippleState.FADING_IN;
if (!config2.persistent) {
this._mostRecentTransientRipple = rippleRef;
}
let eventListeners = null;
if (!animationForciblyDisabledThroughCss && (enterDuration || animationConfig.exitDuration)) {
this._ngZone.runOutsideAngular(() => {
const onTransitionEnd = () => {
if (eventListeners) {
eventListeners.fallbackTimer = null;
}
clearTimeout(fallbackTimer);
this._finishRippleTransition(rippleRef);
};
const onTransitionCancel = () => this._destroyRipple(rippleRef);
const fallbackTimer = setTimeout(onTransitionCancel, enterDuration + 100);
ripple.addEventListener("transitionend", onTransitionEnd);
ripple.addEventListener("transitioncancel", onTransitionCancel);
eventListeners = {
onTransitionEnd,
onTransitionCancel,
fallbackTimer
};
});
}
this._activeRipples.set(rippleRef, eventListeners);
if (animationForciblyDisabledThroughCss || !enterDuration) {
this._finishRippleTransition(rippleRef);
}
return rippleRef;
}
/** Fades out a ripple reference. */
fadeOutRipple(rippleRef) {
if (rippleRef.state === RippleState.FADING_OUT || rippleRef.state === RippleState.HIDDEN) {
return;
}
const rippleEl = rippleRef.element;
const animationConfig = __spreadValues(__spreadValues({}, defaultRippleAnimationConfig), rippleRef.config.animation);
rippleEl.style.transitionDuration = `${animationConfig.exitDuration}ms`;
rippleEl.style.opacity = "0";
rippleRef.state = RippleState.FADING_OUT;
if (rippleRef._animationForciblyDisabledThroughCss || !animationConfig.exitDuration) {
this._finishRippleTransition(rippleRef);
}
}
/** Fades out all currently active ripples. */
fadeOutAll() {
this._getActiveRipples().forEach((ripple) => ripple.fadeOut());
}
/** Fades out all currently active non-persistent ripples. */
fadeOutAllNonPersistent() {
this._getActiveRipples().forEach((ripple) => {
if (!ripple.config.persistent) {
ripple.fadeOut();
}
});
}
/** Sets up the trigger event listeners */
setupTriggerEvents(elementOrElementRef) {
const element = coerceElement(elementOrElementRef);
if (!this._platform.isBrowser || !element || element === this._triggerElement) {
return;
}
this._removeTriggerEvents();
this._triggerElement = element;
pointerDownEvents.forEach((type) => {
_RippleRenderer._eventManager.addHandler(this._ngZone, type, element, this);
});
}
/**
* Handles all registered events.
* @docs-private
*/
handleEvent(event) {
if (event.type === "mousedown") {
this._onMousedown(event);
} else if (event.type === "touchstart") {
this._onTouchStart(event);
} else {
this._onPointerUp();
}
if (!this._pointerUpEventsRegistered) {
this._ngZone.runOutsideAngular(() => {
pointerUpEvents.forEach((type) => {
this._triggerElement.addEventListener(type, this, passiveCapturingEventOptions);
});
});
this._pointerUpEventsRegistered = true;
}
}
/** Method that will be called if the fade-in or fade-in transition completed. */
_finishRippleTransition(rippleRef) {
if (rippleRef.state === RippleState.FADING_IN) {
this._startFadeOutTransition(rippleRef);
} else if (rippleRef.state === RippleState.FADING_OUT) {
this._destroyRipple(rippleRef);
}
}
/**
* Starts the fade-out transition of the given ripple if it's not persistent and the pointer
* is not held down anymore.
*/
_startFadeOutTransition(rippleRef) {
const isMostRecentTransientRipple = rippleRef === this._mostRecentTransientRipple;
const {
persistent
} = rippleRef.config;
rippleRef.state = RippleState.VISIBLE;
if (!persistent && (!isMostRecentTransientRipple || !this._isPointerDown)) {
rippleRef.fadeOut();
}
}
/** Destroys the given ripple by removing it from the DOM and updating its state. */
_destroyRipple(rippleRef) {
const eventListeners = this._activeRipples.get(rippleRef) ?? null;
this._activeRipples.delete(rippleRef);
if (!this._activeRipples.size) {
this._containerRect = null;
}
if (rippleRef === this._mostRecentTransientRipple) {
this._mostRecentTransientRipple = null;
}
rippleRef.state = RippleState.HIDDEN;
if (eventListeners !== null) {
rippleRef.element.removeEventListener("transitionend", eventListeners.onTransitionEnd);
rippleRef.element.removeEventListener("transitioncancel", eventListeners.onTransitionCancel);
if (eventListeners.fallbackTimer !== null) {
clearTimeout(eventListeners.fallbackTimer);
}
}
rippleRef.element.remove();
}
/** Function being called whenever the trigger is being pressed using mouse. */
_onMousedown(event) {
const isFakeMousedown = isFakeMousedownFromScreenReader(event);
const isSyntheticEvent = this._lastTouchStartEvent && Date.now() < this._lastTouchStartEvent + ignoreMouseEventsTimeout;
if (!this._target.rippleDisabled && !isFakeMousedown && !isSyntheticEvent) {
this._isPointerDown = true;
this.fadeInRipple(event.clientX, event.clientY, this._target.rippleConfig);
}
}
/** Function being called whenever the trigger is being pressed using touch. */
_onTouchStart(event) {
if (!this._target.rippleDisabled && !isFakeTouchstartFromScreenReader(event)) {
this._lastTouchStartEvent = Date.now();
this._isPointerDown = true;
const touches = event.changedTouches;
if (touches) {
for (let i = 0; i < touches.length; i++) {
this.fadeInRipple(touches[i].clientX, touches[i].clientY, this._target.rippleConfig);
}
}
}
}
/** Function being called whenever the trigger is being released. */
_onPointerUp() {
if (!this._isPointerDown) {
return;
}
this._isPointerDown = false;
this._getActiveRipples().forEach((ripple) => {
const isVisible = ripple.state === RippleState.VISIBLE || ripple.config.terminateOnPointerUp && ripple.state === RippleState.FADING_IN;
if (!ripple.config.persistent && isVisible) {
ripple.fadeOut();
}
});
}
_getActiveRipples() {
return Array.from(this._activeRipples.keys());
}
/** Removes previously registered event listeners from the trigger element. */
_removeTriggerEvents() {
const trigger = this._triggerElement;
if (trigger) {
pointerDownEvents.forEach((type) => _RippleRenderer._eventManager.removeHandler(type, trigger, this));
if (this._pointerUpEventsRegistered) {
pointerUpEvents.forEach((type) => trigger.removeEventListener(type, this, passiveCapturingEventOptions));
this._pointerUpEventsRegistered = false;
}
}
}
};
function distanceToFurthestCorner(x, y, rect) {
const distX = Math.max(Math.abs(x - rect.left), Math.abs(x - rect.right));
const distY = Math.max(Math.abs(y - rect.top), Math.abs(y - rect.bottom));
return Math.sqrt(distX * distX + distY * distY);
}
var MAT_RIPPLE_GLOBAL_OPTIONS = new InjectionToken("mat-ripple-global-options");
var MatRipple = class _MatRipple {
_elementRef = inject2(ElementRef);
_animationsDisabled = _animationsDisabled();
/** Custom color for all ripples. */
color;
/** Whether the ripples should be visible outside the component's bounds. */
unbounded;
/**
* Whether the ripple always originates from the center of the host element's bounds, rather
* than originating from the location of the click event.
*/
centered;
/**
* If set, the radius in pixels of foreground ripples when fully expanded. If unset, the radius
* will be the distance from the center of the ripple to the furthest corner of the host element's
* bounding rectangle.
*/
radius = 0;
/**
* Configuration for the ripple animation. Allows modifying the enter and exit animation
* duration of the ripples. The animation durations will be overwritten if the
* `NoopAnimationsModule` is being used.
*/
animation;
/**
* Whether click events will not trigger the ripple. Ripples can be still launched manually
* by using the `launch()` method.
*/
get disabled() {
return this._disabled;
}
set disabled(value) {
if (value) {
this.fadeOutAllNonPersistent();
}
this._disabled = value;
this._setupTriggerEventsIfEnabled();
}
_disabled = false;
/**
* The element that triggers the ripple when click events are received.
* Defaults to the directive's host element.
*/
get trigger() {
return this._trigger || this._elementRef.nativeElement;
}
set trigger(trigger) {
this._trigger = trigger;
this._setupTriggerEventsIfEnabled();
}
_trigger;
/** Renderer for the ripple DOM manipulations. */
_rippleRenderer;
/** Options that are set globally for all ripples. */
_globalOptions;
/** @docs-private Whether ripple directive is initialized and the input bindings are set. */
_isInitialized = false;
constructor() {
const ngZone = inject2(NgZone);
const platform = inject2(Platform);
const globalOptions = inject2(MAT_RIPPLE_GLOBAL_OPTIONS, {
optional: true
});
const injector = inject2(Injector);
this._globalOptions = globalOptions || {};
this._rippleRenderer = new RippleRenderer(this, ngZone, this._elementRef, platform, injector);
}
ngOnInit() {
this._isInitialized = true;
this._setupTriggerEventsIfEnabled();
}
ngOnDestroy() {
this._rippleRenderer._removeTriggerEvents();
}
/** Fades out all currently showing ripple elements. */
fadeOutAll() {
this._rippleRenderer.fadeOutAll();
}
/** Fades out all currently showing non-persistent ripple elements. */
fadeOutAllNonPersistent() {
this._rippleRenderer.fadeOutAllNonPersistent();
}
/**
* Ripple configuration from the directive's input values.
* @docs-private Implemented as part of RippleTarget
*/
get rippleConfig() {
return {
centered: this.centered,
radius: this.radius,
color: this.color,
animation: __spreadValues(__spreadValues(__spreadValues({}, this._globalOptions.animation), this._animationsDisabled ? {
enterDuration: 0,
exitDuration: 0
} : {}), this.animation),
terminateOnPointerUp: this._globalOptions.terminateOnPointerUp
};
}
/**
* Whether ripples on pointer-down are disabled or not.
* @docs-private Implemented as part of RippleTarget
*/
get rippleDisabled() {
return this.disabled || !!this._globalOptions.disabled;
}
/** Sets up the trigger event listeners if ripples are enabled. */
_setupTriggerEventsIfEnabled() {
if (!this.disabled && this._isInitialized) {
this._rippleRenderer.setupTriggerEvents(this.trigger);
}
}
/** Launches a manual ripple at the specified coordinated or just by the ripple config. */
launch(configOrX, y = 0, config2) {
if (typeof configOrX === "number") {
return this._rippleRenderer.fadeInRipple(configOrX, y, __spreadValues(__spreadValues({}, this.rippleConfig), config2));
} else {
return this._rippleRenderer.fadeInRipple(0, 0, __spreadValues(__spreadValues({}, this.rippleConfig), configOrX));
}
}
static \u0275fac = function MatRipple_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatRipple)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MatRipple,
selectors: [["", "mat-ripple", ""], ["", "matRipple", ""]],
hostAttrs: [1, "mat-ripple"],
hostVars: 2,
hostBindings: function MatRipple_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275classProp("mat-ripple-unbounded", ctx.unbounded);
}
},
inputs: {
color: [0, "matRippleColor", "color"],
unbounded: [0, "matRippleUnbounded", "unbounded"],
centered: [0, "matRippleCentered", "centered"],
radius: [0, "matRippleRadius", "radius"],
animation: [0, "matRippleAnimation", "animation"],
disabled: [0, "matRippleDisabled", "disabled"],
trigger: [0, "matRippleTrigger", "trigger"]
},
exportAs: ["matRipple"]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatRipple, [{
type: Directive,
args: [{
selector: "[mat-ripple], [matRipple]",
exportAs: "matRipple",
host: {
"class": "mat-ripple",
"[class.mat-ripple-unbounded]": "unbounded"
}
}]
}], () => [], {
color: [{
type: Input,
args: ["matRippleColor"]
}],
unbounded: [{
type: Input,
args: ["matRippleUnbounded"]
}],
centered: [{
type: Input,
args: ["matRippleCentered"]
}],
radius: [{
type: Input,
args: ["matRippleRadius"]
}],
animation: [{
type: Input,
args: ["matRippleAnimation"]
}],
disabled: [{
type: Input,
args: ["matRippleDisabled"]
}],
trigger: [{
type: Input,
args: ["matRippleTrigger"]
}]
});
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/ripple-loader.mjs
var eventListenerOptions2 = {
capture: true
};
var rippleInteractionEvents = ["focus", "mousedown", "mouseenter", "touchstart"];
var matRippleUninitialized = "mat-ripple-loader-uninitialized";
var matRippleClassName = "mat-ripple-loader-class-name";
var matRippleCentered = "mat-ripple-loader-centered";
var matRippleDisabled = "mat-ripple-loader-disabled";
var MatRippleLoader = class _MatRippleLoader {
_document = inject2(DOCUMENT);
_animationsDisabled = _animationsDisabled();
_globalRippleOptions = inject2(MAT_RIPPLE_GLOBAL_OPTIONS, {
optional: true
});
_platform = inject2(Platform);
_ngZone = inject2(NgZone);
_injector = inject2(Injector);
_eventCleanups;
_hosts = /* @__PURE__ */ new Map();
constructor() {
const renderer = inject2(RendererFactory2).createRenderer(null, null);
this._eventCleanups = this._ngZone.runOutsideAngular(() => rippleInteractionEvents.map((name) => renderer.listen(this._document, name, this._onInteraction, eventListenerOptions2)));
}
ngOnDestroy() {
const hosts = this._hosts.keys();
for (const host of hosts) {
this.destroyRipple(host);
}
this._eventCleanups.forEach((cleanup) => cleanup());
}
/**
* Configures the ripple that will be rendered by the ripple loader.
*
* Stores the given information about how the ripple should be configured on the host
* element so that it can later be retrived & used when the ripple is actually created.
*/
configureRipple(host, config2) {
host.setAttribute(matRippleUninitialized, this._globalRippleOptions?.namespace ?? "");
if (config2.className || !host.hasAttribute(matRippleClassName)) {
host.setAttribute(matRippleClassName, config2.className || "");
}
if (config2.centered) {
host.setAttribute(matRippleCentered, "");
}
if (config2.disabled) {
host.setAttribute(matRippleDisabled, "");
}
}
/** Sets the disabled state on the ripple instance corresponding to the given host element. */
setDisabled(host, disabled) {
const ripple = this._hosts.get(host);
if (ripple) {
ripple.target.rippleDisabled = disabled;
if (!disabled && !ripple.hasSetUpEvents) {
ripple.hasSetUpEvents = true;
ripple.renderer.setupTriggerEvents(host);
}
} else if (disabled) {
host.setAttribute(matRippleDisabled, "");
} else {
host.removeAttribute(matRippleDisabled);
}
}
/**
* Handles creating and attaching component internals
* when a component is initially interacted with.
*/
_onInteraction = (event) => {
const eventTarget = _getEventTarget(event);
if (eventTarget instanceof HTMLElement) {
const element = eventTarget.closest(`[${matRippleUninitialized}="${this._globalRippleOptions?.namespace ?? ""}"]`);
if (element) {
this._createRipple(element);
}
}
};
/** Creates a MatRipple and appends it to the given element. */
_createRipple(host) {
if (!this._document || this._hosts.has(host)) {
return;
}
host.querySelector(".mat-ripple")?.remove();
const rippleEl = this._document.createElement("span");
rippleEl.classList.add("mat-ripple", host.getAttribute(matRippleClassName));
host.append(rippleEl);
const globalOptions = this._globalRippleOptions;
const enterDuration = this._animationsDisabled ? 0 : globalOptions?.animation?.enterDuration ?? defaultRippleAnimationConfig.enterDuration;
const exitDuration = this._animationsDisabled ? 0 : globalOptions?.animation?.exitDuration ?? defaultRippleAnimationConfig.exitDuration;
const target = {
rippleDisabled: this._animationsDisabled || globalOptions?.disabled || host.hasAttribute(matRippleDisabled),
rippleConfig: {
centered: host.hasAttribute(matRippleCentered),
terminateOnPointerUp: globalOptions?.terminateOnPointerUp,
animation: {
enterDuration,
exitDuration
}
}
};
const renderer = new RippleRenderer(target, this._ngZone, rippleEl, this._platform, this._injector);
const hasSetUpEvents = !target.rippleDisabled;
if (hasSetUpEvents) {
renderer.setupTriggerEvents(host);
}
this._hosts.set(host, {
target,
renderer,
hasSetUpEvents
});
host.removeAttribute(matRippleUninitialized);
}
destroyRipple(host) {
const ripple = this._hosts.get(host);
if (ripple) {
ripple.renderer._removeTriggerEvents();
this._hosts.delete(host);
}
}
static \u0275fac = function MatRippleLoader_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatRippleLoader)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _MatRippleLoader,
factory: _MatRippleLoader.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatRippleLoader, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/structural-styles.mjs
var _StructuralStylesLoader = class __StructuralStylesLoader {
static \u0275fac = function _StructuralStylesLoader_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || __StructuralStylesLoader)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: __StructuralStylesLoader,
selectors: [["structural-styles"]],
decls: 0,
vars: 0,
template: function _StructuralStylesLoader_Template(rf, ctx) {
},
styles: ['.mat-focus-indicator{position:relative}.mat-focus-indicator::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;display:var(--mat-focus-indicator-display, none);border-width:var(--mat-focus-indicator-border-width, 3px);border-style:var(--mat-focus-indicator-border-style, solid);border-color:var(--mat-focus-indicator-border-color, transparent);border-radius:var(--mat-focus-indicator-border-radius, 4px)}.mat-focus-indicator:focus::before{content:""}@media(forced-colors: active){html{--mat-focus-indicator-display: block}}\n'],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(_StructuralStylesLoader, [{
type: Component,
args: [{
selector: "structural-styles",
encapsulation: ViewEncapsulation.None,
template: "",
changeDetection: ChangeDetectionStrategy.OnPush,
styles: ['.mat-focus-indicator{position:relative}.mat-focus-indicator::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;display:var(--mat-focus-indicator-display, none);border-width:var(--mat-focus-indicator-border-width, 3px);border-style:var(--mat-focus-indicator-border-style, solid);border-color:var(--mat-focus-indicator-border-color, transparent);border-radius:var(--mat-focus-indicator-border-radius, 4px)}.mat-focus-indicator:focus::before{content:""}@media(forced-colors: active){html{--mat-focus-indicator-display: block}}\n']
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/icon-button.mjs
var _c0 = ["mat-icon-button", ""];
var _c1 = ["*"];
var MAT_BUTTON_CONFIG = new InjectionToken("MAT_BUTTON_CONFIG");
function transformTabIndex(value) {
return value == null ? void 0 : numberAttribute(value);
}
var MatButtonBase = class _MatButtonBase {
_elementRef = inject2(ElementRef);
_ngZone = inject2(NgZone);
_animationsDisabled = _animationsDisabled();
_config = inject2(MAT_BUTTON_CONFIG, {
optional: true
});
_focusMonitor = inject2(FocusMonitor);
_cleanupClick;
_renderer = inject2(Renderer2);
/**
* Handles the lazy creation of the MatButton ripple.
* Used to improve initial load time of large applications.
*/
_rippleLoader = inject2(MatRippleLoader);
/** Whether the button is set on an anchor node. */
_isAnchor;
/** Whether this button is a FAB. Used to apply the correct class on the ripple. */
_isFab = false;
/**
* Theme color of the button. This API is supported in M2 themes only, it has
* no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/button/styling.
*
* For information on applying color variants in M3, see
* https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants
*/
color;
/** Whether the ripple effect is disabled or not. */
get disableRipple() {
return this._disableRipple;
}
set disableRipple(value) {
this._disableRipple = value;
this._updateRippleDisabled();
}
_disableRipple = false;
/** Whether the button is disabled. */
get disabled() {
return this._disabled;
}
set disabled(value) {
this._disabled = value;
this._updateRippleDisabled();
}
_disabled = false;
/** `aria-disabled` value of the button. */
ariaDisabled;
/**
* Natively disabled buttons prevent focus and any pointer events from reaching the button.
* In some scenarios this might not be desirable, because it can prevent users from finding out
* why the button is disabled (e.g. via tooltip). This is also useful for buttons that may
* become disabled when activated, which would cause focus to be transferred to the document
* body instead of remaining on the button.
*
* Enabling this input will change the button so that it is styled to be disabled and will be
* marked as `aria-disabled`, but it will allow the button to receive events and focus.
*
* Note that by enabling this, you need to set the `tabindex` yourself if the button isn't
* meant to be tabbable and you have to prevent the button action (e.g. form submissions).
*/
disabledInteractive;
/** Tab index for the button. */
tabIndex;
/**
* Backwards-compatibility input that handles pre-existing `[tabindex]` bindings.
* @docs-private
*/
set _tabindex(value) {
this.tabIndex = value;
}
constructor() {
inject2(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);
const element = this._elementRef.nativeElement;
this._isAnchor = element.tagName === "A";
this.disabledInteractive = this._config?.disabledInteractive ?? false;
this.color = this._config?.color ?? null;
this._rippleLoader?.configureRipple(element, {
className: "mat-mdc-button-ripple"
});
}
ngAfterViewInit() {
this._focusMonitor.monitor(this._elementRef, true);
if (this._isAnchor) {
this._setupAsAnchor();
}
}
ngOnDestroy() {
this._cleanupClick?.();
this._focusMonitor.stopMonitoring(this._elementRef);
this._rippleLoader?.destroyRipple(this._elementRef.nativeElement);
}
/** Focuses the button. */
focus(origin = "program", options) {
if (origin) {
this._focusMonitor.focusVia(this._elementRef.nativeElement, origin, options);
} else {
this._elementRef.nativeElement.focus(options);
}
}
_getAriaDisabled() {
if (this.ariaDisabled != null) {
return this.ariaDisabled;
}
if (this._isAnchor) {
return this.disabled || null;
}
return this.disabled && this.disabledInteractive ? true : null;
}
_getDisabledAttribute() {
return this.disabledInteractive || !this.disabled ? null : true;
}
_updateRippleDisabled() {
this._rippleLoader?.setDisabled(this._elementRef.nativeElement, this.disableRipple || this.disabled);
}
_getTabIndex() {
if (this._isAnchor) {
return this.disabled && !this.disabledInteractive ? -1 : this.tabIndex;
}
return this.tabIndex;
}
_setupAsAnchor() {
this._cleanupClick = this._ngZone.runOutsideAngular(() => this._renderer.listen(this._elementRef.nativeElement, "click", (event) => {
if (this.disabled) {
event.preventDefault();
event.stopImmediatePropagation();
}
}));
}
static \u0275fac = function MatButtonBase_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatButtonBase)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MatButtonBase,
hostAttrs: [1, "mat-mdc-button-base"],
hostVars: 13,
hostBindings: function MatButtonBase_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275attribute("disabled", ctx._getDisabledAttribute())("aria-disabled", ctx._getAriaDisabled())("tabindex", ctx._getTabIndex());
\u0275\u0275classMap(ctx.color ? "mat-" + ctx.color : "");
\u0275\u0275classProp("mat-mdc-button-disabled", ctx.disabled)("mat-mdc-button-disabled-interactive", ctx.disabledInteractive)("mat-unthemed", !ctx.color)("_mat-animation-noopable", ctx._animationsDisabled);
}
},
inputs: {
color: "color",
disableRipple: [2, "disableRipple", "disableRipple", booleanAttribute],
disabled: [2, "disabled", "disabled", booleanAttribute],
ariaDisabled: [2, "aria-disabled", "ariaDisabled", booleanAttribute],
disabledInteractive: [2, "disabledInteractive", "disabledInteractive", booleanAttribute],
tabIndex: [2, "tabIndex", "tabIndex", transformTabIndex],
_tabindex: [2, "tabindex", "_tabindex", transformTabIndex]
}
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatButtonBase, [{
type: Directive,
args: [{
host: {
// Add a class that applies to all buttons. This makes it easier to target if somebody
// wants to target all Material buttons.
"class": "mat-mdc-button-base",
"[class]": 'color ? "mat-" + color : ""',
"[attr.disabled]": "_getDisabledAttribute()",
"[attr.aria-disabled]": "_getAriaDisabled()",
"[attr.tabindex]": "_getTabIndex()",
"[class.mat-mdc-button-disabled]": "disabled",
"[class.mat-mdc-button-disabled-interactive]": "disabledInteractive",
"[class.mat-unthemed]": "!color",
"[class._mat-animation-noopable]": "_animationsDisabled"
}
}]
}], () => [], {
color: [{
type: Input
}],
disableRipple: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
disabled: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
ariaDisabled: [{
type: Input,
args: [{
transform: booleanAttribute,
alias: "aria-disabled"
}]
}],
disabledInteractive: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
tabIndex: [{
type: Input,
args: [{
transform: transformTabIndex
}]
}],
_tabindex: [{
type: Input,
args: [{
alias: "tabindex",
transform: transformTabIndex
}]
}]
});
})();
var MatIconButton = class _MatIconButton extends MatButtonBase {
constructor() {
super();
this._rippleLoader.configureRipple(this._elementRef.nativeElement, {
centered: true
});
}
static \u0275fac = function MatIconButton_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatIconButton)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: _MatIconButton,
selectors: [["button", "mat-icon-button", ""], ["a", "mat-icon-button", ""], ["button", "matIconButton", ""], ["a", "matIconButton", ""]],
hostAttrs: [1, "mdc-icon-button", "mat-mdc-icon-button"],
exportAs: ["matButton", "matAnchor"],
features: [\u0275\u0275InheritDefinitionFeature],
attrs: _c0,
ngContentSelectors: _c1,
decls: 4,
vars: 0,
consts: [[1, "mat-mdc-button-persistent-ripple", "mdc-icon-button__ripple"], [1, "mat-focus-indicator"], [1, "mat-mdc-button-touch-target"]],
template: function MatIconButton_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275projectionDef();
\u0275\u0275domElement(0, "span", 0);
\u0275\u0275projection(1);
\u0275\u0275domElement(2, "span", 1)(3, "span", 2);
}
},
styles: ['.mat-mdc-icon-button{-webkit-user-select:none;user-select:none;display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:rgba(0,0,0,0);fill:currentColor;text-decoration:none;cursor:pointer;z-index:0;overflow:visible;border-radius:var(--mat-icon-button-container-shape, var(--mat-sys-corner-full, 50%));flex-shrink:0;text-align:center;width:var(--mat-icon-button-state-layer-size, 40px);height:var(--mat-icon-button-state-layer-size, 40px);padding:calc(calc(var(--mat-icon-button-state-layer-size, 40px) - var(--mat-icon-button-icon-size, 24px)) / 2);font-size:var(--mat-icon-button-icon-size, 24px);color:var(--mat-icon-button-icon-color, var(--mat-sys-on-surface-variant));-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-icon-button .mat-mdc-button-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-icon-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-icon-button .mdc-button__label,.mat-mdc-icon-button .mat-icon{z-index:1;position:relative}.mat-mdc-icon-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit}.mat-mdc-icon-button:focus>.mat-focus-indicator::before{content:"";border-radius:inherit}.mat-mdc-icon-button .mat-ripple-element{background-color:var(--mat-icon-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface-variant) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-icon-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-icon-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-icon-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-icon-button-touch-target-size, 48px);display:var(--mat-icon-button-touch-target-display, block);left:50%;width:var(--mat-icon-button-touch-target-size, 48px);transform:translate(-50%, -50%)}.mat-mdc-icon-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-icon-button[disabled],.mat-mdc-icon-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-icon-button-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-icon-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-icon-button img,.mat-mdc-icon-button svg{width:var(--mat-icon-button-icon-size, 24px);height:var(--mat-icon-button-icon-size, 24px);vertical-align:baseline}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:var(--mat-icon-button-container-shape, var(--mat-sys-corner-full, 50%))}.mat-mdc-icon-button[hidden]{display:none}.mat-mdc-icon-button.mat-unthemed:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-primary:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-accent:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-warn:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}\n', "@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-button-base.mat-tonal-button,.mat-mdc-icon-button.mat-mdc-icon-button,.mat-mdc-outlined-button .mdc-button__ripple{outline:solid 1px}}\n"],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatIconButton, [{
type: Component,
args: [{
selector: `button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]`,
host: {
"class": "mdc-icon-button mat-mdc-icon-button"
},
exportAs: "matButton, matAnchor",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<span class="mat-mdc-button-persistent-ripple mdc-icon-button__ripple"></span>
<ng-content></ng-content>
<!--
The indicator can't be directly on the button, because MDC uses ::before for high contrast
indication and it can't be on the ripple, because it has a border radius and overflow: hidden.
-->
<span class="mat-focus-indicator"></span>
<span class="mat-mdc-button-touch-target"></span>
`,
styles: ['.mat-mdc-icon-button{-webkit-user-select:none;user-select:none;display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:rgba(0,0,0,0);fill:currentColor;text-decoration:none;cursor:pointer;z-index:0;overflow:visible;border-radius:var(--mat-icon-button-container-shape, var(--mat-sys-corner-full, 50%));flex-shrink:0;text-align:center;width:var(--mat-icon-button-state-layer-size, 40px);height:var(--mat-icon-button-state-layer-size, 40px);padding:calc(calc(var(--mat-icon-button-state-layer-size, 40px) - var(--mat-icon-button-icon-size, 24px)) / 2);font-size:var(--mat-icon-button-icon-size, 24px);color:var(--mat-icon-button-icon-color, var(--mat-sys-on-surface-variant));-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-icon-button .mat-mdc-button-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-icon-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-icon-button .mdc-button__label,.mat-mdc-icon-button .mat-icon{z-index:1;position:relative}.mat-mdc-icon-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit}.mat-mdc-icon-button:focus>.mat-focus-indicator::before{content:"";border-radius:inherit}.mat-mdc-icon-button .mat-ripple-element{background-color:var(--mat-icon-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface-variant) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-icon-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-icon-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-icon-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-icon-button-touch-target-size, 48px);display:var(--mat-icon-button-touch-target-display, block);left:50%;width:var(--mat-icon-button-touch-target-size, 48px);transform:translate(-50%, -50%)}.mat-mdc-icon-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-icon-button[disabled],.mat-mdc-icon-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-icon-button-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-icon-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-icon-button img,.mat-mdc-icon-button svg{width:var(--mat-icon-button-icon-size, 24px);height:var(--mat-icon-button-icon-size, 24px);vertical-align:baseline}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:var(--mat-icon-button-container-shape, var(--mat-sys-corner-full, 50%))}.mat-mdc-icon-button[hidden]{display:none}.mat-mdc-icon-button.mat-unthemed:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-primary:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-accent:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-warn:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}\n', "@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-button-base.mat-tonal-button,.mat-mdc-icon-button.mat-mdc-icon-button,.mat-mdc-outlined-button .mdc-button__ripple{outline:solid 1px}}\n"]
}]
}], () => [], null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/directionality.mjs
var DIR_DOCUMENT = new InjectionToken("cdk-dir-doc", {
providedIn: "root",
factory: DIR_DOCUMENT_FACTORY
});
function DIR_DOCUMENT_FACTORY() {
return inject2(DOCUMENT);
}
var RTL_LOCALE_PATTERN = /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;
function _resolveDirectionality(rawValue) {
const value = rawValue?.toLowerCase() || "";
if (value === "auto" && typeof navigator !== "undefined" && navigator?.language) {
return RTL_LOCALE_PATTERN.test(navigator.language) ? "rtl" : "ltr";
}
return value === "rtl" ? "rtl" : "ltr";
}
var Directionality = class _Directionality {
/** The current 'ltr' or 'rtl' value. */
get value() {
return this.valueSignal();
}
/**
* The current 'ltr' or 'rtl' value.
*/
valueSignal = signal("ltr", ...ngDevMode ? [{
debugName: "valueSignal"
}] : []);
/** Stream that emits whenever the 'ltr' / 'rtl' state changes. */
change = new EventEmitter();
constructor() {
const _document2 = inject2(DIR_DOCUMENT, {
optional: true
});
if (_document2) {
const bodyDir = _document2.body ? _document2.body.dir : null;
const htmlDir = _document2.documentElement ? _document2.documentElement.dir : null;
this.valueSignal.set(_resolveDirectionality(bodyDir || htmlDir || "ltr"));
}
}
ngOnDestroy() {
this.change.complete();
}
static \u0275fac = function Directionality_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _Directionality)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _Directionality,
factory: _Directionality.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Directionality, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/bidi.mjs
var Dir = class _Dir {
/** Whether the `value` has been set to its initial value. */
_isInitialized = false;
/** Direction as passed in by the consumer. */
_rawDir;
/** Event emitted when the direction changes. */
change = new EventEmitter();
/** @docs-private */
get dir() {
return this.valueSignal();
}
set dir(value) {
const previousValue = this.valueSignal();
this.valueSignal.set(_resolveDirectionality(value));
this._rawDir = value;
if (previousValue !== this.valueSignal() && this._isInitialized) {
this.change.emit(this.valueSignal());
}
}
/** Current layout direction of the element. */
get value() {
return this.dir;
}
valueSignal = signal("ltr", ...ngDevMode ? [{
debugName: "valueSignal"
}] : []);
/** Initialize once default value has been set. */
ngAfterContentInit() {
this._isInitialized = true;
}
ngOnDestroy() {
this.change.complete();
}
static \u0275fac = function Dir_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _Dir)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _Dir,
selectors: [["", "dir", ""]],
hostVars: 1,
hostBindings: function Dir_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275attribute("dir", ctx._rawDir);
}
},
inputs: {
dir: "dir"
},
outputs: {
change: "dirChange"
},
exportAs: ["dir"],
features: [\u0275\u0275ProvidersFeature([{
provide: Directionality,
useExisting: _Dir
}])]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Dir, [{
type: Directive,
args: [{
selector: "[dir]",
providers: [{
provide: Directionality,
useExisting: Dir
}],
host: {
"[attr.dir]": "_rawDir"
},
exportAs: "dir"
}]
}], null, {
change: [{
type: Output,
args: ["dirChange"]
}],
dir: [{
type: Input
}]
});
})();
var BidiModule = class _BidiModule {
static \u0275fac = function BidiModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _BidiModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _BidiModule,
imports: [Dir],
exports: [Dir]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BidiModule, [{
type: NgModule,
args: [{
imports: [Dir],
exports: [Dir]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/common-module.mjs
var MATERIAL_SANITY_CHECKS = new InjectionToken("mat-sanity-checks", {
providedIn: "root",
factory: () => true
});
var MatCommonModule = class _MatCommonModule {
constructor() {
inject2(HighContrastModeDetector)._applyBodyHighContrastModeCssClasses();
}
static \u0275fac = function MatCommonModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatCommonModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _MatCommonModule,
imports: [BidiModule],
exports: [BidiModule]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
imports: [BidiModule, BidiModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatCommonModule, [{
type: NgModule,
args: [{
imports: [BidiModule],
exports: [BidiModule]
}]
}], () => [], null);
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/ripple-module.mjs
var MatRippleModule = class _MatRippleModule {
static \u0275fac = function MatRippleModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatRippleModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _MatRippleModule,
imports: [MatCommonModule, MatRipple],
exports: [MatRipple, MatCommonModule]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
imports: [MatCommonModule, MatCommonModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatRippleModule, [{
type: NgModule,
args: [{
imports: [MatCommonModule, MatRipple],
exports: [MatRipple, MatCommonModule]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/button.mjs
var _c02 = ["matButton", ""];
var _c12 = [[["", 8, "material-icons", 3, "iconPositionEnd", ""], ["mat-icon", 3, "iconPositionEnd", ""], ["", "matButtonIcon", "", 3, "iconPositionEnd", ""]], "*", [["", "iconPositionEnd", "", 8, "material-icons"], ["mat-icon", "iconPositionEnd", ""], ["", "matButtonIcon", "", "iconPositionEnd", ""]]];
var _c2 = [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"];
var _c3 = ["mat-fab", ""];
var _c4 = ["mat-mini-fab", ""];
var _c5 = '.mat-mdc-fab-base{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:56px;height:56px;padding:0;border:none;fill:currentColor;text-decoration:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;overflow:visible;transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),opacity 15ms linear 30ms,transform 270ms 0ms cubic-bezier(0, 0, 0.2, 1);flex-shrink:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-fab-base .mat-mdc-button-ripple,.mat-mdc-fab-base .mat-mdc-button-persistent-ripple,.mat-mdc-fab-base .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-fab-base .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-fab-base .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-fab-base .mdc-button__label,.mat-mdc-fab-base .mat-icon{z-index:1;position:relative}.mat-mdc-fab-base .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-fab-base:focus>.mat-focus-indicator::before{content:""}.mat-mdc-fab-base._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-fab-base::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-fab-base[hidden]{display:none}.mat-mdc-fab-base::-moz-focus-inner{padding:0;border:0}.mat-mdc-fab-base:active,.mat-mdc-fab-base:focus{outline:none}.mat-mdc-fab-base:hover{cursor:pointer}.mat-mdc-fab-base>svg{width:100%}.mat-mdc-fab-base .mat-icon,.mat-mdc-fab-base .material-icons{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mat-mdc-fab-base .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-fab-base[disabled],.mat-mdc-fab-base.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-fab-base[disabled],.mat-mdc-fab-base[disabled]:focus,.mat-mdc-fab-base.mat-mdc-button-disabled,.mat-mdc-fab-base.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-fab-base.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab{background-color:var(--mat-fab-container-color, var(--mat-sys-primary-container));border-radius:var(--mat-fab-container-shape, var(--mat-sys-corner-large));color:var(--mat-fab-foreground-color, var(--mat-sys-on-primary-container, inherit));box-shadow:var(--mat-fab-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab:hover{box-shadow:var(--mat-fab-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-fab:focus{box-shadow:var(--mat-fab-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab:active,.mat-mdc-fab:focus:active{box-shadow:var(--mat-fab-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-disabled-state-foreground-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-fab-disabled-state-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-fab-touch-target-size, 48px);display:var(--mat-fab-touch-target-display, block);left:50%;width:var(--mat-fab-touch-target-size, 48px);transform:translate(-50%, -50%)}.mat-mdc-fab .mat-ripple-element{background-color:var(--mat-fab-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-state-layer-color, var(--mat-sys-on-primary-container))}.mat-mdc-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-disabled-state-layer-color)}.mat-mdc-fab:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-fab.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-fab:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-mini-fab{width:40px;height:40px;background-color:var(--mat-fab-small-container-color, var(--mat-sys-primary-container));border-radius:var(--mat-fab-small-container-shape, var(--mat-sys-corner-medium));color:var(--mat-fab-small-foreground-color, var(--mat-sys-on-primary-container, inherit));box-shadow:var(--mat-fab-small-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab:hover{box-shadow:var(--mat-fab-small-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-mini-fab:focus{box-shadow:var(--mat-fab-small-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab:active,.mat-mdc-mini-fab:focus:active{box-shadow:var(--mat-fab-small-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-small-disabled-state-foreground-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-fab-small-disabled-state-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-mini-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-fab-small-touch-target-size, 48px);display:var(--mat-fab-small-touch-target-display);left:50%;width:var(--mat-fab-small-touch-target-size, 48px);transform:translate(-50%, -50%)}.mat-mdc-mini-fab .mat-ripple-element{background-color:var(--mat-fab-small-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-state-layer-color, var(--mat-sys-on-primary-container))}.mat-mdc-mini-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-disabled-state-layer-color)}.mat-mdc-mini-fab:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-mini-fab.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-mini-fab:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-extended-fab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:20px;padding-right:20px;width:auto;max-width:100%;line-height:normal;box-shadow:var(--mat-fab-extended-container-elevation-shadow, var(--mat-sys-level3));height:var(--mat-fab-extended-container-height, 56px);border-radius:var(--mat-fab-extended-container-shape, var(--mat-sys-corner-large));font-family:var(--mat-fab-extended-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-fab-extended-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mat-fab-extended-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-fab-extended-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-extended-fab:hover{box-shadow:var(--mat-fab-extended-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-extended-fab:focus{box-shadow:var(--mat-fab-extended-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-extended-fab:active,.mat-mdc-extended-fab:focus:active{box-shadow:var(--mat-fab-extended-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab[disabled]:focus,.mat-mdc-extended-fab.mat-mdc-button-disabled,.mat-mdc-extended-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-extended-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.mat-icon,[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.material-icons,.mat-mdc-extended-fab>.mat-icon,.mat-mdc-extended-fab>.material-icons{margin-left:-8px;margin-right:12px}.mat-mdc-extended-fab .mdc-button__label+.mat-icon,.mat-mdc-extended-fab .mdc-button__label+.material-icons,[dir=rtl] .mat-mdc-extended-fab>.mat-icon,[dir=rtl] .mat-mdc-extended-fab>.material-icons{margin-left:12px;margin-right:-8px}.mat-mdc-extended-fab .mat-mdc-button-touch-target{width:100%}\n';
var APPEARANCE_CLASSES = /* @__PURE__ */ new Map([["text", ["mat-mdc-button"]], ["filled", ["mdc-button--unelevated", "mat-mdc-unelevated-button"]], ["elevated", ["mdc-button--raised", "mat-mdc-raised-button"]], ["outlined", ["mdc-button--outlined", "mat-mdc-outlined-button"]], ["tonal", ["mat-tonal-button"]]]);
var MatButton = class _MatButton extends MatButtonBase {
/** Appearance of the button. */
get appearance() {
return this._appearance;
}
set appearance(value) {
this.setAppearance(value || this._config?.defaultAppearance || "text");
}
_appearance = null;
constructor() {
super();
const inferredAppearance = _inferAppearance(this._elementRef.nativeElement);
if (inferredAppearance) {
this.setAppearance(inferredAppearance);
}
}
/** Programmatically sets the appearance of the button. */
setAppearance(appearance) {
if (appearance === this._appearance) {
return;
}
const classList = this._elementRef.nativeElement.classList;
const previousClasses = this._appearance ? APPEARANCE_CLASSES.get(this._appearance) : null;
const newClasses = APPEARANCE_CLASSES.get(appearance);
if ((typeof ngDevMode === "undefined" || ngDevMode) && !newClasses) {
throw new Error(`Unsupported MatButton appearance "${appearance}"`);
}
if (previousClasses) {
classList.remove(...previousClasses);
}
classList.add(...newClasses);
this._appearance = appearance;
}
static \u0275fac = function MatButton_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatButton)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: _MatButton,
selectors: [["button", "matButton", ""], ["a", "matButton", ""], ["button", "mat-button", ""], ["button", "mat-raised-button", ""], ["button", "mat-flat-button", ""], ["button", "mat-stroked-button", ""], ["a", "mat-button", ""], ["a", "mat-raised-button", ""], ["a", "mat-flat-button", ""], ["a", "mat-stroked-button", ""]],
hostAttrs: [1, "mdc-button"],
inputs: {
appearance: [0, "matButton", "appearance"]
},
exportAs: ["matButton", "matAnchor"],
features: [\u0275\u0275InheritDefinitionFeature],
attrs: _c02,
ngContentSelectors: _c2,
decls: 7,
vars: 4,
consts: [[1, "mat-mdc-button-persistent-ripple"], [1, "mdc-button__label"], [1, "mat-focus-indicator"], [1, "mat-mdc-button-touch-target"]],
template: function MatButton_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275projectionDef(_c12);
\u0275\u0275domElement(0, "span", 0);
\u0275\u0275projection(1);
\u0275\u0275domElementStart(2, "span", 1);
\u0275\u0275projection(3, 1);
\u0275\u0275domElementEnd();
\u0275\u0275projection(4, 2);
\u0275\u0275domElement(5, "span", 2)(6, "span", 3);
}
if (rf & 2) {
\u0275\u0275classProp("mdc-button__ripple", !ctx._isFab)("mdc-fab__ripple", ctx._isFab);
}
},
styles: ['.mat-mdc-button-base{text-decoration:none}.mat-mdc-button-base .mat-icon{min-height:fit-content;flex-shrink:0}.mdc-button{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:rgba(0,0,0,0);padding:0 8px}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button[hidden]{display:none}.mdc-button .mdc-button__label{position:relative}.mat-mdc-button{padding:0 var(--mat-button-text-horizontal-padding, 12px);height:var(--mat-button-text-container-height, 40px);font-family:var(--mat-button-text-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-text-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-text-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-text-label-text-transform);font-weight:var(--mat-button-text-label-text-weight, var(--mat-sys-label-large-weight))}.mat-mdc-button,.mat-mdc-button .mdc-button__ripple{border-radius:var(--mat-button-text-container-shape, var(--mat-sys-corner-full))}.mat-mdc-button:not(:disabled){color:var(--mat-button-text-label-text-color, var(--mat-sys-primary))}.mat-mdc-button[disabled],.mat-mdc-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-text-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button:has(.material-icons,mat-icon,[matButtonIcon]){padding:0 var(--mat-button-text-with-icon-horizontal-padding, 16px)}.mat-mdc-button>.mat-icon{margin-right:var(--mat-button-text-icon-spacing, 8px);margin-left:var(--mat-button-text-icon-offset, -4px)}[dir=rtl] .mat-mdc-button>.mat-icon{margin-right:var(--mat-button-text-icon-offset, -4px);margin-left:var(--mat-button-text-icon-spacing, 8px)}.mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-text-icon-offset, -4px);margin-left:var(--mat-button-text-icon-spacing, 8px)}[dir=rtl] .mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-text-icon-spacing, 8px);margin-left:var(--mat-button-text-icon-offset, -4px)}.mat-mdc-button .mat-ripple-element{background-color:var(--mat-button-text-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-text-state-layer-color, var(--mat-sys-primary))}.mat-mdc-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-text-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-text-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-text-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-text-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-text-touch-target-size, 48px);display:var(--mat-button-text-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-unelevated-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mat-button-filled-container-height, 40px);font-family:var(--mat-button-filled-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-filled-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-filled-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-filled-label-text-transform);font-weight:var(--mat-button-filled-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-button-filled-horizontal-padding, 24px)}.mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-button-filled-icon-spacing, 8px);margin-left:var(--mat-button-filled-icon-offset, -8px)}[dir=rtl] .mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-button-filled-icon-offset, -8px);margin-left:var(--mat-button-filled-icon-spacing, 8px)}.mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-filled-icon-offset, -8px);margin-left:var(--mat-button-filled-icon-spacing, 8px)}[dir=rtl] .mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-filled-icon-spacing, 8px);margin-left:var(--mat-button-filled-icon-offset, -8px)}.mat-mdc-unelevated-button .mat-ripple-element{background-color:var(--mat-button-filled-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-filled-state-layer-color, var(--mat-sys-on-primary))}.mat-mdc-unelevated-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-filled-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-unelevated-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-filled-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-unelevated-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-filled-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-unelevated-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-filled-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-unelevated-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-filled-touch-target-size, 48px);display:var(--mat-button-filled-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-unelevated-button:not(:disabled){color:var(--mat-button-filled-label-text-color, var(--mat-sys-on-primary));background-color:var(--mat-button-filled-container-color, var(--mat-sys-primary))}.mat-mdc-unelevated-button,.mat-mdc-unelevated-button .mdc-button__ripple{border-radius:var(--mat-button-filled-container-shape, var(--mat-sys-corner-full))}.mat-mdc-unelevated-button[disabled],.mat-mdc-unelevated-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-raised-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);box-shadow:var(--mat-button-protected-container-elevation-shadow, var(--mat-sys-level1));height:var(--mat-button-protected-container-height, 40px);font-family:var(--mat-button-protected-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-protected-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-protected-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-protected-label-text-transform);font-weight:var(--mat-button-protected-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-button-protected-horizontal-padding, 24px)}.mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-button-protected-icon-spacing, 8px);margin-left:var(--mat-button-protected-icon-offset, -8px)}[dir=rtl] .mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-button-protected-icon-offset, -8px);margin-left:var(--mat-button-protected-icon-spacing, 8px)}.mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-protected-icon-offset, -8px);margin-left:var(--mat-button-protected-icon-spacing, 8px)}[dir=rtl] .mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-protected-icon-spacing, 8px);margin-left:var(--mat-button-protected-icon-offset, -8px)}.mat-mdc-raised-button .mat-ripple-element{background-color:var(--mat-button-protected-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-protected-state-layer-color, var(--mat-sys-primary))}.mat-mdc-raised-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-protected-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-raised-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-protected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-raised-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-protected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-raised-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-protected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-raised-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-protected-touch-target-size, 48px);display:var(--mat-button-protected-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-raised-button:not(:disabled){color:var(--mat-button-protected-label-text-color, var(--mat-sys-primary));background-color:var(--mat-button-protected-container-color, var(--mat-sys-surface))}.mat-mdc-raised-button,.mat-mdc-raised-button .mdc-button__ripple{border-radius:var(--mat-button-protected-container-shape, var(--mat-sys-corner-full))}.mat-mdc-raised-button:hover{box-shadow:var(--mat-button-protected-hover-container-elevation-shadow, var(--mat-sys-level2))}.mat-mdc-raised-button:focus{box-shadow:var(--mat-button-protected-focus-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button:active,.mat-mdc-raised-button:focus:active{box-shadow:var(--mat-button-protected-pressed-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button[disabled],.mat-mdc-raised-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-protected-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-protected-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-raised-button[disabled].mat-mdc-button-disabled,.mat-mdc-raised-button.mat-mdc-button-disabled.mat-mdc-button-disabled{box-shadow:var(--mat-button-protected-disabled-container-elevation-shadow, var(--mat-sys-level0))}.mat-mdc-raised-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mat-button-outlined-container-height, 40px);font-family:var(--mat-button-outlined-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-outlined-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-outlined-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-outlined-label-text-transform);font-weight:var(--mat-button-outlined-label-text-weight, var(--mat-sys-label-large-weight));border-radius:var(--mat-button-outlined-container-shape, var(--mat-sys-corner-full));border-width:var(--mat-button-outlined-outline-width, 1px);padding:0 var(--mat-button-outlined-horizontal-padding, 24px)}.mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-button-outlined-icon-spacing, 8px);margin-left:var(--mat-button-outlined-icon-offset, -8px)}[dir=rtl] .mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-button-outlined-icon-offset, -8px);margin-left:var(--mat-button-outlined-icon-spacing, 8px)}.mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-outlined-icon-offset, -8px);margin-left:var(--mat-button-outlined-icon-spacing, 8px)}[dir=rtl] .mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-outlined-icon-spacing, 8px);margin-left:var(--mat-button-outlined-icon-offset, -8px)}.mat-mdc-outlined-button .mat-ripple-element{background-color:var(--mat-button-outlined-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-outlined-state-layer-color, var(--mat-sys-primary))}.mat-mdc-outlined-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-outlined-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-outlined-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-outlined-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-outlined-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-outlined-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-outlined-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-outlined-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-outlined-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-outlined-touch-target-size, 48px);display:var(--mat-button-outlined-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-outlined-button:not(:disabled){color:var(--mat-button-outlined-label-text-color, var(--mat-sys-primary));border-color:var(--mat-button-outlined-outline-color, var(--mat-sys-outline))}.mat-mdc-outlined-button[disabled],.mat-mdc-outlined-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:var(--mat-button-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-tonal-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mat-button-tonal-container-height, 40px);font-family:var(--mat-button-tonal-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-tonal-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-tonal-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-tonal-label-text-transform);font-weight:var(--mat-button-tonal-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-button-tonal-horizontal-padding, 24px)}.mat-tonal-button:not(:disabled){color:var(--mat-button-tonal-label-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-button-tonal-container-color, var(--mat-sys-secondary-container))}.mat-tonal-button,.mat-tonal-button .mdc-button__ripple{border-radius:var(--mat-button-tonal-container-shape, var(--mat-sys-corner-full))}.mat-tonal-button[disabled],.mat-tonal-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-tonal-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-tonal-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-tonal-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-tonal-button>.mat-icon{margin-right:var(--mat-button-tonal-icon-spacing, 8px);margin-left:var(--mat-button-tonal-icon-offset, -8px)}[dir=rtl] .mat-tonal-button>.mat-icon{margin-right:var(--mat-button-tonal-icon-offset, -8px);margin-left:var(--mat-button-tonal-icon-spacing, 8px)}.mat-tonal-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-tonal-icon-offset, -8px);margin-left:var(--mat-button-tonal-icon-spacing, 8px)}[dir=rtl] .mat-tonal-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-tonal-icon-spacing, 8px);margin-left:var(--mat-button-tonal-icon-offset, -8px)}.mat-tonal-button .mat-ripple-element{background-color:var(--mat-button-tonal-ripple-color, color-mix(in srgb, var(--mat-sys-on-secondary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-tonal-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-tonal-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-tonal-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-tonal-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-tonal-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-tonal-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-tonal-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-tonal-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-tonal-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-tonal-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-tonal-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-tonal-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-tonal-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-tonal-touch-target-size, 48px);display:var(--mat-button-tonal-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-button,.mat-mdc-unelevated-button,.mat-mdc-raised-button,.mat-mdc-outlined-button,.mat-tonal-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before,.mat-tonal-button .mat-mdc-button-ripple,.mat-tonal-button .mat-mdc-button-persistent-ripple,.mat-tonal-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-tonal-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before,.mat-tonal-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-button .mdc-button__label,.mat-mdc-button .mat-icon,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-unelevated-button .mat-icon,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-raised-button .mat-icon,.mat-mdc-outlined-button .mdc-button__label,.mat-mdc-outlined-button .mat-icon,.mat-tonal-button .mdc-button__label,.mat-tonal-button .mat-icon{z-index:1;position:relative}.mat-mdc-button .mat-focus-indicator,.mat-mdc-unelevated-button .mat-focus-indicator,.mat-mdc-raised-button .mat-focus-indicator,.mat-mdc-outlined-button .mat-focus-indicator,.mat-tonal-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit}.mat-mdc-button:focus>.mat-focus-indicator::before,.mat-mdc-unelevated-button:focus>.mat-focus-indicator::before,.mat-mdc-raised-button:focus>.mat-focus-indicator::before,.mat-mdc-outlined-button:focus>.mat-focus-indicator::before,.mat-tonal-button:focus>.mat-focus-indicator::before{content:"";border-radius:inherit}.mat-mdc-button._mat-animation-noopable,.mat-mdc-unelevated-button._mat-animation-noopable,.mat-mdc-raised-button._mat-animation-noopable,.mat-mdc-outlined-button._mat-animation-noopable,.mat-tonal-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-button>.mat-icon,.mat-mdc-unelevated-button>.mat-icon,.mat-mdc-raised-button>.mat-icon,.mat-mdc-outlined-button>.mat-icon,.mat-tonal-button>.mat-icon{display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px}.mat-mdc-unelevated-button .mat-focus-indicator::before,.mat-tonal-button .mat-focus-indicator::before,.mat-mdc-raised-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-outlined-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px)*-1)}\n', "@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-button-base.mat-tonal-button,.mat-mdc-icon-button.mat-mdc-icon-button,.mat-mdc-outlined-button .mdc-button__ripple{outline:solid 1px}}\n"],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatButton, [{
type: Component,
args: [{
selector: `
button[matButton], a[matButton], button[mat-button], button[mat-raised-button],
button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button],
a[mat-flat-button], a[mat-stroked-button]
`,
host: {
"class": "mdc-button"
},
exportAs: "matButton, matAnchor",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<span
class="mat-mdc-button-persistent-ripple"
[class.mdc-button__ripple]="!_isFab"
[class.mdc-fab__ripple]="_isFab"></span>
<ng-content select=".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])">
</ng-content>
<span class="mdc-button__label"><ng-content></ng-content></span>
<ng-content select=".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]">
</ng-content>
<!--
The indicator can't be directly on the button, because MDC uses ::before for high contrast
indication and it can't be on the ripple, because it has a border radius and overflow: hidden.
-->
<span class="mat-focus-indicator"></span>
<span class="mat-mdc-button-touch-target"></span>
`,
styles: ['.mat-mdc-button-base{text-decoration:none}.mat-mdc-button-base .mat-icon{min-height:fit-content;flex-shrink:0}.mdc-button{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:rgba(0,0,0,0);padding:0 8px}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button[hidden]{display:none}.mdc-button .mdc-button__label{position:relative}.mat-mdc-button{padding:0 var(--mat-button-text-horizontal-padding, 12px);height:var(--mat-button-text-container-height, 40px);font-family:var(--mat-button-text-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-text-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-text-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-text-label-text-transform);font-weight:var(--mat-button-text-label-text-weight, var(--mat-sys-label-large-weight))}.mat-mdc-button,.mat-mdc-button .mdc-button__ripple{border-radius:var(--mat-button-text-container-shape, var(--mat-sys-corner-full))}.mat-mdc-button:not(:disabled){color:var(--mat-button-text-label-text-color, var(--mat-sys-primary))}.mat-mdc-button[disabled],.mat-mdc-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-text-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button:has(.material-icons,mat-icon,[matButtonIcon]){padding:0 var(--mat-button-text-with-icon-horizontal-padding, 16px)}.mat-mdc-button>.mat-icon{margin-right:var(--mat-button-text-icon-spacing, 8px);margin-left:var(--mat-button-text-icon-offset, -4px)}[dir=rtl] .mat-mdc-button>.mat-icon{margin-right:var(--mat-button-text-icon-offset, -4px);margin-left:var(--mat-button-text-icon-spacing, 8px)}.mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-text-icon-offset, -4px);margin-left:var(--mat-button-text-icon-spacing, 8px)}[dir=rtl] .mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-text-icon-spacing, 8px);margin-left:var(--mat-button-text-icon-offset, -4px)}.mat-mdc-button .mat-ripple-element{background-color:var(--mat-button-text-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-text-state-layer-color, var(--mat-sys-primary))}.mat-mdc-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-text-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-text-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-text-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-text-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-text-touch-target-size, 48px);display:var(--mat-button-text-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-unelevated-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mat-button-filled-container-height, 40px);font-family:var(--mat-button-filled-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-filled-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-filled-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-filled-label-text-transform);font-weight:var(--mat-button-filled-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-button-filled-horizontal-padding, 24px)}.mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-button-filled-icon-spacing, 8px);margin-left:var(--mat-button-filled-icon-offset, -8px)}[dir=rtl] .mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-button-filled-icon-offset, -8px);margin-left:var(--mat-button-filled-icon-spacing, 8px)}.mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-filled-icon-offset, -8px);margin-left:var(--mat-button-filled-icon-spacing, 8px)}[dir=rtl] .mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-filled-icon-spacing, 8px);margin-left:var(--mat-button-filled-icon-offset, -8px)}.mat-mdc-unelevated-button .mat-ripple-element{background-color:var(--mat-button-filled-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-filled-state-layer-color, var(--mat-sys-on-primary))}.mat-mdc-unelevated-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-filled-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-unelevated-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-filled-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-unelevated-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-filled-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-unelevated-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-filled-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-unelevated-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-filled-touch-target-size, 48px);display:var(--mat-button-filled-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-unelevated-button:not(:disabled){color:var(--mat-button-filled-label-text-color, var(--mat-sys-on-primary));background-color:var(--mat-button-filled-container-color, var(--mat-sys-primary))}.mat-mdc-unelevated-button,.mat-mdc-unelevated-button .mdc-button__ripple{border-radius:var(--mat-button-filled-container-shape, var(--mat-sys-corner-full))}.mat-mdc-unelevated-button[disabled],.mat-mdc-unelevated-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-raised-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);box-shadow:var(--mat-button-protected-container-elevation-shadow, var(--mat-sys-level1));height:var(--mat-button-protected-container-height, 40px);font-family:var(--mat-button-protected-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-protected-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-protected-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-protected-label-text-transform);font-weight:var(--mat-button-protected-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-button-protected-horizontal-padding, 24px)}.mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-button-protected-icon-spacing, 8px);margin-left:var(--mat-button-protected-icon-offset, -8px)}[dir=rtl] .mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-button-protected-icon-offset, -8px);margin-left:var(--mat-button-protected-icon-spacing, 8px)}.mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-protected-icon-offset, -8px);margin-left:var(--mat-button-protected-icon-spacing, 8px)}[dir=rtl] .mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-protected-icon-spacing, 8px);margin-left:var(--mat-button-protected-icon-offset, -8px)}.mat-mdc-raised-button .mat-ripple-element{background-color:var(--mat-button-protected-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-protected-state-layer-color, var(--mat-sys-primary))}.mat-mdc-raised-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-protected-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-raised-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-protected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-raised-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-protected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-raised-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-protected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-raised-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-protected-touch-target-size, 48px);display:var(--mat-button-protected-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-raised-button:not(:disabled){color:var(--mat-button-protected-label-text-color, var(--mat-sys-primary));background-color:var(--mat-button-protected-container-color, var(--mat-sys-surface))}.mat-mdc-raised-button,.mat-mdc-raised-button .mdc-button__ripple{border-radius:var(--mat-button-protected-container-shape, var(--mat-sys-corner-full))}.mat-mdc-raised-button:hover{box-shadow:var(--mat-button-protected-hover-container-elevation-shadow, var(--mat-sys-level2))}.mat-mdc-raised-button:focus{box-shadow:var(--mat-button-protected-focus-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button:active,.mat-mdc-raised-button:focus:active{box-shadow:var(--mat-button-protected-pressed-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button[disabled],.mat-mdc-raised-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-protected-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-protected-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-raised-button[disabled].mat-mdc-button-disabled,.mat-mdc-raised-button.mat-mdc-button-disabled.mat-mdc-button-disabled{box-shadow:var(--mat-button-protected-disabled-container-elevation-shadow, var(--mat-sys-level0))}.mat-mdc-raised-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mat-button-outlined-container-height, 40px);font-family:var(--mat-button-outlined-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-outlined-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-outlined-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-outlined-label-text-transform);font-weight:var(--mat-button-outlined-label-text-weight, var(--mat-sys-label-large-weight));border-radius:var(--mat-button-outlined-container-shape, var(--mat-sys-corner-full));border-width:var(--mat-button-outlined-outline-width, 1px);padding:0 var(--mat-button-outlined-horizontal-padding, 24px)}.mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-button-outlined-icon-spacing, 8px);margin-left:var(--mat-button-outlined-icon-offset, -8px)}[dir=rtl] .mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-button-outlined-icon-offset, -8px);margin-left:var(--mat-button-outlined-icon-spacing, 8px)}.mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-outlined-icon-offset, -8px);margin-left:var(--mat-button-outlined-icon-spacing, 8px)}[dir=rtl] .mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-outlined-icon-spacing, 8px);margin-left:var(--mat-button-outlined-icon-offset, -8px)}.mat-mdc-outlined-button .mat-ripple-element{background-color:var(--mat-button-outlined-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-outlined-state-layer-color, var(--mat-sys-primary))}.mat-mdc-outlined-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-outlined-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-outlined-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-outlined-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-outlined-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-outlined-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-outlined-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-outlined-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-outlined-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-outlined-touch-target-size, 48px);display:var(--mat-button-outlined-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-outlined-button:not(:disabled){color:var(--mat-button-outlined-label-text-color, var(--mat-sys-primary));border-color:var(--mat-button-outlined-outline-color, var(--mat-sys-outline))}.mat-mdc-outlined-button[disabled],.mat-mdc-outlined-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:var(--mat-button-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-tonal-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mat-button-tonal-container-height, 40px);font-family:var(--mat-button-tonal-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-tonal-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-tonal-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-tonal-label-text-transform);font-weight:var(--mat-button-tonal-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-button-tonal-horizontal-padding, 24px)}.mat-tonal-button:not(:disabled){color:var(--mat-button-tonal-label-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-button-tonal-container-color, var(--mat-sys-secondary-container))}.mat-tonal-button,.mat-tonal-button .mdc-button__ripple{border-radius:var(--mat-button-tonal-container-shape, var(--mat-sys-corner-full))}.mat-tonal-button[disabled],.mat-tonal-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-tonal-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-tonal-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-tonal-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-tonal-button>.mat-icon{margin-right:var(--mat-button-tonal-icon-spacing, 8px);margin-left:var(--mat-button-tonal-icon-offset, -8px)}[dir=rtl] .mat-tonal-button>.mat-icon{margin-right:var(--mat-button-tonal-icon-offset, -8px);margin-left:var(--mat-button-tonal-icon-spacing, 8px)}.mat-tonal-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-tonal-icon-offset, -8px);margin-left:var(--mat-button-tonal-icon-spacing, 8px)}[dir=rtl] .mat-tonal-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-tonal-icon-spacing, 8px);margin-left:var(--mat-button-tonal-icon-offset, -8px)}.mat-tonal-button .mat-ripple-element{background-color:var(--mat-button-tonal-ripple-color, color-mix(in srgb, var(--mat-sys-on-secondary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-tonal-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-tonal-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-tonal-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-tonal-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-tonal-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-tonal-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-tonal-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-tonal-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-tonal-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-tonal-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-tonal-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-tonal-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-tonal-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-tonal-touch-target-size, 48px);display:var(--mat-button-tonal-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-button,.mat-mdc-unelevated-button,.mat-mdc-raised-button,.mat-mdc-outlined-button,.mat-tonal-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before,.mat-tonal-button .mat-mdc-button-ripple,.mat-tonal-button .mat-mdc-button-persistent-ripple,.mat-tonal-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-tonal-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before,.mat-tonal-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-button .mdc-button__label,.mat-mdc-button .mat-icon,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-unelevated-button .mat-icon,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-raised-button .mat-icon,.mat-mdc-outlined-button .mdc-button__label,.mat-mdc-outlined-button .mat-icon,.mat-tonal-button .mdc-button__label,.mat-tonal-button .mat-icon{z-index:1;position:relative}.mat-mdc-button .mat-focus-indicator,.mat-mdc-unelevated-button .mat-focus-indicator,.mat-mdc-raised-button .mat-focus-indicator,.mat-mdc-outlined-button .mat-focus-indicator,.mat-tonal-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit}.mat-mdc-button:focus>.mat-focus-indicator::before,.mat-mdc-unelevated-button:focus>.mat-focus-indicator::before,.mat-mdc-raised-button:focus>.mat-focus-indicator::before,.mat-mdc-outlined-button:focus>.mat-focus-indicator::before,.mat-tonal-button:focus>.mat-focus-indicator::before{content:"";border-radius:inherit}.mat-mdc-button._mat-animation-noopable,.mat-mdc-unelevated-button._mat-animation-noopable,.mat-mdc-raised-button._mat-animation-noopable,.mat-mdc-outlined-button._mat-animation-noopable,.mat-tonal-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-button>.mat-icon,.mat-mdc-unelevated-button>.mat-icon,.mat-mdc-raised-button>.mat-icon,.mat-mdc-outlined-button>.mat-icon,.mat-tonal-button>.mat-icon{display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px}.mat-mdc-unelevated-button .mat-focus-indicator::before,.mat-tonal-button .mat-focus-indicator::before,.mat-mdc-raised-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-outlined-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px)*-1)}\n', "@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-button-base.mat-tonal-button,.mat-mdc-icon-button.mat-mdc-icon-button,.mat-mdc-outlined-button .mdc-button__ripple{outline:solid 1px}}\n"]
}]
}], () => [], {
appearance: [{
type: Input,
args: ["matButton"]
}]
});
})();
function _inferAppearance(button) {
if (button.hasAttribute("mat-raised-button")) {
return "elevated";
}
if (button.hasAttribute("mat-stroked-button")) {
return "outlined";
}
if (button.hasAttribute("mat-flat-button")) {
return "filled";
}
if (button.hasAttribute("mat-button")) {
return "text";
}
return null;
}
var MAT_FAB_DEFAULT_OPTIONS = new InjectionToken("mat-mdc-fab-default-options", {
providedIn: "root",
factory: MAT_FAB_DEFAULT_OPTIONS_FACTORY
});
function MAT_FAB_DEFAULT_OPTIONS_FACTORY() {
return {
// The FAB by default has its color set to accent.
color: "accent"
};
}
var defaults = MAT_FAB_DEFAULT_OPTIONS_FACTORY();
var MatFabButton = class _MatFabButton extends MatButtonBase {
_options = inject2(MAT_FAB_DEFAULT_OPTIONS, {
optional: true
});
_isFab = true;
extended;
constructor() {
super();
this._options = this._options || defaults;
this.color = this._options.color || defaults.color;
}
static \u0275fac = function MatFabButton_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatFabButton)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: _MatFabButton,
selectors: [["button", "mat-fab", ""], ["a", "mat-fab", ""], ["button", "matFab", ""], ["a", "matFab", ""]],
hostAttrs: [1, "mdc-fab", "mat-mdc-fab-base", "mat-mdc-fab"],
hostVars: 4,
hostBindings: function MatFabButton_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275classProp("mdc-fab--extended", ctx.extended)("mat-mdc-extended-fab", ctx.extended);
}
},
inputs: {
extended: [2, "extended", "extended", booleanAttribute]
},
exportAs: ["matButton", "matAnchor"],
features: [\u0275\u0275InheritDefinitionFeature],
attrs: _c3,
ngContentSelectors: _c2,
decls: 7,
vars: 4,
consts: [[1, "mat-mdc-button-persistent-ripple"], [1, "mdc-button__label"], [1, "mat-focus-indicator"], [1, "mat-mdc-button-touch-target"]],
template: function MatFabButton_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275projectionDef(_c12);
\u0275\u0275domElement(0, "span", 0);
\u0275\u0275projection(1);
\u0275\u0275domElementStart(2, "span", 1);
\u0275\u0275projection(3, 1);
\u0275\u0275domElementEnd();
\u0275\u0275projection(4, 2);
\u0275\u0275domElement(5, "span", 2)(6, "span", 3);
}
if (rf & 2) {
\u0275\u0275classProp("mdc-button__ripple", !ctx._isFab)("mdc-fab__ripple", ctx._isFab);
}
},
styles: ['.mat-mdc-fab-base{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:56px;height:56px;padding:0;border:none;fill:currentColor;text-decoration:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;overflow:visible;transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),opacity 15ms linear 30ms,transform 270ms 0ms cubic-bezier(0, 0, 0.2, 1);flex-shrink:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-fab-base .mat-mdc-button-ripple,.mat-mdc-fab-base .mat-mdc-button-persistent-ripple,.mat-mdc-fab-base .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-fab-base .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-fab-base .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-fab-base .mdc-button__label,.mat-mdc-fab-base .mat-icon{z-index:1;position:relative}.mat-mdc-fab-base .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-fab-base:focus>.mat-focus-indicator::before{content:""}.mat-mdc-fab-base._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-fab-base::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-fab-base[hidden]{display:none}.mat-mdc-fab-base::-moz-focus-inner{padding:0;border:0}.mat-mdc-fab-base:active,.mat-mdc-fab-base:focus{outline:none}.mat-mdc-fab-base:hover{cursor:pointer}.mat-mdc-fab-base>svg{width:100%}.mat-mdc-fab-base .mat-icon,.mat-mdc-fab-base .material-icons{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mat-mdc-fab-base .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-fab-base[disabled],.mat-mdc-fab-base.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-fab-base[disabled],.mat-mdc-fab-base[disabled]:focus,.mat-mdc-fab-base.mat-mdc-button-disabled,.mat-mdc-fab-base.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-fab-base.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab{background-color:var(--mat-fab-container-color, var(--mat-sys-primary-container));border-radius:var(--mat-fab-container-shape, var(--mat-sys-corner-large));color:var(--mat-fab-foreground-color, var(--mat-sys-on-primary-container, inherit));box-shadow:var(--mat-fab-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab:hover{box-shadow:var(--mat-fab-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-fab:focus{box-shadow:var(--mat-fab-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab:active,.mat-mdc-fab:focus:active{box-shadow:var(--mat-fab-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-disabled-state-foreground-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-fab-disabled-state-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-fab-touch-target-size, 48px);display:var(--mat-fab-touch-target-display, block);left:50%;width:var(--mat-fab-touch-target-size, 48px);transform:translate(-50%, -50%)}.mat-mdc-fab .mat-ripple-element{background-color:var(--mat-fab-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-state-layer-color, var(--mat-sys-on-primary-container))}.mat-mdc-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-disabled-state-layer-color)}.mat-mdc-fab:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-fab.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-fab:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-mini-fab{width:40px;height:40px;background-color:var(--mat-fab-small-container-color, var(--mat-sys-primary-container));border-radius:var(--mat-fab-small-container-shape, var(--mat-sys-corner-medium));color:var(--mat-fab-small-foreground-color, var(--mat-sys-on-primary-container, inherit));box-shadow:var(--mat-fab-small-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab:hover{box-shadow:var(--mat-fab-small-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-mini-fab:focus{box-shadow:var(--mat-fab-small-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab:active,.mat-mdc-mini-fab:focus:active{box-shadow:var(--mat-fab-small-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-small-disabled-state-foreground-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-fab-small-disabled-state-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-mini-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-fab-small-touch-target-size, 48px);display:var(--mat-fab-small-touch-target-display);left:50%;width:var(--mat-fab-small-touch-target-size, 48px);transform:translate(-50%, -50%)}.mat-mdc-mini-fab .mat-ripple-element{background-color:var(--mat-fab-small-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-state-layer-color, var(--mat-sys-on-primary-container))}.mat-mdc-mini-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-disabled-state-layer-color)}.mat-mdc-mini-fab:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-mini-fab.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-mini-fab:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-extended-fab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:20px;padding-right:20px;width:auto;max-width:100%;line-height:normal;box-shadow:var(--mat-fab-extended-container-elevation-shadow, var(--mat-sys-level3));height:var(--mat-fab-extended-container-height, 56px);border-radius:var(--mat-fab-extended-container-shape, var(--mat-sys-corner-large));font-family:var(--mat-fab-extended-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-fab-extended-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mat-fab-extended-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-fab-extended-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-extended-fab:hover{box-shadow:var(--mat-fab-extended-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-extended-fab:focus{box-shadow:var(--mat-fab-extended-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-extended-fab:active,.mat-mdc-extended-fab:focus:active{box-shadow:var(--mat-fab-extended-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab[disabled]:focus,.mat-mdc-extended-fab.mat-mdc-button-disabled,.mat-mdc-extended-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-extended-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.mat-icon,[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.material-icons,.mat-mdc-extended-fab>.mat-icon,.mat-mdc-extended-fab>.material-icons{margin-left:-8px;margin-right:12px}.mat-mdc-extended-fab .mdc-button__label+.mat-icon,.mat-mdc-extended-fab .mdc-button__label+.material-icons,[dir=rtl] .mat-mdc-extended-fab>.mat-icon,[dir=rtl] .mat-mdc-extended-fab>.material-icons{margin-left:12px;margin-right:-8px}.mat-mdc-extended-fab .mat-mdc-button-touch-target{width:100%}\n'],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFabButton, [{
type: Component,
args: [{
selector: `button[mat-fab], a[mat-fab], button[matFab], a[matFab]`,
host: {
"class": "mdc-fab mat-mdc-fab-base mat-mdc-fab",
"[class.mdc-fab--extended]": "extended",
"[class.mat-mdc-extended-fab]": "extended"
},
exportAs: "matButton, matAnchor",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<span
class="mat-mdc-button-persistent-ripple"
[class.mdc-button__ripple]="!_isFab"
[class.mdc-fab__ripple]="_isFab"></span>
<ng-content select=".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])">
</ng-content>
<span class="mdc-button__label"><ng-content></ng-content></span>
<ng-content select=".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]">
</ng-content>
<!--
The indicator can't be directly on the button, because MDC uses ::before for high contrast
indication and it can't be on the ripple, because it has a border radius and overflow: hidden.
-->
<span class="mat-focus-indicator"></span>
<span class="mat-mdc-button-touch-target"></span>
`,
styles: ['.mat-mdc-fab-base{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:56px;height:56px;padding:0;border:none;fill:currentColor;text-decoration:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;overflow:visible;transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),opacity 15ms linear 30ms,transform 270ms 0ms cubic-bezier(0, 0, 0.2, 1);flex-shrink:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-fab-base .mat-mdc-button-ripple,.mat-mdc-fab-base .mat-mdc-button-persistent-ripple,.mat-mdc-fab-base .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-fab-base .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-fab-base .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-fab-base .mdc-button__label,.mat-mdc-fab-base .mat-icon{z-index:1;position:relative}.mat-mdc-fab-base .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-fab-base:focus>.mat-focus-indicator::before{content:""}.mat-mdc-fab-base._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-fab-base::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-fab-base[hidden]{display:none}.mat-mdc-fab-base::-moz-focus-inner{padding:0;border:0}.mat-mdc-fab-base:active,.mat-mdc-fab-base:focus{outline:none}.mat-mdc-fab-base:hover{cursor:pointer}.mat-mdc-fab-base>svg{width:100%}.mat-mdc-fab-base .mat-icon,.mat-mdc-fab-base .material-icons{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mat-mdc-fab-base .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-fab-base[disabled],.mat-mdc-fab-base.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-fab-base[disabled],.mat-mdc-fab-base[disabled]:focus,.mat-mdc-fab-base.mat-mdc-button-disabled,.mat-mdc-fab-base.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-fab-base.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab{background-color:var(--mat-fab-container-color, var(--mat-sys-primary-container));border-radius:var(--mat-fab-container-shape, var(--mat-sys-corner-large));color:var(--mat-fab-foreground-color, var(--mat-sys-on-primary-container, inherit));box-shadow:var(--mat-fab-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab:hover{box-shadow:var(--mat-fab-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-fab:focus{box-shadow:var(--mat-fab-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab:active,.mat-mdc-fab:focus:active{box-shadow:var(--mat-fab-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-disabled-state-foreground-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-fab-disabled-state-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-fab-touch-target-size, 48px);display:var(--mat-fab-touch-target-display, block);left:50%;width:var(--mat-fab-touch-target-size, 48px);transform:translate(-50%, -50%)}.mat-mdc-fab .mat-ripple-element{background-color:var(--mat-fab-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-state-layer-color, var(--mat-sys-on-primary-container))}.mat-mdc-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-disabled-state-layer-color)}.mat-mdc-fab:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-fab.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-fab:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-mini-fab{width:40px;height:40px;background-color:var(--mat-fab-small-container-color, var(--mat-sys-primary-container));border-radius:var(--mat-fab-small-container-shape, var(--mat-sys-corner-medium));color:var(--mat-fab-small-foreground-color, var(--mat-sys-on-primary-container, inherit));box-shadow:var(--mat-fab-small-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab:hover{box-shadow:var(--mat-fab-small-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-mini-fab:focus{box-shadow:var(--mat-fab-small-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab:active,.mat-mdc-mini-fab:focus:active{box-shadow:var(--mat-fab-small-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-small-disabled-state-foreground-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-fab-small-disabled-state-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-mini-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-fab-small-touch-target-size, 48px);display:var(--mat-fab-small-touch-target-display);left:50%;width:var(--mat-fab-small-touch-target-size, 48px);transform:translate(-50%, -50%)}.mat-mdc-mini-fab .mat-ripple-element{background-color:var(--mat-fab-small-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-state-layer-color, var(--mat-sys-on-primary-container))}.mat-mdc-mini-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-disabled-state-layer-color)}.mat-mdc-mini-fab:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-mini-fab.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-mini-fab:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-extended-fab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:20px;padding-right:20px;width:auto;max-width:100%;line-height:normal;box-shadow:var(--mat-fab-extended-container-elevation-shadow, var(--mat-sys-level3));height:var(--mat-fab-extended-container-height, 56px);border-radius:var(--mat-fab-extended-container-shape, var(--mat-sys-corner-large));font-family:var(--mat-fab-extended-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-fab-extended-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mat-fab-extended-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-fab-extended-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-extended-fab:hover{box-shadow:var(--mat-fab-extended-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-extended-fab:focus{box-shadow:var(--mat-fab-extended-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-extended-fab:active,.mat-mdc-extended-fab:focus:active{box-shadow:var(--mat-fab-extended-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab[disabled]:focus,.mat-mdc-extended-fab.mat-mdc-button-disabled,.mat-mdc-extended-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-extended-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.mat-icon,[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.material-icons,.mat-mdc-extended-fab>.mat-icon,.mat-mdc-extended-fab>.material-icons{margin-left:-8px;margin-right:12px}.mat-mdc-extended-fab .mdc-button__label+.mat-icon,.mat-mdc-extended-fab .mdc-button__label+.material-icons,[dir=rtl] .mat-mdc-extended-fab>.mat-icon,[dir=rtl] .mat-mdc-extended-fab>.material-icons{margin-left:12px;margin-right:-8px}.mat-mdc-extended-fab .mat-mdc-button-touch-target{width:100%}\n']
}]
}], () => [], {
extended: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}]
});
})();
var MatMiniFabButton = class _MatMiniFabButton extends MatButtonBase {
_options = inject2(MAT_FAB_DEFAULT_OPTIONS, {
optional: true
});
_isFab = true;
constructor() {
super();
this._options = this._options || defaults;
this.color = this._options.color || defaults.color;
}
static \u0275fac = function MatMiniFabButton_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatMiniFabButton)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: _MatMiniFabButton,
selectors: [["button", "mat-mini-fab", ""], ["a", "mat-mini-fab", ""], ["button", "matMiniFab", ""], ["a", "matMiniFab", ""]],
hostAttrs: [1, "mdc-fab", "mat-mdc-fab-base", "mdc-fab--mini", "mat-mdc-mini-fab"],
exportAs: ["matButton", "matAnchor"],
features: [\u0275\u0275InheritDefinitionFeature],
attrs: _c4,
ngContentSelectors: _c2,
decls: 7,
vars: 4,
consts: [[1, "mat-mdc-button-persistent-ripple"], [1, "mdc-button__label"], [1, "mat-focus-indicator"], [1, "mat-mdc-button-touch-target"]],
template: function MatMiniFabButton_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275projectionDef(_c12);
\u0275\u0275domElement(0, "span", 0);
\u0275\u0275projection(1);
\u0275\u0275domElementStart(2, "span", 1);
\u0275\u0275projection(3, 1);
\u0275\u0275domElementEnd();
\u0275\u0275projection(4, 2);
\u0275\u0275domElement(5, "span", 2)(6, "span", 3);
}
if (rf & 2) {
\u0275\u0275classProp("mdc-button__ripple", !ctx._isFab)("mdc-fab__ripple", ctx._isFab);
}
},
styles: [_c5],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatMiniFabButton, [{
type: Component,
args: [{
selector: `button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]`,
host: {
"class": "mdc-fab mat-mdc-fab-base mdc-fab--mini mat-mdc-mini-fab"
},
exportAs: "matButton, matAnchor",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<span
class="mat-mdc-button-persistent-ripple"
[class.mdc-button__ripple]="!_isFab"
[class.mdc-fab__ripple]="_isFab"></span>
<ng-content select=".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])">
</ng-content>
<span class="mdc-button__label"><ng-content></ng-content></span>
<ng-content select=".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]">
</ng-content>
<!--
The indicator can't be directly on the button, because MDC uses ::before for high contrast
indication and it can't be on the ripple, because it has a border radius and overflow: hidden.
-->
<span class="mat-focus-indicator"></span>
<span class="mat-mdc-button-touch-target"></span>
`,
styles: ['.mat-mdc-fab-base{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:56px;height:56px;padding:0;border:none;fill:currentColor;text-decoration:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;overflow:visible;transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),opacity 15ms linear 30ms,transform 270ms 0ms cubic-bezier(0, 0, 0.2, 1);flex-shrink:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-fab-base .mat-mdc-button-ripple,.mat-mdc-fab-base .mat-mdc-button-persistent-ripple,.mat-mdc-fab-base .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-fab-base .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-fab-base .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-fab-base .mdc-button__label,.mat-mdc-fab-base .mat-icon{z-index:1;position:relative}.mat-mdc-fab-base .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-fab-base:focus>.mat-focus-indicator::before{content:""}.mat-mdc-fab-base._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-fab-base::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-fab-base[hidden]{display:none}.mat-mdc-fab-base::-moz-focus-inner{padding:0;border:0}.mat-mdc-fab-base:active,.mat-mdc-fab-base:focus{outline:none}.mat-mdc-fab-base:hover{cursor:pointer}.mat-mdc-fab-base>svg{width:100%}.mat-mdc-fab-base .mat-icon,.mat-mdc-fab-base .material-icons{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mat-mdc-fab-base .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-fab-base[disabled],.mat-mdc-fab-base.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-fab-base[disabled],.mat-mdc-fab-base[disabled]:focus,.mat-mdc-fab-base.mat-mdc-button-disabled,.mat-mdc-fab-base.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-fab-base.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab{background-color:var(--mat-fab-container-color, var(--mat-sys-primary-container));border-radius:var(--mat-fab-container-shape, var(--mat-sys-corner-large));color:var(--mat-fab-foreground-color, var(--mat-sys-on-primary-container, inherit));box-shadow:var(--mat-fab-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab:hover{box-shadow:var(--mat-fab-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-fab:focus{box-shadow:var(--mat-fab-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab:active,.mat-mdc-fab:focus:active{box-shadow:var(--mat-fab-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-disabled-state-foreground-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-fab-disabled-state-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-fab-touch-target-size, 48px);display:var(--mat-fab-touch-target-display, block);left:50%;width:var(--mat-fab-touch-target-size, 48px);transform:translate(-50%, -50%)}.mat-mdc-fab .mat-ripple-element{background-color:var(--mat-fab-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-state-layer-color, var(--mat-sys-on-primary-container))}.mat-mdc-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-disabled-state-layer-color)}.mat-mdc-fab:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-fab.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-fab:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-mini-fab{width:40px;height:40px;background-color:var(--mat-fab-small-container-color, var(--mat-sys-primary-container));border-radius:var(--mat-fab-small-container-shape, var(--mat-sys-corner-medium));color:var(--mat-fab-small-foreground-color, var(--mat-sys-on-primary-container, inherit));box-shadow:var(--mat-fab-small-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab:hover{box-shadow:var(--mat-fab-small-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-mini-fab:focus{box-shadow:var(--mat-fab-small-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab:active,.mat-mdc-mini-fab:focus:active{box-shadow:var(--mat-fab-small-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-small-disabled-state-foreground-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-fab-small-disabled-state-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-mini-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-fab-small-touch-target-size, 48px);display:var(--mat-fab-small-touch-target-display);left:50%;width:var(--mat-fab-small-touch-target-size, 48px);transform:translate(-50%, -50%)}.mat-mdc-mini-fab .mat-ripple-element{background-color:var(--mat-fab-small-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-state-layer-color, var(--mat-sys-on-primary-container))}.mat-mdc-mini-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-disabled-state-layer-color)}.mat-mdc-mini-fab:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-mini-fab.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-mini-fab:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-extended-fab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:20px;padding-right:20px;width:auto;max-width:100%;line-height:normal;box-shadow:var(--mat-fab-extended-container-elevation-shadow, var(--mat-sys-level3));height:var(--mat-fab-extended-container-height, 56px);border-radius:var(--mat-fab-extended-container-shape, var(--mat-sys-corner-large));font-family:var(--mat-fab-extended-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-fab-extended-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mat-fab-extended-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-fab-extended-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-extended-fab:hover{box-shadow:var(--mat-fab-extended-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-extended-fab:focus{box-shadow:var(--mat-fab-extended-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-extended-fab:active,.mat-mdc-extended-fab:focus:active{box-shadow:var(--mat-fab-extended-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab[disabled]:focus,.mat-mdc-extended-fab.mat-mdc-button-disabled,.mat-mdc-extended-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-extended-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.mat-icon,[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.material-icons,.mat-mdc-extended-fab>.mat-icon,.mat-mdc-extended-fab>.material-icons{margin-left:-8px;margin-right:12px}.mat-mdc-extended-fab .mdc-button__label+.mat-icon,.mat-mdc-extended-fab .mdc-button__label+.material-icons,[dir=rtl] .mat-mdc-extended-fab>.mat-icon,[dir=rtl] .mat-mdc-extended-fab>.material-icons{margin-left:12px;margin-right:-8px}.mat-mdc-extended-fab .mat-mdc-button-touch-target{width:100%}\n']
}]
}], () => [], null);
})();
var MatButtonModule = class _MatButtonModule {
static \u0275fac = function MatButtonModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatButtonModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _MatButtonModule,
imports: [MatCommonModule, MatRippleModule, MatButton, MatMiniFabButton, MatIconButton, MatFabButton],
exports: [MatCommonModule, MatButton, MatMiniFabButton, MatIconButton, MatFabButton]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
imports: [MatCommonModule, MatRippleModule, MatCommonModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatButtonModule, [{
type: NgModule,
args: [{
imports: [MatCommonModule, MatRippleModule, MatButton, MatMiniFabButton, MatIconButton, MatFabButton],
exports: [MatCommonModule, MatButton, MatMiniFabButton, MatIconButton, MatFabButton]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/icon-registry.mjs
var policy2;
function getPolicy2() {
if (policy2 === void 0) {
policy2 = null;
if (typeof window !== "undefined") {
const ttWindow = window;
if (ttWindow.trustedTypes !== void 0) {
policy2 = ttWindow.trustedTypes.createPolicy("angular#components", {
createHTML: (s) => s
});
}
}
}
return policy2;
}
function trustedHTMLFromString2(html) {
return getPolicy2()?.createHTML(html) || html;
}
function getMatIconNameNotFoundError(iconName) {
return Error(`Unable to find icon with the name "${iconName}"`);
}
function getMatIconNoHttpProviderError() {
return Error("Could not find HttpClient for use with Angular Material icons. Please add provideHttpClient() to your providers.");
}
function getMatIconFailedToSanitizeUrlError(url) {
return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${url}".`);
}
function getMatIconFailedToSanitizeLiteralError(literal) {
return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${literal}".`);
}
var SvgIconConfig = class {
url;
svgText;
options;
svgElement;
constructor(url, svgText, options) {
this.url = url;
this.svgText = svgText;
this.options = options;
}
};
var MatIconRegistry = class _MatIconRegistry {
_httpClient;
_sanitizer;
_errorHandler;
_document;
/**
* URLs and cached SVG elements for individual icons. Keys are of the format "[namespace]:[icon]".
*/
_svgIconConfigs = /* @__PURE__ */ new Map();
/**
* SvgIconConfig objects and cached SVG elements for icon sets, keyed by namespace.
* Multiple icon sets can be registered under the same namespace.
*/
_iconSetConfigs = /* @__PURE__ */ new Map();
/** Cache for icons loaded by direct URLs. */
_cachedIconsByUrl = /* @__PURE__ */ new Map();
/** In-progress icon fetches. Used to coalesce multiple requests to the same URL. */
_inProgressUrlFetches = /* @__PURE__ */ new Map();
/** Map from font identifiers to their CSS class names. Used for icon fonts. */
_fontCssClassesByAlias = /* @__PURE__ */ new Map();
/** Registered icon resolver functions. */
_resolvers = [];
/**
* The CSS classes to apply when an `<mat-icon>` component has no icon name, url, or font
* specified. The default 'material-icons' value assumes that the material icon font has been
* loaded as described at https://google.github.io/material-design-icons/#icon-font-for-the-web
*/
_defaultFontSetClass = ["material-icons", "mat-ligature-font"];
constructor(_httpClient, _sanitizer, document2, _errorHandler) {
this._httpClient = _httpClient;
this._sanitizer = _sanitizer;
this._errorHandler = _errorHandler;
this._document = document2;
}
/**
* Registers an icon by URL in the default namespace.
* @param iconName Name under which the icon should be registered.
* @param url
*/
addSvgIcon(iconName, url, options) {
return this.addSvgIconInNamespace("", iconName, url, options);
}
/**
* Registers an icon using an HTML string in the default namespace.
* @param iconName Name under which the icon should be registered.
* @param literal SVG source of the icon.
*/
addSvgIconLiteral(iconName, literal, options) {
return this.addSvgIconLiteralInNamespace("", iconName, literal, options);
}
/**
* Registers an icon by URL in the specified namespace.
* @param namespace Namespace in which the icon should be registered.
* @param iconName Name under which the icon should be registered.
* @param url
*/
addSvgIconInNamespace(namespace, iconName, url, options) {
return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig(url, null, options));
}
/**
* Registers an icon resolver function with the registry. The function will be invoked with the
* name and namespace of an icon when the registry tries to resolve the URL from which to fetch
* the icon. The resolver is expected to return a `SafeResourceUrl` that points to the icon,
* an object with the icon URL and icon options, or `null` if the icon is not supported. Resolvers
* will be invoked in the order in which they have been registered.
* @param resolver Resolver function to be registered.
*/
addSvgIconResolver(resolver) {
this._resolvers.push(resolver);
return this;
}
/**
* Registers an icon using an HTML string in the specified namespace.
* @param namespace Namespace in which the icon should be registered.
* @param iconName Name under which the icon should be registered.
* @param literal SVG source of the icon.
*/
addSvgIconLiteralInNamespace(namespace, iconName, literal, options) {
const cleanLiteral = this._sanitizer.sanitize(SecurityContext.HTML, literal);
if (!cleanLiteral) {
throw getMatIconFailedToSanitizeLiteralError(literal);
}
const trustedLiteral = trustedHTMLFromString2(cleanLiteral);
return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig("", trustedLiteral, options));
}
/**
* Registers an icon set by URL in the default namespace.
* @param url
*/
addSvgIconSet(url, options) {
return this.addSvgIconSetInNamespace("", url, options);
}
/**
* Registers an icon set using an HTML string in the default namespace.
* @param literal SVG source of the icon set.
*/
addSvgIconSetLiteral(literal, options) {
return this.addSvgIconSetLiteralInNamespace("", literal, options);
}
/**
* Registers an icon set by URL in the specified namespace.
* @param namespace Namespace in which to register the icon set.
* @param url
*/
addSvgIconSetInNamespace(namespace, url, options) {
return this._addSvgIconSetConfig(namespace, new SvgIconConfig(url, null, options));
}
/**
* Registers an icon set using an HTML string in the specified namespace.
* @param namespace Namespace in which to register the icon set.
* @param literal SVG source of the icon set.
*/
addSvgIconSetLiteralInNamespace(namespace, literal, options) {
const cleanLiteral = this._sanitizer.sanitize(SecurityContext.HTML, literal);
if (!cleanLiteral) {
throw getMatIconFailedToSanitizeLiteralError(literal);
}
const trustedLiteral = trustedHTMLFromString2(cleanLiteral);
return this._addSvgIconSetConfig(namespace, new SvgIconConfig("", trustedLiteral, options));
}
/**
* Defines an alias for CSS class names to be used for icon fonts. Creating an matIcon
* component with the alias as the fontSet input will cause the class name to be applied
* to the `<mat-icon>` element.
*
* If the registered font is a ligature font, then don't forget to also include the special
* class `mat-ligature-font` to allow the usage via attribute. So register like this:
*
* ```ts
* iconRegistry.registerFontClassAlias('f1', 'font1 mat-ligature-font');
* ```
*
* And use like this:
*
* ```html
* <mat-icon fontSet="f1" fontIcon="home"></mat-icon>
* ```
*
* @param alias Alias for the font.
* @param classNames Class names override to be used instead of the alias.
*/
registerFontClassAlias(alias, classNames = alias) {
this._fontCssClassesByAlias.set(alias, classNames);
return this;
}
/**
* Returns the CSS class name associated with the alias by a previous call to
* registerFontClassAlias. If no CSS class has been associated, returns the alias unmodified.
*/
classNameForFontAlias(alias) {
return this._fontCssClassesByAlias.get(alias) || alias;
}
/**
* Sets the CSS classes to be used for icon fonts when an `<mat-icon>` component does not
* have a fontSet input value, and is not loading an icon by name or URL.
*/
setDefaultFontSetClass(...classNames) {
this._defaultFontSetClass = classNames;
return this;
}
/**
* Returns the CSS classes to be used for icon fonts when an `<mat-icon>` component does not
* have a fontSet input value, and is not loading an icon by name or URL.
*/
getDefaultFontSetClass() {
return this._defaultFontSetClass;
}
/**
* Returns an Observable that produces the icon (as an `<svg>` DOM element) from the given URL.
* The response from the URL may be cached so this will not always cause an HTTP request, but
* the produced element will always be a new copy of the originally fetched icon. (That is,
* it will not contain any modifications made to elements previously returned).
*
* @param safeUrl URL from which to fetch the SVG icon.
*/
getSvgIconFromUrl(safeUrl) {
const url = this._sanitizer.sanitize(SecurityContext.RESOURCE_URL, safeUrl);
if (!url) {
throw getMatIconFailedToSanitizeUrlError(safeUrl);
}
const cachedIcon = this._cachedIconsByUrl.get(url);
if (cachedIcon) {
return of(cloneSvg(cachedIcon));
}
return this._loadSvgIconFromConfig(new SvgIconConfig(safeUrl, null)).pipe(tap((svg) => this._cachedIconsByUrl.set(url, svg)), map((svg) => cloneSvg(svg)));
}
/**
* Returns an Observable that produces the icon (as an `<svg>` DOM element) with the given name
* and namespace. The icon must have been previously registered with addIcon or addIconSet;
* if not, the Observable will throw an error.
*
* @param name Name of the icon to be retrieved.
* @param namespace Namespace in which to look for the icon.
*/
getNamedSvgIcon(name, namespace = "") {
const key = iconKey(namespace, name);
let config2 = this._svgIconConfigs.get(key);
if (config2) {
return this._getSvgFromConfig(config2);
}
config2 = this._getIconConfigFromResolvers(namespace, name);
if (config2) {
this._svgIconConfigs.set(key, config2);
return this._getSvgFromConfig(config2);
}
const iconSetConfigs = this._iconSetConfigs.get(namespace);
if (iconSetConfigs) {
return this._getSvgFromIconSetConfigs(name, iconSetConfigs);
}
return throwError(getMatIconNameNotFoundError(key));
}
ngOnDestroy() {
this._resolvers = [];
this._svgIconConfigs.clear();
this._iconSetConfigs.clear();
this._cachedIconsByUrl.clear();
}
/**
* Returns the cached icon for a SvgIconConfig if available, or fetches it from its URL if not.
*/
_getSvgFromConfig(config2) {
if (config2.svgText) {
return of(cloneSvg(this._svgElementFromConfig(config2)));
} else {
return this._loadSvgIconFromConfig(config2).pipe(map((svg) => cloneSvg(svg)));
}
}
/**
* Attempts to find an icon with the specified name in any of the SVG icon sets.
* First searches the available cached icons for a nested element with a matching name, and
* if found copies the element to a new `<svg>` element. If not found, fetches all icon sets
* that have not been cached, and searches again after all fetches are completed.
* The returned Observable produces the SVG element if possible, and throws
* an error if no icon with the specified name can be found.
*/
_getSvgFromIconSetConfigs(name, iconSetConfigs) {
const namedIcon = this._extractIconWithNameFromAnySet(name, iconSetConfigs);
if (namedIcon) {
return of(namedIcon);
}
const iconSetFetchRequests = iconSetConfigs.filter((iconSetConfig) => !iconSetConfig.svgText).map((iconSetConfig) => {
return this._loadSvgIconSetFromConfig(iconSetConfig).pipe(catchError((err) => {
const url = this._sanitizer.sanitize(SecurityContext.RESOURCE_URL, iconSetConfig.url);
const errorMessage = `Loading icon set URL: ${url} failed: ${err.message}`;
this._errorHandler.handleError(new Error(errorMessage));
return of(null);
}));
});
return forkJoin(iconSetFetchRequests).pipe(map(() => {
const foundIcon = this._extractIconWithNameFromAnySet(name, iconSetConfigs);
if (!foundIcon) {
throw getMatIconNameNotFoundError(name);
}
return foundIcon;
}));
}
/**
* Searches the cached SVG elements for the given icon sets for a nested icon element whose "id"
* tag matches the specified name. If found, copies the nested element to a new SVG element and
* returns it. Returns null if no matching element is found.
*/
_extractIconWithNameFromAnySet(iconName, iconSetConfigs) {
for (let i = iconSetConfigs.length - 1; i >= 0; i--) {
const config2 = iconSetConfigs[i];
if (config2.svgText && config2.svgText.toString().indexOf(iconName) > -1) {
const svg = this._svgElementFromConfig(config2);
const foundIcon = this._extractSvgIconFromSet(svg, iconName, config2.options);
if (foundIcon) {
return foundIcon;
}
}
}
return null;
}
/**
* Loads the content of the icon URL specified in the SvgIconConfig and creates an SVG element
* from it.
*/
_loadSvgIconFromConfig(config2) {
return this._fetchIcon(config2).pipe(tap((svgText) => config2.svgText = svgText), map(() => this._svgElementFromConfig(config2)));
}
/**
* Loads the content of the icon set URL specified in the
* SvgIconConfig and attaches it to the config.
*/
_loadSvgIconSetFromConfig(config2) {
if (config2.svgText) {
return of(null);
}
return this._fetchIcon(config2).pipe(tap((svgText) => config2.svgText = svgText));
}
/**
* Searches the cached element of the given SvgIconConfig for a nested icon element whose "id"
* tag matches the specified name. If found, copies the nested element to a new SVG element and
* returns it. Returns null if no matching element is found.
*/
_extractSvgIconFromSet(iconSet, iconName, options) {
const iconSource = iconSet.querySelector(`[id="${iconName}"]`);
if (!iconSource) {
return null;
}
const iconElement = iconSource.cloneNode(true);
iconElement.removeAttribute("id");
if (iconElement.nodeName.toLowerCase() === "svg") {
return this._setSvgAttributes(iconElement, options);
}
if (iconElement.nodeName.toLowerCase() === "symbol") {
return this._setSvgAttributes(this._toSvgElement(iconElement), options);
}
const svg = this._svgElementFromString(trustedHTMLFromString2("<svg></svg>"));
svg.appendChild(iconElement);
return this._setSvgAttributes(svg, options);
}
/**
* Creates a DOM element from the given SVG string.
*/
_svgElementFromString(str) {
const div = this._document.createElement("DIV");
div.innerHTML = str;
const svg = div.querySelector("svg");
if (!svg) {
throw Error("<svg> tag not found");
}
return svg;
}
/**
* Converts an element into an SVG node by cloning all of its children.
*/
_toSvgElement(element) {
const svg = this._svgElementFromString(trustedHTMLFromString2("<svg></svg>"));
const attributes = element.attributes;
for (let i = 0; i < attributes.length; i++) {
const {
name,
value
} = attributes[i];
if (name !== "id") {
svg.setAttribute(name, value);
}
}
for (let i = 0; i < element.childNodes.length; i++) {
if (element.childNodes[i].nodeType === this._document.ELEMENT_NODE) {
svg.appendChild(element.childNodes[i].cloneNode(true));
}
}
return svg;
}
/**
* Sets the default attributes for an SVG element to be used as an icon.
*/
_setSvgAttributes(svg, options) {
svg.setAttribute("fit", "");
svg.setAttribute("height", "100%");
svg.setAttribute("width", "100%");
svg.setAttribute("preserveAspectRatio", "xMidYMid meet");
svg.setAttribute("focusable", "false");
if (options && options.viewBox) {
svg.setAttribute("viewBox", options.viewBox);
}
return svg;
}
/**
* Returns an Observable which produces the string contents of the given icon. Results may be
* cached, so future calls with the same URL may not cause another HTTP request.
*/
_fetchIcon(iconConfig) {
const {
url: safeUrl,
options
} = iconConfig;
const withCredentials = options?.withCredentials ?? false;
if (!this._httpClient) {
throw getMatIconNoHttpProviderError();
}
if (safeUrl == null) {
throw Error(`Cannot fetch icon from URL "${safeUrl}".`);
}
const url = this._sanitizer.sanitize(SecurityContext.RESOURCE_URL, safeUrl);
if (!url) {
throw getMatIconFailedToSanitizeUrlError(safeUrl);
}
const inProgressFetch = this._inProgressUrlFetches.get(url);
if (inProgressFetch) {
return inProgressFetch;
}
const req = this._httpClient.get(url, {
responseType: "text",
withCredentials
}).pipe(map((svg) => {
return trustedHTMLFromString2(svg);
}), finalize(() => this._inProgressUrlFetches.delete(url)), share());
this._inProgressUrlFetches.set(url, req);
return req;
}
/**
* Registers an icon config by name in the specified namespace.
* @param namespace Namespace in which to register the icon config.
* @param iconName Name under which to register the config.
* @param config Config to be registered.
*/
_addSvgIconConfig(namespace, iconName, config2) {
this._svgIconConfigs.set(iconKey(namespace, iconName), config2);
return this;
}
/**
* Registers an icon set config in the specified namespace.
* @param namespace Namespace in which to register the icon config.
* @param config Config to be registered.
*/
_addSvgIconSetConfig(namespace, config2) {
const configNamespace = this._iconSetConfigs.get(namespace);
if (configNamespace) {
configNamespace.push(config2);
} else {
this._iconSetConfigs.set(namespace, [config2]);
}
return this;
}
/** Parses a config's text into an SVG element. */
_svgElementFromConfig(config2) {
if (!config2.svgElement) {
const svg = this._svgElementFromString(config2.svgText);
this._setSvgAttributes(svg, config2.options);
config2.svgElement = svg;
}
return config2.svgElement;
}
/** Tries to create an icon config through the registered resolver functions. */
_getIconConfigFromResolvers(namespace, name) {
for (let i = 0; i < this._resolvers.length; i++) {
const result = this._resolvers[i](name, namespace);
if (result) {
return isSafeUrlWithOptions(result) ? new SvgIconConfig(result.url, null, result.options) : new SvgIconConfig(result, null);
}
}
return void 0;
}
static \u0275fac = function MatIconRegistry_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatIconRegistry)(\u0275\u0275inject(HttpClient, 8), \u0275\u0275inject(DomSanitizer), \u0275\u0275inject(DOCUMENT, 8), \u0275\u0275inject(ErrorHandler));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _MatIconRegistry,
factory: _MatIconRegistry.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatIconRegistry, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [{
type: HttpClient,
decorators: [{
type: Optional
}]
}, {
type: DomSanitizer
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Inject,
args: [DOCUMENT]
}]
}, {
type: ErrorHandler
}], null);
})();
function ICON_REGISTRY_PROVIDER_FACTORY(parentRegistry, httpClient, sanitizer, errorHandler2, document2) {
return parentRegistry || new MatIconRegistry(httpClient, sanitizer, document2, errorHandler2);
}
var ICON_REGISTRY_PROVIDER = {
// If there is already an MatIconRegistry available, use that. Otherwise, provide a new one.
provide: MatIconRegistry,
deps: [[new Optional(), new SkipSelf(), MatIconRegistry], [new Optional(), HttpClient], DomSanitizer, ErrorHandler, [new Optional(), DOCUMENT]],
useFactory: ICON_REGISTRY_PROVIDER_FACTORY
};
function cloneSvg(svg) {
return svg.cloneNode(true);
}
function iconKey(namespace, name) {
return namespace + ":" + name;
}
function isSafeUrlWithOptions(value) {
return !!(value.url && value.options);
}
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/icon.mjs
var _c03 = ["*"];
var MAT_ICON_DEFAULT_OPTIONS = new InjectionToken("MAT_ICON_DEFAULT_OPTIONS");
var MAT_ICON_LOCATION = new InjectionToken("mat-icon-location", {
providedIn: "root",
factory: MAT_ICON_LOCATION_FACTORY
});
function MAT_ICON_LOCATION_FACTORY() {
const _document2 = inject2(DOCUMENT);
const _location = _document2 ? _document2.location : null;
return {
// Note that this needs to be a function, rather than a property, because Angular
// will only resolve it once, but we want the current path on each call.
getPathname: () => _location ? _location.pathname + _location.search : ""
};
}
var funcIriAttributes = ["clip-path", "color-profile", "src", "cursor", "fill", "filter", "marker", "marker-start", "marker-mid", "marker-end", "mask", "stroke"];
var funcIriAttributeSelector = funcIriAttributes.map((attr) => `[${attr}]`).join(", ");
var funcIriPattern = /^url\(['"]?#(.*?)['"]?\)$/;
var MatIcon = class _MatIcon {
_elementRef = inject2(ElementRef);
_iconRegistry = inject2(MatIconRegistry);
_location = inject2(MAT_ICON_LOCATION);
_errorHandler = inject2(ErrorHandler);
_defaultColor;
/**
* Theme color of the icon. This API is supported in M2 themes only, it
* has no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/icon/styling.
*
* For information on applying color variants in M3, see
* https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants
*/
get color() {
return this._color || this._defaultColor;
}
set color(value) {
this._color = value;
}
_color;
/**
* Whether the icon should be inlined, automatically sizing the icon to match the font size of
* the element the icon is contained in.
*/
inline = false;
/** Name of the icon in the SVG icon set. */
get svgIcon() {
return this._svgIcon;
}
set svgIcon(value) {
if (value !== this._svgIcon) {
if (value) {
this._updateSvgIcon(value);
} else if (this._svgIcon) {
this._clearSvgElement();
}
this._svgIcon = value;
}
}
_svgIcon;
/** Font set that the icon is a part of. */
get fontSet() {
return this._fontSet;
}
set fontSet(value) {
const newValue = this._cleanupFontValue(value);
if (newValue !== this._fontSet) {
this._fontSet = newValue;
this._updateFontIconClasses();
}
}
_fontSet;
/** Name of an icon within a font set. */
get fontIcon() {
return this._fontIcon;
}
set fontIcon(value) {
const newValue = this._cleanupFontValue(value);
if (newValue !== this._fontIcon) {
this._fontIcon = newValue;
this._updateFontIconClasses();
}
}
_fontIcon;
_previousFontSetClass = [];
_previousFontIconClass;
_svgName;
_svgNamespace;
/** Keeps track of the current page path. */
_previousPath;
/** Keeps track of the elements and attributes that we've prefixed with the current path. */
_elementsWithExternalReferences;
/** Subscription to the current in-progress SVG icon request. */
_currentIconFetch = Subscription.EMPTY;
constructor() {
const ariaHidden = inject2(new HostAttributeToken("aria-hidden"), {
optional: true
});
const defaults2 = inject2(MAT_ICON_DEFAULT_OPTIONS, {
optional: true
});
if (defaults2) {
if (defaults2.color) {
this.color = this._defaultColor = defaults2.color;
}
if (defaults2.fontSet) {
this.fontSet = defaults2.fontSet;
}
}
if (!ariaHidden) {
this._elementRef.nativeElement.setAttribute("aria-hidden", "true");
}
}
/**
* Splits an svgIcon binding value into its icon set and icon name components.
* Returns a 2-element array of [(icon set), (icon name)].
* The separator for the two fields is ':'. If there is no separator, an empty
* string is returned for the icon set and the entire value is returned for
* the icon name. If the argument is falsy, returns an array of two empty strings.
* Throws an error if the name contains two or more ':' separators.
* Examples:
* `'social:cake' -> ['social', 'cake']
* 'penguin' -> ['', 'penguin']
* null -> ['', '']
* 'a:b:c' -> (throws Error)`
*/
_splitIconName(iconName) {
if (!iconName) {
return ["", ""];
}
const parts = iconName.split(":");
switch (parts.length) {
case 1:
return ["", parts[0]];
// Use default namespace.
case 2:
return parts;
default:
throw Error(`Invalid icon name: "${iconName}"`);
}
}
ngOnInit() {
this._updateFontIconClasses();
}
ngAfterViewChecked() {
const cachedElements = this._elementsWithExternalReferences;
if (cachedElements && cachedElements.size) {
const newPath = this._location.getPathname();
if (newPath !== this._previousPath) {
this._previousPath = newPath;
this._prependPathToReferences(newPath);
}
}
}
ngOnDestroy() {
this._currentIconFetch.unsubscribe();
if (this._elementsWithExternalReferences) {
this._elementsWithExternalReferences.clear();
}
}
_usingFontIcon() {
return !this.svgIcon;
}
_setSvgElement(svg) {
this._clearSvgElement();
const path = this._location.getPathname();
this._previousPath = path;
this._cacheChildrenWithExternalReferences(svg);
this._prependPathToReferences(path);
this._elementRef.nativeElement.appendChild(svg);
}
_clearSvgElement() {
const layoutElement = this._elementRef.nativeElement;
let childCount = layoutElement.childNodes.length;
if (this._elementsWithExternalReferences) {
this._elementsWithExternalReferences.clear();
}
while (childCount--) {
const child = layoutElement.childNodes[childCount];
if (child.nodeType !== 1 || child.nodeName.toLowerCase() === "svg") {
child.remove();
}
}
}
_updateFontIconClasses() {
if (!this._usingFontIcon()) {
return;
}
const elem = this._elementRef.nativeElement;
const fontSetClasses = (this.fontSet ? this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/) : this._iconRegistry.getDefaultFontSetClass()).filter((className) => className.length > 0);
this._previousFontSetClass.forEach((className) => elem.classList.remove(className));
fontSetClasses.forEach((className) => elem.classList.add(className));
this._previousFontSetClass = fontSetClasses;
if (this.fontIcon !== this._previousFontIconClass && !fontSetClasses.includes("mat-ligature-font")) {
if (this._previousFontIconClass) {
elem.classList.remove(this._previousFontIconClass);
}
if (this.fontIcon) {
elem.classList.add(this.fontIcon);
}
this._previousFontIconClass = this.fontIcon;
}
}
/**
* Cleans up a value to be used as a fontIcon or fontSet.
* Since the value ends up being assigned as a CSS class, we
* have to trim the value and omit space-separated values.
*/
_cleanupFontValue(value) {
return typeof value === "string" ? value.trim().split(" ")[0] : value;
}
/**
* Prepends the current path to all elements that have an attribute pointing to a `FuncIRI`
* reference. This is required because WebKit browsers require references to be prefixed with
* the current path, if the page has a `base` tag.
*/
_prependPathToReferences(path) {
const elements = this._elementsWithExternalReferences;
if (elements) {
elements.forEach((attrs, element) => {
attrs.forEach((attr) => {
element.setAttribute(attr.name, `url('${path}#${attr.value}')`);
});
});
}
}
/**
* Caches the children of an SVG element that have `url()`
* references that we need to prefix with the current path.
*/
_cacheChildrenWithExternalReferences(element) {
const elementsWithFuncIri = element.querySelectorAll(funcIriAttributeSelector);
const elements = this._elementsWithExternalReferences = this._elementsWithExternalReferences || /* @__PURE__ */ new Map();
for (let i = 0; i < elementsWithFuncIri.length; i++) {
funcIriAttributes.forEach((attr) => {
const elementWithReference = elementsWithFuncIri[i];
const value = elementWithReference.getAttribute(attr);
const match = value ? value.match(funcIriPattern) : null;
if (match) {
let attributes = elements.get(elementWithReference);
if (!attributes) {
attributes = [];
elements.set(elementWithReference, attributes);
}
attributes.push({
name: attr,
value: match[1]
});
}
});
}
}
/** Sets a new SVG icon with a particular name. */
_updateSvgIcon(rawName) {
this._svgNamespace = null;
this._svgName = null;
this._currentIconFetch.unsubscribe();
if (rawName) {
const [namespace, iconName] = this._splitIconName(rawName);
if (namespace) {
this._svgNamespace = namespace;
}
if (iconName) {
this._svgName = iconName;
}
this._currentIconFetch = this._iconRegistry.getNamedSvgIcon(iconName, namespace).pipe(take(1)).subscribe((svg) => this._setSvgElement(svg), (err) => {
const errorMessage = `Error retrieving icon ${namespace}:${iconName}! ${err.message}`;
this._errorHandler.handleError(new Error(errorMessage));
});
}
}
static \u0275fac = function MatIcon_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatIcon)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: _MatIcon,
selectors: [["mat-icon"]],
hostAttrs: ["role", "img", 1, "mat-icon", "notranslate"],
hostVars: 10,
hostBindings: function MatIcon_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275attribute("data-mat-icon-type", ctx._usingFontIcon() ? "font" : "svg")("data-mat-icon-name", ctx._svgName || ctx.fontIcon)("data-mat-icon-namespace", ctx._svgNamespace || ctx.fontSet)("fontIcon", ctx._usingFontIcon() ? ctx.fontIcon : null);
\u0275\u0275classMap(ctx.color ? "mat-" + ctx.color : "");
\u0275\u0275classProp("mat-icon-inline", ctx.inline)("mat-icon-no-color", ctx.color !== "primary" && ctx.color !== "accent" && ctx.color !== "warn");
}
},
inputs: {
color: "color",
inline: [2, "inline", "inline", booleanAttribute],
svgIcon: "svgIcon",
fontSet: "fontSet",
fontIcon: "fontIcon"
},
exportAs: ["matIcon"],
ngContentSelectors: _c03,
decls: 1,
vars: 0,
template: function MatIcon_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275projectionDef();
\u0275\u0275projection(0);
}
},
styles: ["mat-icon,mat-icon.mat-primary,mat-icon.mat-accent,mat-icon.mat-warn{color:var(--mat-icon-color, inherit)}.mat-icon{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px;overflow:hidden}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}.mat-icon.mat-ligature-font[fontIcon]::before{content:attr(fontIcon)}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}\n"],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatIcon, [{
type: Component,
args: [{
template: "<ng-content></ng-content>",
selector: "mat-icon",
exportAs: "matIcon",
host: {
"role": "img",
"class": "mat-icon notranslate",
"[class]": 'color ? "mat-" + color : ""',
"[attr.data-mat-icon-type]": '_usingFontIcon() ? "font" : "svg"',
"[attr.data-mat-icon-name]": "_svgName || fontIcon",
"[attr.data-mat-icon-namespace]": "_svgNamespace || fontSet",
"[attr.fontIcon]": "_usingFontIcon() ? fontIcon : null",
"[class.mat-icon-inline]": "inline",
"[class.mat-icon-no-color]": 'color !== "primary" && color !== "accent" && color !== "warn"'
},
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
styles: ["mat-icon,mat-icon.mat-primary,mat-icon.mat-accent,mat-icon.mat-warn{color:var(--mat-icon-color, inherit)}.mat-icon{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px;overflow:hidden}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}.mat-icon.mat-ligature-font[fontIcon]::before{content:attr(fontIcon)}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}\n"]
}]
}], () => [], {
color: [{
type: Input
}],
inline: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
svgIcon: [{
type: Input
}],
fontSet: [{
type: Input
}],
fontIcon: [{
type: Input
}]
});
})();
var MatIconModule = class _MatIconModule {
static \u0275fac = function MatIconModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatIconModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _MatIconModule,
imports: [MatCommonModule, MatIcon],
exports: [MatIcon, MatCommonModule]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
imports: [MatCommonModule, MatCommonModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatIconModule, [{
type: NgModule,
args: [{
imports: [MatCommonModule, MatIcon],
exports: [MatIcon, MatCommonModule]
}]
}], null, null);
})();
// src/app/page/shared/icon-button/icon-button.ts
var _c04 = ["*"];
var IconButton = class _IconButton {
static \u0275fac = function IconButton_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _IconButton)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _IconButton, selectors: [["app-icon-button"]], ngContentSelectors: _c04, decls: 3, vars: 0, consts: [["matIconButton", ""]], template: function IconButton_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275projectionDef();
\u0275\u0275elementStart(0, "button", 0)(1, "mat-icon");
\u0275\u0275projection(2);
\u0275\u0275elementEnd()();
}
}, dependencies: [
MatIcon,
MatIconButton
], styles: ["\n\n[_nghost-%COMP%] button[matIconButton][_ngcontent-%COMP%] {\n font-size: 16px;\n width: 24px;\n height: 24px;\n padding: 4px;\n}\n[_nghost-%COMP%] button[matIconButton][_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%] {\n font-size: 16px;\n width: 16px;\n height: 16px;\n}\n/*# sourceMappingURL=icon-button.css.map */"] });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(IconButton, [{
type: Component,
args: [{ selector: "app-icon-button", imports: [
MatIcon,
MatIconButton
], template: "<button matIconButton>\n <mat-icon>\n <ng-content></ng-content>\n </mat-icon>\n</button>\n", styles: ["/* src/app/page/shared/icon-button/icon-button.scss */\n:host button[matIconButton] {\n font-size: 16px;\n width: 24px;\n height: 24px;\n padding: 4px;\n}\n:host button[matIconButton] mat-icon {\n font-size: 16px;\n width: 16px;\n height: 16px;\n}\n/*# sourceMappingURL=icon-button.css.map */\n"] }]
}], null, null);
})();
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(IconButton, { className: "IconButton", filePath: "src/app/page/shared/icon-button/icon-button.ts", lineNumber: 14 });
})();
// src/app/page/dashboard/dashboard-info/dashboard-info.ts
var DashboardInfo = class _DashboardInfo {
envService = inject2(EnvService);
host$ = this.envService.host.asObservable();
userAgent$ = this.envService.userAgent.asObservable();
static \u0275fac = function DashboardInfo_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _DashboardInfo)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _DashboardInfo, selectors: [["app-dashboard-info"]], decls: 18, vars: 14, consts: [[1, "info"], [3, "cdkCopyToClipboard"]], template: function DashboardInfo_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "div", 0)(1, "span");
\u0275\u0275text(2, "Host");
\u0275\u0275elementEnd();
\u0275\u0275elementStart(3, "code");
\u0275\u0275text(4);
\u0275\u0275pipe(5, "async");
\u0275\u0275elementEnd();
\u0275\u0275elementStart(6, "app-icon-button", 1);
\u0275\u0275pipe(7, "async");
\u0275\u0275text(8, "content_copy");
\u0275\u0275elementEnd()();
\u0275\u0275elementStart(9, "div", 0)(10, "span");
\u0275\u0275text(11, "User-Agent");
\u0275\u0275elementEnd();
\u0275\u0275elementStart(12, "code");
\u0275\u0275text(13);
\u0275\u0275pipe(14, "async");
\u0275\u0275elementEnd();
\u0275\u0275elementStart(15, "app-icon-button", 1);
\u0275\u0275pipe(16, "async");
\u0275\u0275text(17, "content_copy");
\u0275\u0275elementEnd()();
}
if (rf & 2) {
\u0275\u0275advance(4);
\u0275\u0275textInterpolate(\u0275\u0275pipeBind1(5, 6, ctx.host$));
\u0275\u0275advance(2);
\u0275\u0275property("cdkCopyToClipboard", \u0275\u0275interpolate(\u0275\u0275pipeBind1(7, 8, ctx.host$)));
\u0275\u0275advance(7);
\u0275\u0275textInterpolate(\u0275\u0275pipeBind1(14, 10, ctx.userAgent$));
\u0275\u0275advance(2);
\u0275\u0275property("cdkCopyToClipboard", \u0275\u0275interpolate(\u0275\u0275pipeBind1(16, 12, ctx.host$)));
}
}, dependencies: [
IconButton,
CdkCopyToClipboard,
AsyncPipe
], styles: ["\n\n[_nghost-%COMP%] {\n display: flex;\n flex-direction: column;\n width: 100%;\n gap: 8px;\n}\n[_nghost-%COMP%] .info[_ngcontent-%COMP%] {\n display: flex;\n align-items: start;\n flex-direction: row;\n gap: 12px;\n}\n[_nghost-%COMP%] .info[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n font-size: 12px;\n overflow: hidden;\n flex-shrink: 0;\n width: 66px;\n padding: 2px 6px;\n text-align: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n border-radius: 4px;\n background-color: #1a1c20;\n}\n[_nghost-%COMP%] .info[_ngcontent-%COMP%] code[_ngcontent-%COMP%] {\n font-size: 12px;\n flex: 9 1 auto;\n padding: 2px 6px;\n}\n/*# sourceMappingURL=dashboard-info.css.map */"] });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DashboardInfo, [{
type: Component,
args: [{ selector: "app-dashboard-info", imports: [
IconButton,
AsyncPipe,
CdkCopyToClipboard
], template: '<div class="info">\n <span>Host</span>\n <code>{{ host$ | async }}</code>\n <app-icon-button cdkCopyToClipboard="{{host$ | async}}">content_copy</app-icon-button>\n</div>\n<div class="info">\n <span>User-Agent</span>\n <code>{{ userAgent$ | async }}</code>\n <app-icon-button cdkCopyToClipboard="{{host$ | async}}">content_copy</app-icon-button>\n</div>\n', styles: ["/* src/app/page/dashboard/dashboard-info/dashboard-info.scss */\n:host {\n display: flex;\n flex-direction: column;\n width: 100%;\n gap: 8px;\n}\n:host .info {\n display: flex;\n align-items: start;\n flex-direction: row;\n gap: 12px;\n}\n:host .info span {\n font-size: 12px;\n overflow: hidden;\n flex-shrink: 0;\n width: 66px;\n padding: 2px 6px;\n text-align: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n border-radius: 4px;\n background-color: #1a1c20;\n}\n:host .info code {\n font-size: 12px;\n flex: 9 1 auto;\n padding: 2px 6px;\n}\n/*# sourceMappingURL=dashboard-info.css.map */\n"] }]
}], null, null);
})();
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(DashboardInfo, { className: "DashboardInfo", filePath: "src/app/page/dashboard/dashboard-info/dashboard-info.ts", lineNumber: 17 });
})();
// node_modules/.pnpm/@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs@7.8.2/node_modules/@angular/core/fesm2022/rxjs-interop.mjs
function takeUntilDestroyed(destroyRef) {
if (!destroyRef) {
ngDevMode && assertInInjectionContext(takeUntilDestroyed);
destroyRef = inject2(DestroyRef);
}
const destroyed$ = new Observable((subscriber) => {
if (destroyRef.destroyed) {
subscriber.next();
return;
}
const unregisterFn = destroyRef.onDestroy(subscriber.next.bind(subscriber));
return unregisterFn;
});
return (source) => {
return source.pipe(takeUntil(destroyed$));
};
}
// node_modules/.pnpm/@angular+forms@20.2.1_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rx_lxjqpmyb34mu4qimmqbrdd2gcm/node_modules/@angular/forms/fesm2022/forms.mjs
var BaseControlValueAccessor = class _BaseControlValueAccessor {
_renderer;
_elementRef;
/**
* The registered callback function called when a change or input event occurs on the input
* element.
* @docs-private
*/
onChange = (_) => {
};
/**
* The registered callback function called when a blur event occurs on the input element.
* @docs-private
*/
onTouched = () => {
};
constructor(_renderer, _elementRef) {
this._renderer = _renderer;
this._elementRef = _elementRef;
}
/**
* Helper method that sets a property on a target element using the current Renderer
* implementation.
* @docs-private
*/
setProperty(key, value) {
this._renderer.setProperty(this._elementRef.nativeElement, key, value);
}
/**
* Registers a function called when the control is touched.
* @docs-private
*/
registerOnTouched(fn) {
this.onTouched = fn;
}
/**
* Registers a function called when the control value changes.
* @docs-private
*/
registerOnChange(fn) {
this.onChange = fn;
}
/**
* Sets the "disabled" property on the range input element.
* @docs-private
*/
setDisabledState(isDisabled) {
this.setProperty("disabled", isDisabled);
}
static \u0275fac = function BaseControlValueAccessor_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _BaseControlValueAccessor)(\u0275\u0275directiveInject(Renderer2), \u0275\u0275directiveInject(ElementRef));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _BaseControlValueAccessor
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BaseControlValueAccessor, [{
type: Directive
}], () => [{
type: Renderer2
}, {
type: ElementRef
}], null);
})();
var BuiltInControlValueAccessor = class _BuiltInControlValueAccessor extends BaseControlValueAccessor {
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275BuiltInControlValueAccessor_BaseFactory;
return function BuiltInControlValueAccessor_Factory(__ngFactoryType__) {
return (\u0275BuiltInControlValueAccessor_BaseFactory || (\u0275BuiltInControlValueAccessor_BaseFactory = \u0275\u0275getInheritedFactory(_BuiltInControlValueAccessor)))(__ngFactoryType__ || _BuiltInControlValueAccessor);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _BuiltInControlValueAccessor,
features: [\u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BuiltInControlValueAccessor, [{
type: Directive
}], null, null);
})();
var NG_VALUE_ACCESSOR = new InjectionToken(ngDevMode ? "NgValueAccessor" : "");
var CHECKBOX_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => CheckboxControlValueAccessor),
multi: true
};
var CheckboxControlValueAccessor = class _CheckboxControlValueAccessor extends BuiltInControlValueAccessor {
/**
* Sets the "checked" property on the input element.
* @docs-private
*/
writeValue(value) {
this.setProperty("checked", value);
}
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275CheckboxControlValueAccessor_BaseFactory;
return function CheckboxControlValueAccessor_Factory(__ngFactoryType__) {
return (\u0275CheckboxControlValueAccessor_BaseFactory || (\u0275CheckboxControlValueAccessor_BaseFactory = \u0275\u0275getInheritedFactory(_CheckboxControlValueAccessor)))(__ngFactoryType__ || _CheckboxControlValueAccessor);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CheckboxControlValueAccessor,
selectors: [["input", "type", "checkbox", "formControlName", ""], ["input", "type", "checkbox", "formControl", ""], ["input", "type", "checkbox", "ngModel", ""]],
hostBindings: function CheckboxControlValueAccessor_HostBindings(rf, ctx) {
if (rf & 1) {
\u0275\u0275listener("change", function CheckboxControlValueAccessor_change_HostBindingHandler($event) {
return ctx.onChange($event.target.checked);
})("blur", function CheckboxControlValueAccessor_blur_HostBindingHandler() {
return ctx.onTouched();
});
}
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([CHECKBOX_VALUE_ACCESSOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CheckboxControlValueAccessor, [{
type: Directive,
args: [{
selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]",
host: {
"(change)": "onChange($any($event.target).checked)",
"(blur)": "onTouched()"
},
providers: [CHECKBOX_VALUE_ACCESSOR],
standalone: false
}]
}], null, null);
})();
var DEFAULT_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => DefaultValueAccessor),
multi: true
};
function _isAndroid() {
const userAgent = getDOM() ? getDOM().getUserAgent() : "";
return /android (\d+)/.test(userAgent.toLowerCase());
}
var COMPOSITION_BUFFER_MODE = new InjectionToken(ngDevMode ? "CompositionEventMode" : "");
var DefaultValueAccessor = class _DefaultValueAccessor extends BaseControlValueAccessor {
_compositionMode;
/** Whether the user is creating a composition string (IME events). */
_composing = false;
constructor(renderer, elementRef, _compositionMode) {
super(renderer, elementRef);
this._compositionMode = _compositionMode;
if (this._compositionMode == null) {
this._compositionMode = !_isAndroid();
}
}
/**
* Sets the "value" property on the input element.
* @docs-private
*/
writeValue(value) {
const normalizedValue = value == null ? "" : value;
this.setProperty("value", normalizedValue);
}
/** @internal */
_handleInput(value) {
if (!this._compositionMode || this._compositionMode && !this._composing) {
this.onChange(value);
}
}
/** @internal */
_compositionStart() {
this._composing = true;
}
/** @internal */
_compositionEnd(value) {
this._composing = false;
this._compositionMode && this.onChange(value);
}
static \u0275fac = function DefaultValueAccessor_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _DefaultValueAccessor)(\u0275\u0275directiveInject(Renderer2), \u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(COMPOSITION_BUFFER_MODE, 8));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _DefaultValueAccessor,
selectors: [["input", "formControlName", "", 3, "type", "checkbox"], ["textarea", "formControlName", ""], ["input", "formControl", "", 3, "type", "checkbox"], ["textarea", "formControl", ""], ["input", "ngModel", "", 3, "type", "checkbox"], ["textarea", "ngModel", ""], ["", "ngDefaultControl", ""]],
hostBindings: function DefaultValueAccessor_HostBindings(rf, ctx) {
if (rf & 1) {
\u0275\u0275listener("input", function DefaultValueAccessor_input_HostBindingHandler($event) {
return ctx._handleInput($event.target.value);
})("blur", function DefaultValueAccessor_blur_HostBindingHandler() {
return ctx.onTouched();
})("compositionstart", function DefaultValueAccessor_compositionstart_HostBindingHandler() {
return ctx._compositionStart();
})("compositionend", function DefaultValueAccessor_compositionend_HostBindingHandler($event) {
return ctx._compositionEnd($event.target.value);
});
}
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([DEFAULT_VALUE_ACCESSOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DefaultValueAccessor, [{
type: Directive,
args: [{
selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]",
// TODO: vsavkin replace the above selector with the one below it once
// https://github.com/angular/angular/issues/3011 is implemented
// selector: '[ngModel],[formControl],[formControlName]',
host: {
"(input)": "_handleInput($any($event.target).value)",
"(blur)": "onTouched()",
"(compositionstart)": "_compositionStart()",
"(compositionend)": "_compositionEnd($any($event.target).value)"
},
providers: [DEFAULT_VALUE_ACCESSOR],
standalone: false
}]
}], () => [{
type: Renderer2
}, {
type: ElementRef
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Inject,
args: [COMPOSITION_BUFFER_MODE]
}]
}], null);
})();
function isEmptyInputValue(value) {
return value == null || lengthOrSize(value) === 0;
}
function lengthOrSize(value) {
if (value == null) {
return null;
} else if (Array.isArray(value) || typeof value === "string") {
return value.length;
} else if (value instanceof Set) {
return value.size;
}
return null;
}
var NG_VALIDATORS = new InjectionToken(ngDevMode ? "NgValidators" : "");
var NG_ASYNC_VALIDATORS = new InjectionToken(ngDevMode ? "NgAsyncValidators" : "");
var EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
var Validators = class {
/**
* @description
* Validator that requires the control's value to be greater than or equal to the provided number.
*
* @usageNotes
*
* ### Validate against a minimum of 3
*
* ```ts
* const control = new FormControl(2, Validators.min(3));
*
* console.log(control.errors); // {min: {min: 3, actual: 2}}
* ```
*
* @returns A validator function that returns an error map with the
* `min` property if the validation check fails, otherwise `null`.
*
* @see {@link /api/forms/AbstractControl#updateValueAndValidity updateValueAndValidity}
*
*/
static min(min) {
return minValidator(min);
}
/**
* @description
* Validator that requires the control's value to be less than or equal to the provided number.
*
* @usageNotes
*
* ### Validate against a maximum of 15
*
* ```ts
* const control = new FormControl(16, Validators.max(15));
*
* console.log(control.errors); // {max: {max: 15, actual: 16}}
* ```
*
* @returns A validator function that returns an error map with the
* `max` property if the validation check fails, otherwise `null`.
*
* @see {@link /api/forms/AbstractControl#updateValueAndValidity updateValueAndValidity}
*
*/
static max(max) {
return maxValidator(max);
}
/**
* @description
* Validator that requires the control have a non-empty value.
*
* @usageNotes
*
* ### Validate that the field is non-empty
*
* ```ts
* const control = new FormControl('', Validators.required);
*
* console.log(control.errors); // {required: true}
* ```
*
* @returns An error map with the `required` property
* if the validation check fails, otherwise `null`.
*
* @see {@link /api/forms/AbstractControl#updateValueAndValidity updateValueAndValidity}
*
*/
static required(control) {
return requiredValidator(control);
}
/**
* @description
* Validator that requires the control's value be true. This validator is commonly
* used for required checkboxes.
*
* @usageNotes
*
* ### Validate that the field value is true
*
* ```ts
* const control = new FormControl('some value', Validators.requiredTrue);
*
* console.log(control.errors); // {required: true}
* ```
*
* @returns An error map that contains the `required` property
* set to `true` if the validation check fails, otherwise `null`.
*
* @see {@link /api/forms/AbstractControl#updateValueAndValidity updateValueAndValidity}
*
*/
static requiredTrue(control) {
return requiredTrueValidator(control);
}
/**
* @description
* Validator that requires the control's value pass an email validation test.
*
* Tests the value using a [regular
* expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions)
* pattern suitable for common use cases. The pattern is based on the definition of a valid email
* address in the [WHATWG HTML
* specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) with
* some enhancements to incorporate more RFC rules (such as rules related to domain names and the
* lengths of different parts of the address).
*
* The differences from the WHATWG version include:
* - Disallow `local-part` (the part before the `@` symbol) to begin or end with a period (`.`).
* - Disallow `local-part` to be longer than 64 characters.
* - Disallow the whole address to be longer than 254 characters.
*
* If this pattern does not satisfy your business needs, you can use `Validators.pattern()` to
* validate the value against a different pattern.
*
* @usageNotes
*
* ### Validate that the field matches a valid email pattern
*
* ```ts
* const control = new FormControl('bad@', Validators.email);
*
* console.log(control.errors); // {email: true}
* ```
*
* @returns An error map with the `email` property
* if the validation check fails, otherwise `null`.
*
* @see {@link /api/forms/AbstractControl#updateValueAndValidity updateValueAndValidity}
*
*/
static email(control) {
return emailValidator(control);
}
/**
* @description
* Validator that requires the number of items in the control's value to be greater than or equal
* to the provided minimum length. This validator is also provided by default if you use
* the HTML5 `minlength` attribute. Note that the `minLength` validator is intended to be used
* only for types that have a numeric `length` or `size` property, such as strings, arrays or
* sets. The `minLength` validator logic is also not invoked for values when their `length` or
* `size` property is 0 (for example in case of an empty string or an empty array), to support
* optional controls. You can use the standard `required` validator if empty values should not be
* considered valid.
*
* @usageNotes
*
* ### Validate that the field has a minimum of 3 characters
*
* ```ts
* const control = new FormControl('ng', Validators.minLength(3));
*
* console.log(control.errors); // {minlength: {requiredLength: 3, actualLength: 2}}
* ```
*
* ```html
* <input minlength="5">
* ```
*
* @returns A validator function that returns an error map with the
* `minlength` property if the validation check fails, otherwise `null`.
*
* @see {@link /api/forms/AbstractControl#updateValueAndValidity updateValueAndValidity}
*
*/
static minLength(minLength) {
return minLengthValidator(minLength);
}
/**
* @description
* Validator that requires the number of items in the control's value to be less than or equal
* to the provided maximum length. This validator is also provided by default if you use
* the HTML5 `maxlength` attribute. Note that the `maxLength` validator is intended to be used
* only for types that have a numeric `length` or `size` property, such as strings, arrays or
* sets.
*
* @usageNotes
*
* ### Validate that the field has maximum of 5 characters
*
* ```ts
* const control = new FormControl('Angular', Validators.maxLength(5));
*
* console.log(control.errors); // {maxlength: {requiredLength: 5, actualLength: 7}}
* ```
*
* ```html
* <input maxlength="5">
* ```
*
* @returns A validator function that returns an error map with the
* `maxlength` property if the validation check fails, otherwise `null`.
*
* @see {@link /api/forms/AbstractControl#updateValueAndValidity updateValueAndValidity}
*
*/
static maxLength(maxLength) {
return maxLengthValidator(maxLength);
}
/**
* @description
* Validator that requires the control's value to match a regex pattern. This validator is also
* provided by default if you use the HTML5 `pattern` attribute.
*
* @usageNotes
*
* ### Validate that the field only contains letters or spaces
*
* ```ts
* const control = new FormControl('1', Validators.pattern('[a-zA-Z ]*'));
*
* console.log(control.errors); // {pattern: {requiredPattern: '^[a-zA-Z ]*$', actualValue: '1'}}
* ```
*
* ```html
* <input pattern="[a-zA-Z ]*">
* ```
*
* ### Pattern matching with the global or sticky flag
*
* `RegExp` objects created with the `g` or `y` flags that are passed into `Validators.pattern`
* can produce different results on the same input when validations are run consecutively. This is
* due to how the behavior of `RegExp.prototype.test` is
* specified in [ECMA-262](https://tc39.es/ecma262/#sec-regexpbuiltinexec)
* (`RegExp` preserves the index of the last match when the global or sticky flag is used).
* Due to this behavior, it is recommended that when using
* `Validators.pattern` you **do not** pass in a `RegExp` object with either the global or sticky
* flag enabled.
*
* ```ts
* // Not recommended (since the `g` flag is used)
* const controlOne = new FormControl('1', Validators.pattern(/foo/g));
*
* // Good
* const controlTwo = new FormControl('1', Validators.pattern(/foo/));
* ```
*
* @param pattern A regular expression to be used as is to test the values, or a string.
* If a string is passed, the `^` character is prepended and the `$` character is
* appended to the provided string (if not already present), and the resulting regular
* expression is used to test the values.
*
* @returns A validator function that returns an error map with the
* `pattern` property if the validation check fails, otherwise `null`.
*
* @see {@link /api/forms/AbstractControl#updateValueAndValidity updateValueAndValidity}
*
*/
static pattern(pattern) {
return patternValidator(pattern);
}
/**
* @description
* Validator that performs no operation.
*
* @see {@link /api/forms/AbstractControl#updateValueAndValidity updateValueAndValidity}
*
*/
static nullValidator(control) {
return nullValidator();
}
static compose(validators) {
return compose(validators);
}
/**
* @description
* Compose multiple async validators into a single function that returns the union
* of the individual error objects for the provided control.
*
* @returns A validator function that returns an error map with the
* merged error objects of the async validators if the validation check fails, otherwise `null`.
*
* @see {@link /api/forms/AbstractControl#updateValueAndValidity updateValueAndValidity}
*
*/
static composeAsync(validators) {
return composeAsync(validators);
}
};
function minValidator(min) {
return (control) => {
if (control.value == null || min == null) {
return null;
}
const value = parseFloat(control.value);
return !isNaN(value) && value < min ? {
"min": {
"min": min,
"actual": control.value
}
} : null;
};
}
function maxValidator(max) {
return (control) => {
if (control.value == null || max == null) {
return null;
}
const value = parseFloat(control.value);
return !isNaN(value) && value > max ? {
"max": {
"max": max,
"actual": control.value
}
} : null;
};
}
function requiredValidator(control) {
return isEmptyInputValue(control.value) ? {
"required": true
} : null;
}
function requiredTrueValidator(control) {
return control.value === true ? null : {
"required": true
};
}
function emailValidator(control) {
if (isEmptyInputValue(control.value)) {
return null;
}
return EMAIL_REGEXP.test(control.value) ? null : {
"email": true
};
}
function minLengthValidator(minLength) {
return (control) => {
const length = control.value?.length ?? lengthOrSize(control.value);
if (length === null || length === 0) {
return null;
}
return length < minLength ? {
"minlength": {
"requiredLength": minLength,
"actualLength": length
}
} : null;
};
}
function maxLengthValidator(maxLength) {
return (control) => {
const length = control.value?.length ?? lengthOrSize(control.value);
if (length !== null && length > maxLength) {
return {
"maxlength": {
"requiredLength": maxLength,
"actualLength": length
}
};
}
return null;
};
}
function patternValidator(pattern) {
if (!pattern) return nullValidator;
let regex;
let regexStr;
if (typeof pattern === "string") {
regexStr = "";
if (pattern.charAt(0) !== "^") regexStr += "^";
regexStr += pattern;
if (pattern.charAt(pattern.length - 1) !== "$") regexStr += "$";
regex = new RegExp(regexStr);
} else {
regexStr = pattern.toString();
regex = pattern;
}
return (control) => {
if (isEmptyInputValue(control.value)) {
return null;
}
const value = control.value;
return regex.test(value) ? null : {
"pattern": {
"requiredPattern": regexStr,
"actualValue": value
}
};
};
}
function nullValidator(control) {
return null;
}
function isPresent(o) {
return o != null;
}
function toObservable(value) {
const obs = isPromise2(value) ? from(value) : value;
if ((typeof ngDevMode === "undefined" || ngDevMode) && !isSubscribable(obs)) {
let errorMessage = `Expected async validator to return Promise or Observable.`;
if (typeof value === "object") {
errorMessage += " Are you using a synchronous validator where an async validator is expected?";
}
throw new RuntimeError(-1101, errorMessage);
}
return obs;
}
function mergeErrors(arrayOfErrors) {
let res = {};
arrayOfErrors.forEach((errors) => {
res = errors != null ? __spreadValues(__spreadValues({}, res), errors) : res;
});
return Object.keys(res).length === 0 ? null : res;
}
function executeValidators(control, validators) {
return validators.map((validator) => validator(control));
}
function isValidatorFn(validator) {
return !validator.validate;
}
function normalizeValidators(validators) {
return validators.map((validator) => {
return isValidatorFn(validator) ? validator : (c) => validator.validate(c);
});
}
function compose(validators) {
if (!validators) return null;
const presentValidators = validators.filter(isPresent);
if (presentValidators.length == 0) return null;
return function(control) {
return mergeErrors(executeValidators(control, presentValidators));
};
}
function composeValidators(validators) {
return validators != null ? compose(normalizeValidators(validators)) : null;
}
function composeAsync(validators) {
if (!validators) return null;
const presentValidators = validators.filter(isPresent);
if (presentValidators.length == 0) return null;
return function(control) {
const observables = executeValidators(control, presentValidators).map(toObservable);
return forkJoin(observables).pipe(map(mergeErrors));
};
}
function composeAsyncValidators(validators) {
return validators != null ? composeAsync(normalizeValidators(validators)) : null;
}
function mergeValidators(controlValidators, dirValidator) {
if (controlValidators === null) return [dirValidator];
return Array.isArray(controlValidators) ? [...controlValidators, dirValidator] : [controlValidators, dirValidator];
}
function getControlValidators(control) {
return control._rawValidators;
}
function getControlAsyncValidators(control) {
return control._rawAsyncValidators;
}
function makeValidatorsArray(validators) {
if (!validators) return [];
return Array.isArray(validators) ? validators : [validators];
}
function hasValidator(validators, validator) {
return Array.isArray(validators) ? validators.includes(validator) : validators === validator;
}
function addValidators(validators, currentValidators) {
const current = makeValidatorsArray(currentValidators);
const validatorsToAdd = makeValidatorsArray(validators);
validatorsToAdd.forEach((v) => {
if (!hasValidator(current, v)) {
current.push(v);
}
});
return current;
}
function removeValidators(validators, currentValidators) {
return makeValidatorsArray(currentValidators).filter((v) => !hasValidator(validators, v));
}
var AbstractControlDirective = class {
/**
* @description
* Reports the value of the control if it is present, otherwise null.
*/
get value() {
return this.control ? this.control.value : null;
}
/**
* @description
* Reports whether the control is valid. A control is considered valid if no
* validation errors exist with the current value.
* If the control is not present, null is returned.
*/
get valid() {
return this.control ? this.control.valid : null;
}
/**
* @description
* Reports whether the control is invalid, meaning that an error exists in the input value.
* If the control is not present, null is returned.
*/
get invalid() {
return this.control ? this.control.invalid : null;
}
/**
* @description
* Reports whether a control is pending, meaning that async validation is occurring and
* errors are not yet available for the input value. If the control is not present, null is
* returned.
*/
get pending() {
return this.control ? this.control.pending : null;
}
/**
* @description
* Reports whether the control is disabled, meaning that the control is disabled
* in the UI and is exempt from validation checks and excluded from aggregate
* values of ancestor controls. If the control is not present, null is returned.
*/
get disabled() {
return this.control ? this.control.disabled : null;
}
/**
* @description
* Reports whether the control is enabled, meaning that the control is included in ancestor
* calculations of validity or value. If the control is not present, null is returned.
*/
get enabled() {
return this.control ? this.control.enabled : null;
}
/**
* @description
* Reports the control's validation errors. If the control is not present, null is returned.
*/
get errors() {
return this.control ? this.control.errors : null;
}
/**
* @description
* Reports whether the control is pristine, meaning that the user has not yet changed
* the value in the UI. If the control is not present, null is returned.
*/
get pristine() {
return this.control ? this.control.pristine : null;
}
/**
* @description
* Reports whether the control is dirty, meaning that the user has changed
* the value in the UI. If the control is not present, null is returned.
*/
get dirty() {
return this.control ? this.control.dirty : null;
}
/**
* @description
* Reports whether the control is touched, meaning that the user has triggered
* a `blur` event on it. If the control is not present, null is returned.
*/
get touched() {
return this.control ? this.control.touched : null;
}
/**
* @description
* Reports the validation status of the control. Possible values include:
* 'VALID', 'INVALID', 'DISABLED', and 'PENDING'.
* If the control is not present, null is returned.
*/
get status() {
return this.control ? this.control.status : null;
}
/**
* @description
* Reports whether the control is untouched, meaning that the user has not yet triggered
* a `blur` event on it. If the control is not present, null is returned.
*/
get untouched() {
return this.control ? this.control.untouched : null;
}
/**
* @description
* Returns a multicasting observable that emits a validation status whenever it is
* calculated for the control. If the control is not present, null is returned.
*/
get statusChanges() {
return this.control ? this.control.statusChanges : null;
}
/**
* @description
* Returns a multicasting observable of value changes for the control that emits every time the
* value of the control changes in the UI or programmatically.
* If the control is not present, null is returned.
*/
get valueChanges() {
return this.control ? this.control.valueChanges : null;
}
/**
* @description
* Returns an array that represents the path from the top-level form to this control.
* Each index is the string name of the control on that level.
*/
get path() {
return null;
}
/**
* Contains the result of merging synchronous validators into a single validator function
* (combined using `Validators.compose`).
*/
_composedValidatorFn;
/**
* Contains the result of merging asynchronous validators into a single validator function
* (combined using `Validators.composeAsync`).
*/
_composedAsyncValidatorFn;
/**
* Set of synchronous validators as they were provided while calling `setValidators` function.
* @internal
*/
_rawValidators = [];
/**
* Set of asynchronous validators as they were provided while calling `setAsyncValidators`
* function.
* @internal
*/
_rawAsyncValidators = [];
/**
* Sets synchronous validators for this directive.
* @internal
*/
_setValidators(validators) {
this._rawValidators = validators || [];
this._composedValidatorFn = composeValidators(this._rawValidators);
}
/**
* Sets asynchronous validators for this directive.
* @internal
*/
_setAsyncValidators(validators) {
this._rawAsyncValidators = validators || [];
this._composedAsyncValidatorFn = composeAsyncValidators(this._rawAsyncValidators);
}
/**
* @description
* Synchronous validator function composed of all the synchronous validators registered with this
* directive.
*/
get validator() {
return this._composedValidatorFn || null;
}
/**
* @description
* Asynchronous validator function composed of all the asynchronous validators registered with
* this directive.
*/
get asyncValidator() {
return this._composedAsyncValidatorFn || null;
}
/*
* The set of callbacks to be invoked when directive instance is being destroyed.
*/
_onDestroyCallbacks = [];
/**
* Internal function to register callbacks that should be invoked
* when directive instance is being destroyed.
* @internal
*/
_registerOnDestroy(fn) {
this._onDestroyCallbacks.push(fn);
}
/**
* Internal function to invoke all registered "on destroy" callbacks.
* Note: calling this function also clears the list of callbacks.
* @internal
*/
_invokeOnDestroyCallbacks() {
this._onDestroyCallbacks.forEach((fn) => fn());
this._onDestroyCallbacks = [];
}
/**
* @description
* Resets the control with the provided value if the control is present.
*/
reset(value = void 0) {
if (this.control) this.control.reset(value);
}
/**
* @description
* Reports whether the control with the given path has the error specified.
*
* @param errorCode The code of the error to check
* @param path A list of control names that designates how to move from the current control
* to the control that should be queried for errors.
*
* @usageNotes
* For example, for the following `FormGroup`:
*
* ```ts
* form = new FormGroup({
* address: new FormGroup({ street: new FormControl() })
* });
* ```
*
* The path to the 'street' control from the root form would be 'address' -> 'street'.
*
* It can be provided to this method in one of two formats:
*
* 1. An array of string control names, e.g. `['address', 'street']`
* 1. A period-delimited list of control names in one string, e.g. `'address.street'`
*
* If no path is given, this method checks for the error on the current control.
*
* @returns whether the given error is present in the control at the given path.
*
* If the control is not present, false is returned.
*/
hasError(errorCode, path) {
return this.control ? this.control.hasError(errorCode, path) : false;
}
/**
* @description
* Reports error data for the control with the given path.
*
* @param errorCode The code of the error to check
* @param path A list of control names that designates how to move from the current control
* to the control that should be queried for errors.
*
* @usageNotes
* For example, for the following `FormGroup`:
*
* ```ts
* form = new FormGroup({
* address: new FormGroup({ street: new FormControl() })
* });
* ```
*
* The path to the 'street' control from the root form would be 'address' -> 'street'.
*
* It can be provided to this method in one of two formats:
*
* 1. An array of string control names, e.g. `['address', 'street']`
* 1. A period-delimited list of control names in one string, e.g. `'address.street'`
*
* @returns error data for that particular error. If the control or error is not present,
* null is returned.
*/
getError(errorCode, path) {
return this.control ? this.control.getError(errorCode, path) : null;
}
};
var ControlContainer = class extends AbstractControlDirective {
/**
* @description
* The name for the control
*/
name;
/**
* @description
* The top-level form directive for the control.
*/
get formDirective() {
return null;
}
/**
* @description
* The path to this group.
*/
get path() {
return null;
}
};
var NgControl = class extends AbstractControlDirective {
/**
* @description
* The parent form for the control.
*
* @internal
*/
_parent = null;
/**
* @description
* The name for the control
*/
name = null;
/**
* @description
* The value accessor for the control
*/
valueAccessor = null;
};
var AbstractControlStatus = class {
_cd;
constructor(cd) {
this._cd = cd;
}
get isTouched() {
this._cd?.control?._touched?.();
return !!this._cd?.control?.touched;
}
get isUntouched() {
return !!this._cd?.control?.untouched;
}
get isPristine() {
this._cd?.control?._pristine?.();
return !!this._cd?.control?.pristine;
}
get isDirty() {
return !!this._cd?.control?.dirty;
}
get isValid() {
this._cd?.control?._status?.();
return !!this._cd?.control?.valid;
}
get isInvalid() {
return !!this._cd?.control?.invalid;
}
get isPending() {
return !!this._cd?.control?.pending;
}
get isSubmitted() {
this._cd?._submitted?.();
return !!this._cd?.submitted;
}
};
var ngControlStatusHost = {
"[class.ng-untouched]": "isUntouched",
"[class.ng-touched]": "isTouched",
"[class.ng-pristine]": "isPristine",
"[class.ng-dirty]": "isDirty",
"[class.ng-valid]": "isValid",
"[class.ng-invalid]": "isInvalid",
"[class.ng-pending]": "isPending"
};
var ngGroupStatusHost = __spreadProps(__spreadValues({}, ngControlStatusHost), {
"[class.ng-submitted]": "isSubmitted"
});
var NgControlStatus = class _NgControlStatus extends AbstractControlStatus {
constructor(cd) {
super(cd);
}
static \u0275fac = function NgControlStatus_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgControlStatus)(\u0275\u0275directiveInject(NgControl, 2));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgControlStatus,
selectors: [["", "formControlName", ""], ["", "ngModel", ""], ["", "formControl", ""]],
hostVars: 14,
hostBindings: function NgControlStatus_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275classProp("ng-untouched", ctx.isUntouched)("ng-touched", ctx.isTouched)("ng-pristine", ctx.isPristine)("ng-dirty", ctx.isDirty)("ng-valid", ctx.isValid)("ng-invalid", ctx.isInvalid)("ng-pending", ctx.isPending);
}
},
standalone: false,
features: [\u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgControlStatus, [{
type: Directive,
args: [{
selector: "[formControlName],[ngModel],[formControl]",
host: ngControlStatusHost,
standalone: false
}]
}], () => [{
type: NgControl,
decorators: [{
type: Self
}]
}], null);
})();
var NgControlStatusGroup = class _NgControlStatusGroup extends AbstractControlStatus {
constructor(cd) {
super(cd);
}
static \u0275fac = function NgControlStatusGroup_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgControlStatusGroup)(\u0275\u0275directiveInject(ControlContainer, 10));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgControlStatusGroup,
selectors: [["", "formGroupName", ""], ["", "formArrayName", ""], ["", "ngModelGroup", ""], ["", "formGroup", ""], ["form", 3, "ngNoForm", ""], ["", "ngForm", ""]],
hostVars: 16,
hostBindings: function NgControlStatusGroup_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275classProp("ng-untouched", ctx.isUntouched)("ng-touched", ctx.isTouched)("ng-pristine", ctx.isPristine)("ng-dirty", ctx.isDirty)("ng-valid", ctx.isValid)("ng-invalid", ctx.isInvalid)("ng-pending", ctx.isPending)("ng-submitted", ctx.isSubmitted);
}
},
standalone: false,
features: [\u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgControlStatusGroup, [{
type: Directive,
args: [{
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]",
host: ngGroupStatusHost,
standalone: false
}]
}], () => [{
type: ControlContainer,
decorators: [{
type: Optional
}, {
type: Self
}]
}], null);
})();
var formControlNameExample = `
<div [formGroup]="myGroup">
<input formControlName="firstName">
</div>
In your class:
this.myGroup = new FormGroup({
firstName: new FormControl()
});`;
var formGroupNameExample = `
<div [formGroup]="myGroup">
<div formGroupName="person">
<input formControlName="firstName">
</div>
</div>
In your class:
this.myGroup = new FormGroup({
person: new FormGroup({ firstName: new FormControl() })
});`;
var formArrayNameExample = `
<div [formGroup]="myGroup">
<div formArrayName="cities">
<div *ngFor="let city of cityArray.controls; index as i">
<input [formControlName]="i">
</div>
</div>
</div>
In your class:
this.cityArray = new FormArray([new FormControl('SF')]);
this.myGroup = new FormGroup({
cities: this.cityArray
});`;
var ngModelGroupExample = `
<form>
<div ngModelGroup="person">
<input [(ngModel)]="person.name" name="firstName">
</div>
</form>`;
var ngModelWithFormGroupExample = `
<div [formGroup]="myGroup">
<input formControlName="firstName">
<input [(ngModel)]="showMoreControls" [ngModelOptions]="{standalone: true}">
</div>
`;
function controlParentException(nameOrIndex) {
return new RuntimeError(1050, `formControlName must be used with a parent formGroup directive. You'll want to add a formGroup
directive and pass it an existing FormGroup instance (you can create one in your class).
${describeFormControl(nameOrIndex)}
Example:
${formControlNameExample}`);
}
function describeFormControl(nameOrIndex) {
if (nameOrIndex == null || nameOrIndex === "") {
return "";
}
const valueType = typeof nameOrIndex === "string" ? "name" : "index";
return `Affected Form Control ${valueType}: "${nameOrIndex}"`;
}
function ngModelGroupException() {
return new RuntimeError(1051, `formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents
that also have a "form" prefix: formGroupName, formArrayName, or formGroup.
Option 1: Update the parent to be formGroupName (reactive form strategy)
${formGroupNameExample}
Option 2: Use ngModel instead of formControlName (template-driven strategy)
${ngModelGroupExample}`);
}
function missingFormException() {
return new RuntimeError(1052, `formGroup expects a FormGroup instance. Please pass one in.
Example:
${formControlNameExample}`);
}
function groupParentException() {
return new RuntimeError(1053, `formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup
directive and pass it an existing FormGroup instance (you can create one in your class).
Example:
${formGroupNameExample}`);
}
function arrayParentException() {
return new RuntimeError(1054, `formArrayName must be used with a parent formGroup directive. You'll want to add a formGroup
directive and pass it an existing FormGroup instance (you can create one in your class).
Example:
${formArrayNameExample}`);
}
var disabledAttrWarning = `
It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true
when you set up this control in your component class, the disabled attribute will actually be set in the DOM for
you. We recommend using this approach to avoid 'changed after checked' errors.
Example:
// Specify the \`disabled\` property at control creation time:
form = new FormGroup({
first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),
last: new FormControl('Drew', Validators.required)
});
// Controls can also be enabled/disabled after creation:
form.get('first')?.enable();
form.get('last')?.disable();
`;
var asyncValidatorsDroppedWithOptsWarning = `
It looks like you're constructing using a FormControl with both an options argument and an
async validators argument. Mixing these arguments will cause your async validators to be dropped.
You should either put all your validators in the options object, or in separate validators
arguments. For example:
// Using validators arguments
fc = new FormControl(42, Validators.required, myAsyncValidator);
// Using AbstractControlOptions
fc = new FormControl(42, {validators: Validators.required, asyncValidators: myAV});
// Do NOT mix them: async validators will be dropped!
fc = new FormControl(42, {validators: Validators.required}, /* Oops! */ myAsyncValidator);
`;
function ngModelWarning(directiveName) {
return `
It looks like you're using ngModel on the same form field as ${directiveName}.
Support for using the ngModel input property and ngModelChange event with
reactive form directives has been deprecated in Angular v6 and will be removed
in a future version of Angular.
For more information on this, see our API docs here:
https://angular.io/api/forms/${directiveName === "formControl" ? "FormControlDirective" : "FormControlName"}#use-with-ngmodel
`;
}
function describeKey(isFormGroup, key) {
return isFormGroup ? `with name: '${key}'` : `at index: ${key}`;
}
function noControlsError(isFormGroup) {
return `
There are no form controls registered with this ${isFormGroup ? "group" : "array"} yet. If you're using ngModel,
you may want to check next tick (e.g. use setTimeout).
`;
}
function missingControlError(isFormGroup, key) {
return `Cannot find form control ${describeKey(isFormGroup, key)}`;
}
function missingControlValueError(isFormGroup, key) {
return `Must supply a value for form control ${describeKey(isFormGroup, key)}`;
}
var VALID = "VALID";
var INVALID = "INVALID";
var PENDING = "PENDING";
var DISABLED = "DISABLED";
var ControlEvent = class {
};
var ValueChangeEvent = class extends ControlEvent {
value;
source;
constructor(value, source) {
super();
this.value = value;
this.source = source;
}
};
var PristineChangeEvent = class extends ControlEvent {
pristine;
source;
constructor(pristine, source) {
super();
this.pristine = pristine;
this.source = source;
}
};
var TouchedChangeEvent = class extends ControlEvent {
touched;
source;
constructor(touched, source) {
super();
this.touched = touched;
this.source = source;
}
};
var StatusChangeEvent = class extends ControlEvent {
status;
source;
constructor(status, source) {
super();
this.status = status;
this.source = source;
}
};
var FormSubmittedEvent = class extends ControlEvent {
source;
constructor(source) {
super();
this.source = source;
}
};
var FormResetEvent = class extends ControlEvent {
source;
constructor(source) {
super();
this.source = source;
}
};
function pickValidators(validatorOrOpts) {
return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null;
}
function coerceToValidator(validator) {
return Array.isArray(validator) ? composeValidators(validator) : validator || null;
}
function pickAsyncValidators(asyncValidator, validatorOrOpts) {
if (typeof ngDevMode === "undefined" || ngDevMode) {
if (isOptionsObj(validatorOrOpts) && asyncValidator) {
console.warn(asyncValidatorsDroppedWithOptsWarning);
}
}
return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.asyncValidators : asyncValidator) || null;
}
function coerceToAsyncValidator(asyncValidator) {
return Array.isArray(asyncValidator) ? composeAsyncValidators(asyncValidator) : asyncValidator || null;
}
function isOptionsObj(validatorOrOpts) {
return validatorOrOpts != null && !Array.isArray(validatorOrOpts) && typeof validatorOrOpts === "object";
}
function assertControlPresent(parent, isGroup, key) {
const controls = parent.controls;
const collection = isGroup ? Object.keys(controls) : controls;
if (!collection.length) {
throw new RuntimeError(1e3, typeof ngDevMode === "undefined" || ngDevMode ? noControlsError(isGroup) : "");
}
if (!controls[key]) {
throw new RuntimeError(1001, typeof ngDevMode === "undefined" || ngDevMode ? missingControlError(isGroup, key) : "");
}
}
function assertAllValuesPresent(control, isGroup, value) {
control._forEachChild((_, key) => {
if (value[key] === void 0) {
throw new RuntimeError(1002, typeof ngDevMode === "undefined" || ngDevMode ? missingControlValueError(isGroup, key) : "");
}
});
}
var AbstractControl = class {
/** @internal */
_pendingDirty = false;
/**
* Indicates that a control has its own pending asynchronous validation in progress.
* It also stores if the control should emit events when the validation status changes.
*
* @internal
*/
_hasOwnPendingAsyncValidator = null;
/** @internal */
_pendingTouched = false;
/** @internal */
_onCollectionChange = () => {
};
/** @internal */
_updateOn;
_parent = null;
_asyncValidationSubscription;
/**
* Contains the result of merging synchronous validators into a single validator function
* (combined using `Validators.compose`).
*
* @internal
*/
_composedValidatorFn;
/**
* Contains the result of merging asynchronous validators into a single validator function
* (combined using `Validators.composeAsync`).
*
* @internal
*/
_composedAsyncValidatorFn;
/**
* Synchronous validators as they were provided:
* - in `AbstractControl` constructor
* - as an argument while calling `setValidators` function
* - while calling the setter on the `validator` field (e.g. `control.validator = validatorFn`)
*
* @internal
*/
_rawValidators;
/**
* Asynchronous validators as they were provided:
* - in `AbstractControl` constructor
* - as an argument while calling `setAsyncValidators` function
* - while calling the setter on the `asyncValidator` field (e.g. `control.asyncValidator =
* asyncValidatorFn`)
*
* @internal
*/
_rawAsyncValidators;
/**
* The current value of the control.
*
* * For a `FormControl`, the current value.
* * For an enabled `FormGroup`, the values of enabled controls as an object
* with a key-value pair for each member of the group.
* * For a disabled `FormGroup`, the values of all controls as an object
* with a key-value pair for each member of the group.
* * For a `FormArray`, the values of enabled controls as an array.
*
*/
value;
/**
* Initialize the AbstractControl instance.
*
* @param validators The function or array of functions that is used to determine the validity of
* this control synchronously.
* @param asyncValidators The function or array of functions that is used to determine validity of
* this control asynchronously.
*/
constructor(validators, asyncValidators) {
this._assignValidators(validators);
this._assignAsyncValidators(asyncValidators);
}
/**
* Returns the function that is used to determine the validity of this control synchronously.
* If multiple validators have been added, this will be a single composed function.
* See `Validators.compose()` for additional information.
*/
get validator() {
return this._composedValidatorFn;
}
set validator(validatorFn) {
this._rawValidators = this._composedValidatorFn = validatorFn;
}
/**
* Returns the function that is used to determine the validity of this control asynchronously.
* If multiple validators have been added, this will be a single composed function.
* See `Validators.compose()` for additional information.
*/
get asyncValidator() {
return this._composedAsyncValidatorFn;
}
set asyncValidator(asyncValidatorFn) {
this._rawAsyncValidators = this._composedAsyncValidatorFn = asyncValidatorFn;
}
/**
* The parent control.
*/
get parent() {
return this._parent;
}
/**
* The validation status of the control.
*
* @see {@link FormControlStatus}
*
* These status values are mutually exclusive, so a control cannot be
* both valid AND invalid or invalid AND disabled.
*/
get status() {
return untracked2(this.statusReactive);
}
set status(v) {
untracked2(() => this.statusReactive.set(v));
}
/** @internal */
_status = computed(() => this.statusReactive(), ...ngDevMode ? [{
debugName: "_status"
}] : []);
statusReactive = signal(void 0, ...ngDevMode ? [{
debugName: "statusReactive"
}] : []);
/**
* A control is `valid` when its `status` is `VALID`.
*
* @see {@link AbstractControl.status}
*
* @returns True if the control has passed all of its validation tests,
* false otherwise.
*/
get valid() {
return this.status === VALID;
}
/**
* A control is `invalid` when its `status` is `INVALID`.
*
* @see {@link AbstractControl.status}
*
* @returns True if this control has failed one or more of its validation checks,
* false otherwise.
*/
get invalid() {
return this.status === INVALID;
}
/**
* A control is `pending` when its `status` is `PENDING`.
*
* @see {@link AbstractControl.status}
*
* @returns True if this control is in the process of conducting a validation check,
* false otherwise.
*/
get pending() {
return this.status == PENDING;
}
/**
* A control is `disabled` when its `status` is `DISABLED`.
*
* Disabled controls are exempt from validation checks and
* are not included in the aggregate value of their ancestor
* controls.
*
* @see {@link AbstractControl.status}
*
* @returns True if the control is disabled, false otherwise.
*/
get disabled() {
return this.status === DISABLED;
}
/**
* A control is `enabled` as long as its `status` is not `DISABLED`.
*
* @returns True if the control has any status other than 'DISABLED',
* false if the status is 'DISABLED'.
*
* @see {@link AbstractControl.status}
*
*/
get enabled() {
return this.status !== DISABLED;
}
/**
* An object containing any errors generated by failing validation,
* or null if there are no errors.
*/
errors;
/**
* A control is `pristine` if the user has not yet changed
* the value in the UI.
*
* @returns True if the user has not yet changed the value in the UI; compare `dirty`.
* Programmatic changes to a control's value do not mark it dirty.
*/
get pristine() {
return untracked2(this.pristineReactive);
}
set pristine(v) {
untracked2(() => this.pristineReactive.set(v));
}
/** @internal */
_pristine = computed(() => this.pristineReactive(), ...ngDevMode ? [{
debugName: "_pristine"
}] : []);
pristineReactive = signal(true, ...ngDevMode ? [{
debugName: "pristineReactive"
}] : []);
/**
* A control is `dirty` if the user has changed the value
* in the UI.
*
* @returns True if the user has changed the value of this control in the UI; compare `pristine`.
* Programmatic changes to a control's value do not mark it dirty.
*/
get dirty() {
return !this.pristine;
}
/**
* True if the control is marked as `touched`.
*
* A control is marked `touched` once the user has triggered
* a `blur` event on it.
*/
get touched() {
return untracked2(this.touchedReactive);
}
set touched(v) {
untracked2(() => this.touchedReactive.set(v));
}
/** @internal */
_touched = computed(() => this.touchedReactive(), ...ngDevMode ? [{
debugName: "_touched"
}] : []);
touchedReactive = signal(false, ...ngDevMode ? [{
debugName: "touchedReactive"
}] : []);
/**
* True if the control has not been marked as touched
*
* A control is `untouched` if the user has not yet triggered
* a `blur` event on it.
*/
get untouched() {
return !this.touched;
}
/**
* Exposed as observable, see below.
*
* @internal
*/
_events = new Subject();
/**
* A multicasting observable that emits an event every time the state of the control changes.
* It emits for value, status, pristine or touched changes.
*
* **Note**: On value change, the emit happens right after a value of this control is updated. The
* value of a parent control (for example if this FormControl is a part of a FormGroup) is updated
* later, so accessing a value of a parent control (using the `value` property) from the callback
* of this event might result in getting a value that has not been updated yet. Subscribe to the
* `events` of the parent control instead.
* For other event types, the events are emitted after the parent control has been updated.
*
*/
events = this._events.asObservable();
/**
* A multicasting observable that emits an event every time the value of the control changes, in
* the UI or programmatically. It also emits an event each time you call enable() or disable()
* without passing along {emitEvent: false} as a function argument.
*
* **Note**: the emit happens right after a value of this control is updated. The value of a
* parent control (for example if this FormControl is a part of a FormGroup) is updated later, so
* accessing a value of a parent control (using the `value` property) from the callback of this
* event might result in getting a value that has not been updated yet. Subscribe to the
* `valueChanges` event of the parent control instead.
*/
valueChanges;
/**
* A multicasting observable that emits an event every time the validation `status` of the control
* recalculates.
*
* @see {@link FormControlStatus}
* @see {@link AbstractControl.status}
*/
statusChanges;
/**
* Reports the update strategy of the `AbstractControl` (meaning
* the event on which the control updates itself).
* Possible values: `'change'` | `'blur'` | `'submit'`
* Default value: `'change'`
*/
get updateOn() {
return this._updateOn ? this._updateOn : this.parent ? this.parent.updateOn : "change";
}
/**
* Sets the synchronous validators that are active on this control. Calling
* this overwrites any existing synchronous validators.
*
* When you add or remove a validator at run time, you must call
* `updateValueAndValidity()` for the new validation to take effect.
*
* If you want to add a new validator without affecting existing ones, consider
* using `addValidators()` method instead.
*/
setValidators(validators) {
this._assignValidators(validators);
}
/**
* Sets the asynchronous validators that are active on this control. Calling this
* overwrites any existing asynchronous validators.
*
* When you add or remove a validator at run time, you must call
* `updateValueAndValidity()` for the new validation to take effect.
*
* If you want to add a new validator without affecting existing ones, consider
* using `addAsyncValidators()` method instead.
*/
setAsyncValidators(validators) {
this._assignAsyncValidators(validators);
}
/**
* Add a synchronous validator or validators to this control, without affecting other validators.
*
* When you add or remove a validator at run time, you must call
* `updateValueAndValidity()` for the new validation to take effect.
*
* Adding a validator that already exists will have no effect. If duplicate validator functions
* are present in the `validators` array, only the first instance would be added to a form
* control.
*
* @param validators The new validator function or functions to add to this control.
*/
addValidators(validators) {
this.setValidators(addValidators(validators, this._rawValidators));
}
/**
* Add an asynchronous validator or validators to this control, without affecting other
* validators.
*
* When you add or remove a validator at run time, you must call
* `updateValueAndValidity()` for the new validation to take effect.
*
* Adding a validator that already exists will have no effect.
*
* @param validators The new asynchronous validator function or functions to add to this control.
*/
addAsyncValidators(validators) {
this.setAsyncValidators(addValidators(validators, this._rawAsyncValidators));
}
/**
* Remove a synchronous validator from this control, without affecting other validators.
* Validators are compared by function reference; you must pass a reference to the exact same
* validator function as the one that was originally set. If a provided validator is not found,
* it is ignored.
*
* @usageNotes
*
* ### Reference to a ValidatorFn
*
* ```
* // Reference to the RequiredValidator
* const ctrl = new FormControl<string | null>('', Validators.required);
* ctrl.removeValidators(Validators.required);
*
* // Reference to anonymous function inside MinValidator
* const minValidator = Validators.min(3);
* const ctrl = new FormControl<string | null>('', minValidator);
* expect(ctrl.hasValidator(minValidator)).toEqual(true)
* expect(ctrl.hasValidator(Validators.min(3))).toEqual(false)
*
* ctrl.removeValidators(minValidator);
* ```
*
* When you add or remove a validator at run time, you must call
* `updateValueAndValidity()` for the new validation to take effect.
*
* @param validators The validator or validators to remove.
*/
removeValidators(validators) {
this.setValidators(removeValidators(validators, this._rawValidators));
}
/**
* Remove an asynchronous validator from this control, without affecting other validators.
* Validators are compared by function reference; you must pass a reference to the exact same
* validator function as the one that was originally set. If a provided validator is not found, it
* is ignored.
*
* When you add or remove a validator at run time, you must call
* `updateValueAndValidity()` for the new validation to take effect.
*
* @param validators The asynchronous validator or validators to remove.
*/
removeAsyncValidators(validators) {
this.setAsyncValidators(removeValidators(validators, this._rawAsyncValidators));
}
/**
* Check whether a synchronous validator function is present on this control. The provided
* validator must be a reference to the exact same function that was provided.
*
* @usageNotes
*
* ### Reference to a ValidatorFn
*
* ```
* // Reference to the RequiredValidator
* const ctrl = new FormControl<number | null>(0, Validators.required);
* expect(ctrl.hasValidator(Validators.required)).toEqual(true)
*
* // Reference to anonymous function inside MinValidator
* const minValidator = Validators.min(3);
* const ctrl = new FormControl<number | null>(0, minValidator);
* expect(ctrl.hasValidator(minValidator)).toEqual(true)
* expect(ctrl.hasValidator(Validators.min(3))).toEqual(false)
* ```
*
* @param validator The validator to check for presence. Compared by function reference.
* @returns Whether the provided validator was found on this control.
*/
hasValidator(validator) {
return hasValidator(this._rawValidators, validator);
}
/**
* Check whether an asynchronous validator function is present on this control. The provided
* validator must be a reference to the exact same function that was provided.
*
* @param validator The asynchronous validator to check for presence. Compared by function
* reference.
* @returns Whether the provided asynchronous validator was found on this control.
*/
hasAsyncValidator(validator) {
return hasValidator(this._rawAsyncValidators, validator);
}
/**
* Empties out the synchronous validator list.
*
* When you add or remove a validator at run time, you must call
* `updateValueAndValidity()` for the new validation to take effect.
*
*/
clearValidators() {
this.validator = null;
}
/**
* Empties out the async validator list.
*
* When you add or remove a validator at run time, you must call
* `updateValueAndValidity()` for the new validation to take effect.
*
*/
clearAsyncValidators() {
this.asyncValidator = null;
}
markAsTouched(opts = {}) {
const changed = this.touched === false;
this.touched = true;
const sourceControl = opts.sourceControl ?? this;
if (this._parent && !opts.onlySelf) {
this._parent.markAsTouched(__spreadProps(__spreadValues({}, opts), {
sourceControl
}));
}
if (changed && opts.emitEvent !== false) {
this._events.next(new TouchedChangeEvent(true, sourceControl));
}
}
/**
* Marks the control and all its descendant controls as `dirty`.
* @see {@link markAsDirty()}
*
* @param opts Configuration options that determine how the control propagates changes
* and emits events after marking is applied.
* * `emitEvent`: When true or not supplied (the default), the `events`
* observable emits a `PristineChangeEvent` with the `pristine` property being `false`.
* When false, no events are emitted.
*/
markAllAsDirty(opts = {}) {
this.markAsDirty({
onlySelf: true,
emitEvent: opts.emitEvent,
sourceControl: this
});
this._forEachChild((control) => control.markAllAsDirty(opts));
}
/**
* Marks the control and all its descendant controls as `touched`.
* @see {@link markAsTouched()}
*
* @param opts Configuration options that determine how the control propagates changes
* and emits events after marking is applied.
* * `emitEvent`: When true or not supplied (the default), the `events`
* observable emits a `TouchedChangeEvent` with the `touched` property being `true`.
* When false, no events are emitted.
*/
markAllAsTouched(opts = {}) {
this.markAsTouched({
onlySelf: true,
emitEvent: opts.emitEvent,
sourceControl: this
});
this._forEachChild((control) => control.markAllAsTouched(opts));
}
markAsUntouched(opts = {}) {
const changed = this.touched === true;
this.touched = false;
this._pendingTouched = false;
const sourceControl = opts.sourceControl ?? this;
this._forEachChild((control) => {
control.markAsUntouched({
onlySelf: true,
emitEvent: opts.emitEvent,
sourceControl
});
});
if (this._parent && !opts.onlySelf) {
this._parent._updateTouched(opts, sourceControl);
}
if (changed && opts.emitEvent !== false) {
this._events.next(new TouchedChangeEvent(false, sourceControl));
}
}
markAsDirty(opts = {}) {
const changed = this.pristine === true;
this.pristine = false;
const sourceControl = opts.sourceControl ?? this;
if (this._parent && !opts.onlySelf) {
this._parent.markAsDirty(__spreadProps(__spreadValues({}, opts), {
sourceControl
}));
}
if (changed && opts.emitEvent !== false) {
this._events.next(new PristineChangeEvent(false, sourceControl));
}
}
markAsPristine(opts = {}) {
const changed = this.pristine === false;
this.pristine = true;
this._pendingDirty = false;
const sourceControl = opts.sourceControl ?? this;
this._forEachChild((control) => {
control.markAsPristine({
onlySelf: true,
emitEvent: opts.emitEvent
});
});
if (this._parent && !opts.onlySelf) {
this._parent._updatePristine(opts, sourceControl);
}
if (changed && opts.emitEvent !== false) {
this._events.next(new PristineChangeEvent(true, sourceControl));
}
}
markAsPending(opts = {}) {
this.status = PENDING;
const sourceControl = opts.sourceControl ?? this;
if (opts.emitEvent !== false) {
this._events.next(new StatusChangeEvent(this.status, sourceControl));
this.statusChanges.emit(this.status);
}
if (this._parent && !opts.onlySelf) {
this._parent.markAsPending(__spreadProps(__spreadValues({}, opts), {
sourceControl
}));
}
}
disable(opts = {}) {
const skipPristineCheck = this._parentMarkedDirty(opts.onlySelf);
this.status = DISABLED;
this.errors = null;
this._forEachChild((control) => {
control.disable(__spreadProps(__spreadValues({}, opts), {
onlySelf: true
}));
});
this._updateValue();
const sourceControl = opts.sourceControl ?? this;
if (opts.emitEvent !== false) {
this._events.next(new ValueChangeEvent(this.value, sourceControl));
this._events.next(new StatusChangeEvent(this.status, sourceControl));
this.valueChanges.emit(this.value);
this.statusChanges.emit(this.status);
}
this._updateAncestors(__spreadProps(__spreadValues({}, opts), {
skipPristineCheck
}), this);
this._onDisabledChange.forEach((changeFn) => changeFn(true));
}
/**
* Enables the control. This means the control is included in validation checks and
* the aggregate value of its parent. Its status recalculates based on its value and
* its validators.
*
* By default, if the control has children, all children are enabled.
*
* @see {@link AbstractControl.status}
*
* @param opts Configure options that control how the control propagates changes and
* emits events when marked as untouched
* * `onlySelf`: When true, mark only this control. When false or not supplied,
* marks all direct ancestors. Default is false.
* * `emitEvent`: When true or not supplied (the default), the `statusChanges`,
* `valueChanges` and `events`
* observables emit events with the latest status and value when the control is enabled.
* When false, no events are emitted.
*/
enable(opts = {}) {
const skipPristineCheck = this._parentMarkedDirty(opts.onlySelf);
this.status = VALID;
this._forEachChild((control) => {
control.enable(__spreadProps(__spreadValues({}, opts), {
onlySelf: true
}));
});
this.updateValueAndValidity({
onlySelf: true,
emitEvent: opts.emitEvent
});
this._updateAncestors(__spreadProps(__spreadValues({}, opts), {
skipPristineCheck
}), this);
this._onDisabledChange.forEach((changeFn) => changeFn(false));
}
_updateAncestors(opts, sourceControl) {
if (this._parent && !opts.onlySelf) {
this._parent.updateValueAndValidity(opts);
if (!opts.skipPristineCheck) {
this._parent._updatePristine({}, sourceControl);
}
this._parent._updateTouched({}, sourceControl);
}
}
/**
* Sets the parent of the control
*
* @param parent The new parent.
*/
setParent(parent) {
this._parent = parent;
}
/**
* The raw value of this control. For most control implementations, the raw value will include
* disabled children.
*/
getRawValue() {
return this.value;
}
updateValueAndValidity(opts = {}) {
this._setInitialStatus();
this._updateValue();
if (this.enabled) {
const shouldHaveEmitted = this._cancelExistingSubscription();
this.errors = this._runValidator();
this.status = this._calculateStatus();
if (this.status === VALID || this.status === PENDING) {
this._runAsyncValidator(shouldHaveEmitted, opts.emitEvent);
}
}
const sourceControl = opts.sourceControl ?? this;
if (opts.emitEvent !== false) {
this._events.next(new ValueChangeEvent(this.value, sourceControl));
this._events.next(new StatusChangeEvent(this.status, sourceControl));
this.valueChanges.emit(this.value);
this.statusChanges.emit(this.status);
}
if (this._parent && !opts.onlySelf) {
this._parent.updateValueAndValidity(__spreadProps(__spreadValues({}, opts), {
sourceControl
}));
}
}
/** @internal */
_updateTreeValidity(opts = {
emitEvent: true
}) {
this._forEachChild((ctrl) => ctrl._updateTreeValidity(opts));
this.updateValueAndValidity({
onlySelf: true,
emitEvent: opts.emitEvent
});
}
_setInitialStatus() {
this.status = this._allControlsDisabled() ? DISABLED : VALID;
}
_runValidator() {
return this.validator ? this.validator(this) : null;
}
_runAsyncValidator(shouldHaveEmitted, emitEvent) {
if (this.asyncValidator) {
this.status = PENDING;
this._hasOwnPendingAsyncValidator = {
emitEvent: emitEvent !== false,
shouldHaveEmitted: shouldHaveEmitted !== false
};
const obs = toObservable(this.asyncValidator(this));
this._asyncValidationSubscription = obs.subscribe((errors) => {
this._hasOwnPendingAsyncValidator = null;
this.setErrors(errors, {
emitEvent,
shouldHaveEmitted
});
});
}
}
_cancelExistingSubscription() {
if (this._asyncValidationSubscription) {
this._asyncValidationSubscription.unsubscribe();
const shouldHaveEmitted = (this._hasOwnPendingAsyncValidator?.emitEvent || this._hasOwnPendingAsyncValidator?.shouldHaveEmitted) ?? false;
this._hasOwnPendingAsyncValidator = null;
return shouldHaveEmitted;
}
return false;
}
setErrors(errors, opts = {}) {
this.errors = errors;
this._updateControlsErrors(opts.emitEvent !== false, this, opts.shouldHaveEmitted);
}
/**
* Retrieves a child control given the control's name or path.
*
* @param path A dot-delimited string or array of string/number values that define the path to the
* control. If a string is provided, passing it as a string literal will result in improved type
* information. Likewise, if an array is provided, passing it `as const` will cause improved type
* information to be available.
*
* @usageNotes
* ### Retrieve a nested control
*
* For example, to get a `name` control nested within a `person` sub-group:
*
* * `this.form.get('person.name');`
*
* -OR-
*
* * `this.form.get(['person', 'name'] as const);` // `as const` gives improved typings
*
* ### Retrieve a control in a FormArray
*
* When accessing an element inside a FormArray, you can use an element index.
* For example, to get a `price` control from the first element in an `items` array you can use:
*
* * `this.form.get('items.0.price');`
*
* -OR-
*
* * `this.form.get(['items', 0, 'price']);`
*/
get(path) {
let currPath = path;
if (currPath == null) return null;
if (!Array.isArray(currPath)) currPath = currPath.split(".");
if (currPath.length === 0) return null;
return currPath.reduce((control, name) => control && control._find(name), this);
}
/**
* @description
* Reports error data for the control with the given path.
*
* @param errorCode The code of the error to check
* @param path A list of control names that designates how to move from the current control
* to the control that should be queried for errors.
*
* @usageNotes
* For example, for the following `FormGroup`:
*
* ```ts
* form = new FormGroup({
* address: new FormGroup({ street: new FormControl() })
* });
* ```
*
* The path to the 'street' control from the root form would be 'address' -> 'street'.
*
* It can be provided to this method in one of two formats:
*
* 1. An array of string control names, e.g. `['address', 'street']`
* 1. A period-delimited list of control names in one string, e.g. `'address.street'`
*
* @returns error data for that particular error. If the control or error is not present,
* null is returned.
*/
getError(errorCode, path) {
const control = path ? this.get(path) : this;
return control && control.errors ? control.errors[errorCode] : null;
}
/**
* @description
* Reports whether the control with the given path has the error specified.
*
* @param errorCode The code of the error to check
* @param path A list of control names that designates how to move from the current control
* to the control that should be queried for errors.
*
* @usageNotes
* For example, for the following `FormGroup`:
*
* ```ts
* form = new FormGroup({
* address: new FormGroup({ street: new FormControl() })
* });
* ```
*
* The path to the 'street' control from the root form would be 'address' -> 'street'.
*
* It can be provided to this method in one of two formats:
*
* 1. An array of string control names, e.g. `['address', 'street']`
* 1. A period-delimited list of control names in one string, e.g. `'address.street'`
*
* If no path is given, this method checks for the error on the current control.
*
* @returns whether the given error is present in the control at the given path.
*
* If the control is not present, false is returned.
*/
hasError(errorCode, path) {
return !!this.getError(errorCode, path);
}
/**
* Retrieves the top-level ancestor of this control.
*/
get root() {
let x = this;
while (x._parent) {
x = x._parent;
}
return x;
}
/** @internal */
_updateControlsErrors(emitEvent, changedControl, shouldHaveEmitted) {
this.status = this._calculateStatus();
if (emitEvent) {
this.statusChanges.emit(this.status);
}
if (emitEvent || shouldHaveEmitted) {
this._events.next(new StatusChangeEvent(this.status, changedControl));
}
if (this._parent) {
this._parent._updateControlsErrors(emitEvent, changedControl, shouldHaveEmitted);
}
}
/** @internal */
_initObservables() {
this.valueChanges = new EventEmitter();
this.statusChanges = new EventEmitter();
}
_calculateStatus() {
if (this._allControlsDisabled()) return DISABLED;
if (this.errors) return INVALID;
if (this._hasOwnPendingAsyncValidator || this._anyControlsHaveStatus(PENDING)) return PENDING;
if (this._anyControlsHaveStatus(INVALID)) return INVALID;
return VALID;
}
/** @internal */
_anyControlsHaveStatus(status) {
return this._anyControls((control) => control.status === status);
}
/** @internal */
_anyControlsDirty() {
return this._anyControls((control) => control.dirty);
}
/** @internal */
_anyControlsTouched() {
return this._anyControls((control) => control.touched);
}
/** @internal */
_updatePristine(opts, changedControl) {
const newPristine = !this._anyControlsDirty();
const changed = this.pristine !== newPristine;
this.pristine = newPristine;
if (this._parent && !opts.onlySelf) {
this._parent._updatePristine(opts, changedControl);
}
if (changed) {
this._events.next(new PristineChangeEvent(this.pristine, changedControl));
}
}
/** @internal */
_updateTouched(opts = {}, changedControl) {
this.touched = this._anyControlsTouched();
this._events.next(new TouchedChangeEvent(this.touched, changedControl));
if (this._parent && !opts.onlySelf) {
this._parent._updateTouched(opts, changedControl);
}
}
/** @internal */
_onDisabledChange = [];
/** @internal */
_registerOnCollectionChange(fn) {
this._onCollectionChange = fn;
}
/** @internal */
_setUpdateStrategy(opts) {
if (isOptionsObj(opts) && opts.updateOn != null) {
this._updateOn = opts.updateOn;
}
}
/**
* Check to see if parent has been marked artificially dirty.
*
* @internal
*/
_parentMarkedDirty(onlySelf) {
const parentDirty = this._parent && this._parent.dirty;
return !onlySelf && !!parentDirty && !this._parent._anyControlsDirty();
}
/** @internal */
_find(name) {
return null;
}
/**
* Internal implementation of the `setValidators` method. Needs to be separated out into a
* different method, because it is called in the constructor and it can break cases where
* a control is extended.
*/
_assignValidators(validators) {
this._rawValidators = Array.isArray(validators) ? validators.slice() : validators;
this._composedValidatorFn = coerceToValidator(this._rawValidators);
}
/**
* Internal implementation of the `setAsyncValidators` method. Needs to be separated out into a
* different method, because it is called in the constructor and it can break cases where
* a control is extended.
*/
_assignAsyncValidators(validators) {
this._rawAsyncValidators = Array.isArray(validators) ? validators.slice() : validators;
this._composedAsyncValidatorFn = coerceToAsyncValidator(this._rawAsyncValidators);
}
};
var FormGroup = class extends AbstractControl {
/**
* Creates a new `FormGroup` instance.
*
* @param controls A collection of child controls. The key for each child is the name
* under which it is registered.
*
* @param validatorOrOpts A synchronous validator function, or an array of
* such functions, or an `AbstractControlOptions` object that contains validation functions
* and a validation trigger.
*
* @param asyncValidator A single async validator or array of async validator functions
*
*/
constructor(controls, validatorOrOpts, asyncValidator) {
super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));
(typeof ngDevMode === "undefined" || ngDevMode) && validateFormGroupControls(controls);
this.controls = controls;
this._initObservables();
this._setUpdateStrategy(validatorOrOpts);
this._setUpControls();
this.updateValueAndValidity({
onlySelf: true,
// If `asyncValidator` is present, it will trigger control status change from `PENDING` to
// `VALID` or `INVALID`. The status should be broadcasted via the `statusChanges` observable,
// so we set `emitEvent` to `true` to allow that during the control creation process.
emitEvent: !!this.asyncValidator
});
}
controls;
registerControl(name, control) {
if (this.controls[name]) return this.controls[name];
this.controls[name] = control;
control.setParent(this);
control._registerOnCollectionChange(this._onCollectionChange);
return control;
}
addControl(name, control, options = {}) {
this.registerControl(name, control);
this.updateValueAndValidity({
emitEvent: options.emitEvent
});
this._onCollectionChange();
}
/**
* Remove a control from this group. In a strongly-typed group, required controls cannot be
* removed.
*
* This method also updates the value and validity of the control.
*
* @param name The control name to remove from the collection
* @param options Specifies whether this FormGroup instance should emit events after a
* control is removed.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges` observables emit events with the latest status and value when the control is
* removed. When false, no events are emitted.
*/
removeControl(name, options = {}) {
if (this.controls[name]) this.controls[name]._registerOnCollectionChange(() => {
});
delete this.controls[name];
this.updateValueAndValidity({
emitEvent: options.emitEvent
});
this._onCollectionChange();
}
setControl(name, control, options = {}) {
if (this.controls[name]) this.controls[name]._registerOnCollectionChange(() => {
});
delete this.controls[name];
if (control) this.registerControl(name, control);
this.updateValueAndValidity({
emitEvent: options.emitEvent
});
this._onCollectionChange();
}
contains(controlName) {
return this.controls.hasOwnProperty(controlName) && this.controls[controlName].enabled;
}
/**
* Sets the value of the `FormGroup`. It accepts an object that matches
* the structure of the group, with control names as keys.
*
* @usageNotes
* ### Set the complete value for the form group
*
* ```ts
* const form = new FormGroup({
* first: new FormControl(),
* last: new FormControl()
* });
*
* console.log(form.value); // {first: null, last: null}
*
* form.setValue({first: 'Nancy', last: 'Drew'});
* console.log(form.value); // {first: 'Nancy', last: 'Drew'}
* ```
*
* @throws When strict checks fail, such as setting the value of a control
* that doesn't exist or if you exclude a value of a control that does exist.
*
* @param value The new value for the control that matches the structure of the group.
* @param options Configuration options that determine how the control propagates changes
* and emits events after the value changes.
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
* updateValueAndValidity} method.
*
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
* false.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control value is updated.
* When false, no events are emitted.
*/
setValue(value, options = {}) {
assertAllValuesPresent(this, true, value);
Object.keys(value).forEach((name) => {
assertControlPresent(this, true, name);
this.controls[name].setValue(value[name], {
onlySelf: true,
emitEvent: options.emitEvent
});
});
this.updateValueAndValidity(options);
}
/**
* Patches the value of the `FormGroup`. It accepts an object with control
* names as keys, and does its best to match the values to the correct controls
* in the group.
*
* It accepts both super-sets and sub-sets of the group without throwing an error.
*
* @usageNotes
* ### Patch the value for a form group
*
* ```ts
* const form = new FormGroup({
* first: new FormControl(),
* last: new FormControl()
* });
* console.log(form.value); // {first: null, last: null}
*
* form.patchValue({first: 'Nancy'});
* console.log(form.value); // {first: 'Nancy', last: null}
* ```
*
* @param value The object that matches the structure of the group.
* @param options Configuration options that determine how the control propagates changes and
* emits events after the value is patched.
* * `onlySelf`: When true, each change only affects this control and not its parent. Default is
* true.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges` observables emit events with the latest status and value when the control value
* is updated. When false, no events are emitted. The configuration options are passed to
* the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method.
*/
patchValue(value, options = {}) {
if (value == null) return;
Object.keys(value).forEach((name) => {
const control = this.controls[name];
if (control) {
control.patchValue(
/* Guaranteed to be present, due to the outer forEach. */
value[name],
{
onlySelf: true,
emitEvent: options.emitEvent
}
);
}
});
this.updateValueAndValidity(options);
}
/**
* Resets the `FormGroup`, marks all descendants `pristine` and `untouched` and sets
* the value of all descendants to their default values, or null if no defaults were provided.
*
* You reset to a specific form state by passing in a map of states
* that matches the structure of your form, with control names as keys. The state
* is a standalone value or a form state object with both a value and a disabled
* status.
*
* @param value Resets the control with an initial value,
* or an object that defines the initial value and disabled state.
*
* @param options Configuration options that determine how the control propagates changes
* and emits events when the group is reset.
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
* false.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control is reset.
* When false, no events are emitted.
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
* updateValueAndValidity} method.
*
* @usageNotes
*
* ### Reset the form group values
*
* ```ts
* const form = new FormGroup({
* first: new FormControl('first name'),
* last: new FormControl('last name')
* });
*
* console.log(form.value); // {first: 'first name', last: 'last name'}
*
* form.reset({ first: 'name', last: 'last name' });
*
* console.log(form.value); // {first: 'name', last: 'last name'}
* ```
*
* ### Reset the form group values and disabled status
*
* ```ts
* const form = new FormGroup({
* first: new FormControl('first name'),
* last: new FormControl('last name')
* });
*
* form.reset({
* first: {value: 'name', disabled: true},
* last: 'last'
* });
*
* console.log(form.value); // {last: 'last'}
* console.log(form.get('first').status); // 'DISABLED'
* ```
*/
reset(value = {}, options = {}) {
this._forEachChild((control, name) => {
control.reset(value ? value[name] : null, {
onlySelf: true,
emitEvent: options.emitEvent
});
});
this._updatePristine(options, this);
this._updateTouched(options, this);
this.updateValueAndValidity(options);
}
/**
* The aggregate value of the `FormGroup`, including any disabled controls.
*
* Retrieves all values regardless of disabled status.
*/
getRawValue() {
return this._reduceChildren({}, (acc, control, name) => {
acc[name] = control.getRawValue();
return acc;
});
}
/** @internal */
_syncPendingControls() {
let subtreeUpdated = this._reduceChildren(false, (updated, child) => {
return child._syncPendingControls() ? true : updated;
});
if (subtreeUpdated) this.updateValueAndValidity({
onlySelf: true
});
return subtreeUpdated;
}
/** @internal */
_forEachChild(cb) {
Object.keys(this.controls).forEach((key) => {
const control = this.controls[key];
control && cb(control, key);
});
}
/** @internal */
_setUpControls() {
this._forEachChild((control) => {
control.setParent(this);
control._registerOnCollectionChange(this._onCollectionChange);
});
}
/** @internal */
_updateValue() {
this.value = this._reduceValue();
}
/** @internal */
_anyControls(condition) {
for (const [controlName, control] of Object.entries(this.controls)) {
if (this.contains(controlName) && condition(control)) {
return true;
}
}
return false;
}
/** @internal */
_reduceValue() {
let acc = {};
return this._reduceChildren(acc, (acc2, control, name) => {
if (control.enabled || this.disabled) {
acc2[name] = control.value;
}
return acc2;
});
}
/** @internal */
_reduceChildren(initValue, fn) {
let res = initValue;
this._forEachChild((control, name) => {
res = fn(res, control, name);
});
return res;
}
/** @internal */
_allControlsDisabled() {
for (const controlName of Object.keys(this.controls)) {
if (this.controls[controlName].enabled) {
return false;
}
}
return Object.keys(this.controls).length > 0 || this.disabled;
}
/** @internal */
_find(name) {
return this.controls.hasOwnProperty(name) ? this.controls[name] : null;
}
};
function validateFormGroupControls(controls) {
const invalidKeys = Object.keys(controls).filter((key) => key.includes("."));
if (invalidKeys.length > 0) {
console.warn(`FormGroup keys cannot include \`.\`, please replace the keys for: ${invalidKeys.join(",")}.`);
}
}
var FormRecord = class extends FormGroup {
};
var CALL_SET_DISABLED_STATE = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "CallSetDisabledState" : "", {
providedIn: "root",
factory: () => setDisabledStateDefault
});
var setDisabledStateDefault = "always";
function controlPath(name, parent) {
return [...parent.path, name];
}
function setUpControl(control, dir, callSetDisabledState = setDisabledStateDefault) {
if (typeof ngDevMode === "undefined" || ngDevMode) {
if (!control) _throwError(dir, "Cannot find control with");
if (!dir.valueAccessor) _throwMissingValueAccessorError(dir);
}
setUpValidators(control, dir);
dir.valueAccessor.writeValue(control.value);
if (control.disabled || callSetDisabledState === "always") {
dir.valueAccessor.setDisabledState?.(control.disabled);
}
setUpViewChangePipeline(control, dir);
setUpModelChangePipeline(control, dir);
setUpBlurPipeline(control, dir);
setUpDisabledChangeHandler(control, dir);
}
function cleanUpControl(control, dir, validateControlPresenceOnChange = true) {
const noop4 = () => {
if (validateControlPresenceOnChange && (typeof ngDevMode === "undefined" || ngDevMode)) {
_noControlError(dir);
}
};
if (dir.valueAccessor) {
dir.valueAccessor.registerOnChange(noop4);
dir.valueAccessor.registerOnTouched(noop4);
}
cleanUpValidators(control, dir);
if (control) {
dir._invokeOnDestroyCallbacks();
control._registerOnCollectionChange(() => {
});
}
}
function registerOnValidatorChange(validators, onChange) {
validators.forEach((validator) => {
if (validator.registerOnValidatorChange) validator.registerOnValidatorChange(onChange);
});
}
function setUpDisabledChangeHandler(control, dir) {
if (dir.valueAccessor.setDisabledState) {
const onDisabledChange = (isDisabled) => {
dir.valueAccessor.setDisabledState(isDisabled);
};
control.registerOnDisabledChange(onDisabledChange);
dir._registerOnDestroy(() => {
control._unregisterOnDisabledChange(onDisabledChange);
});
}
}
function setUpValidators(control, dir) {
const validators = getControlValidators(control);
if (dir.validator !== null) {
control.setValidators(mergeValidators(validators, dir.validator));
} else if (typeof validators === "function") {
control.setValidators([validators]);
}
const asyncValidators = getControlAsyncValidators(control);
if (dir.asyncValidator !== null) {
control.setAsyncValidators(mergeValidators(asyncValidators, dir.asyncValidator));
} else if (typeof asyncValidators === "function") {
control.setAsyncValidators([asyncValidators]);
}
const onValidatorChange = () => control.updateValueAndValidity();
registerOnValidatorChange(dir._rawValidators, onValidatorChange);
registerOnValidatorChange(dir._rawAsyncValidators, onValidatorChange);
}
function cleanUpValidators(control, dir) {
let isControlUpdated = false;
if (control !== null) {
if (dir.validator !== null) {
const validators = getControlValidators(control);
if (Array.isArray(validators) && validators.length > 0) {
const updatedValidators = validators.filter((validator) => validator !== dir.validator);
if (updatedValidators.length !== validators.length) {
isControlUpdated = true;
control.setValidators(updatedValidators);
}
}
}
if (dir.asyncValidator !== null) {
const asyncValidators = getControlAsyncValidators(control);
if (Array.isArray(asyncValidators) && asyncValidators.length > 0) {
const updatedAsyncValidators = asyncValidators.filter((asyncValidator) => asyncValidator !== dir.asyncValidator);
if (updatedAsyncValidators.length !== asyncValidators.length) {
isControlUpdated = true;
control.setAsyncValidators(updatedAsyncValidators);
}
}
}
}
const noop4 = () => {
};
registerOnValidatorChange(dir._rawValidators, noop4);
registerOnValidatorChange(dir._rawAsyncValidators, noop4);
return isControlUpdated;
}
function setUpViewChangePipeline(control, dir) {
dir.valueAccessor.registerOnChange((newValue) => {
control._pendingValue = newValue;
control._pendingChange = true;
control._pendingDirty = true;
if (control.updateOn === "change") updateControl(control, dir);
});
}
function setUpBlurPipeline(control, dir) {
dir.valueAccessor.registerOnTouched(() => {
control._pendingTouched = true;
if (control.updateOn === "blur" && control._pendingChange) updateControl(control, dir);
if (control.updateOn !== "submit") control.markAsTouched();
});
}
function updateControl(control, dir) {
if (control._pendingDirty) control.markAsDirty();
control.setValue(control._pendingValue, {
emitModelToViewChange: false
});
dir.viewToModelUpdate(control._pendingValue);
control._pendingChange = false;
}
function setUpModelChangePipeline(control, dir) {
const onChange = (newValue, emitModelEvent) => {
dir.valueAccessor.writeValue(newValue);
if (emitModelEvent) dir.viewToModelUpdate(newValue);
};
control.registerOnChange(onChange);
dir._registerOnDestroy(() => {
control._unregisterOnChange(onChange);
});
}
function setUpFormContainer(control, dir) {
if (control == null && (typeof ngDevMode === "undefined" || ngDevMode)) _throwError(dir, "Cannot find control with");
setUpValidators(control, dir);
}
function cleanUpFormContainer(control, dir) {
return cleanUpValidators(control, dir);
}
function _noControlError(dir) {
return _throwError(dir, "There is no FormControl instance attached to form control element with");
}
function _throwError(dir, message) {
const messageEnd = _describeControlLocation(dir);
throw new Error(`${message} ${messageEnd}`);
}
function _describeControlLocation(dir) {
const path = dir.path;
if (path && path.length > 1) return `path: '${path.join(" -> ")}'`;
if (path?.[0]) return `name: '${path}'`;
return "unspecified name attribute";
}
function _throwMissingValueAccessorError(dir) {
const loc = _describeControlLocation(dir);
throw new RuntimeError(-1203, `No value accessor for form control ${loc}.`);
}
function _throwInvalidValueAccessorError(dir) {
const loc = _describeControlLocation(dir);
throw new RuntimeError(1200, `Value accessor was not provided as an array for form control with ${loc}. Check that the \`NG_VALUE_ACCESSOR\` token is configured as a \`multi: true\` provider.`);
}
function isPropertyUpdated(changes, viewModel) {
if (!changes.hasOwnProperty("model")) return false;
const change = changes["model"];
if (change.isFirstChange()) return true;
return !Object.is(viewModel, change.currentValue);
}
function isBuiltInAccessor(valueAccessor) {
return Object.getPrototypeOf(valueAccessor.constructor) === BuiltInControlValueAccessor;
}
function syncPendingControls(form, directives) {
form._syncPendingControls();
directives.forEach((dir) => {
const control = dir.control;
if (control.updateOn === "submit" && control._pendingChange) {
dir.viewToModelUpdate(control._pendingValue);
control._pendingChange = false;
}
});
}
function selectValueAccessor(dir, valueAccessors) {
if (!valueAccessors) return null;
if (!Array.isArray(valueAccessors) && (typeof ngDevMode === "undefined" || ngDevMode)) _throwInvalidValueAccessorError(dir);
let defaultAccessor = void 0;
let builtinAccessor = void 0;
let customAccessor = void 0;
valueAccessors.forEach((v) => {
if (v.constructor === DefaultValueAccessor) {
defaultAccessor = v;
} else if (isBuiltInAccessor(v)) {
if (builtinAccessor && (typeof ngDevMode === "undefined" || ngDevMode)) _throwError(dir, "More than one built-in value accessor matches form control with");
builtinAccessor = v;
} else {
if (customAccessor && (typeof ngDevMode === "undefined" || ngDevMode)) _throwError(dir, "More than one custom value accessor matches form control with");
customAccessor = v;
}
});
if (customAccessor) return customAccessor;
if (builtinAccessor) return builtinAccessor;
if (defaultAccessor) return defaultAccessor;
if (typeof ngDevMode === "undefined" || ngDevMode) {
_throwError(dir, "No valid value accessor for form control with");
}
return null;
}
function removeListItem$1(list, el) {
const index = list.indexOf(el);
if (index > -1) list.splice(index, 1);
}
function _ngModelWarning(name, type, instance, warningConfig) {
if (warningConfig === "never") return;
if ((warningConfig === null || warningConfig === "once") && !type._ngModelWarningSentOnce || warningConfig === "always" && !instance._ngModelWarningSent) {
console.warn(ngModelWarning(name));
type._ngModelWarningSentOnce = true;
instance._ngModelWarningSent = true;
}
}
var formDirectiveProvider$1 = {
provide: ControlContainer,
useExisting: forwardRef(() => NgForm)
};
var resolvedPromise$1 = (() => Promise.resolve())();
var NgForm = class _NgForm extends ControlContainer {
callSetDisabledState;
/**
* @description
* Returns whether the form submission has been triggered.
*/
get submitted() {
return untracked2(this.submittedReactive);
}
/** @internal */
_submitted = computed(() => this.submittedReactive(), ...ngDevMode ? [{
debugName: "_submitted"
}] : []);
submittedReactive = signal(false, ...ngDevMode ? [{
debugName: "submittedReactive"
}] : []);
_directives = /* @__PURE__ */ new Set();
/**
* @description
* The `FormGroup` instance created for this form.
*/
form;
/**
* @description
* Event emitter for the "ngSubmit" event
*/
ngSubmit = new EventEmitter();
/**
* @description
* Tracks options for the `NgForm` instance.
*
* **updateOn**: Sets the default `updateOn` value for all child `NgModels` below it
* unless explicitly set by a child `NgModel` using `ngModelOptions`). Defaults to 'change'.
* Possible values: `'change'` | `'blur'` | `'submit'`.
*
*/
options;
constructor(validators, asyncValidators, callSetDisabledState) {
super();
this.callSetDisabledState = callSetDisabledState;
this.form = new FormGroup({}, composeValidators(validators), composeAsyncValidators(asyncValidators));
}
/** @docs-private */
ngAfterViewInit() {
this._setUpdateStrategy();
}
/**
* @description
* The directive instance.
*/
get formDirective() {
return this;
}
/**
* @description
* The internal `FormGroup` instance.
*/
get control() {
return this.form;
}
/**
* @description
* Returns an array representing the path to this group. Because this directive
* always lives at the top level of a form, it is always an empty array.
*/
get path() {
return [];
}
/**
* @description
* Returns a map of the controls in this group.
*/
get controls() {
return this.form.controls;
}
/**
* @description
* Method that sets up the control directive in this group, re-calculates its value
* and validity, and adds the instance to the internal list of directives.
*
* @param dir The `NgModel` directive instance.
*/
addControl(dir) {
resolvedPromise$1.then(() => {
const container = this._findContainer(dir.path);
dir.control = container.registerControl(dir.name, dir.control);
setUpControl(dir.control, dir, this.callSetDisabledState);
dir.control.updateValueAndValidity({
emitEvent: false
});
this._directives.add(dir);
});
}
/**
* @description
* Retrieves the `FormControl` instance from the provided `NgModel` directive.
*
* @param dir The `NgModel` directive instance.
*/
getControl(dir) {
return this.form.get(dir.path);
}
/**
* @description
* Removes the `NgModel` instance from the internal list of directives
*
* @param dir The `NgModel` directive instance.
*/
removeControl(dir) {
resolvedPromise$1.then(() => {
const container = this._findContainer(dir.path);
if (container) {
container.removeControl(dir.name);
}
this._directives.delete(dir);
});
}
/**
* @description
* Adds a new `NgModelGroup` directive instance to the form.
*
* @param dir The `NgModelGroup` directive instance.
*/
addFormGroup(dir) {
resolvedPromise$1.then(() => {
const container = this._findContainer(dir.path);
const group = new FormGroup({});
setUpFormContainer(group, dir);
container.registerControl(dir.name, group);
group.updateValueAndValidity({
emitEvent: false
});
});
}
/**
* @description
* Removes the `NgModelGroup` directive instance from the form.
*
* @param dir The `NgModelGroup` directive instance.
*/
removeFormGroup(dir) {
resolvedPromise$1.then(() => {
const container = this._findContainer(dir.path);
if (container) {
container.removeControl(dir.name);
}
});
}
/**
* @description
* Retrieves the `FormGroup` for a provided `NgModelGroup` directive instance
*
* @param dir The `NgModelGroup` directive instance.
*/
getFormGroup(dir) {
return this.form.get(dir.path);
}
/**
* Sets the new value for the provided `NgControl` directive.
*
* @param dir The `NgControl` directive instance.
* @param value The new value for the directive's control.
*/
updateModel(dir, value) {
resolvedPromise$1.then(() => {
const ctrl = this.form.get(dir.path);
ctrl.setValue(value);
});
}
/**
* @description
* Sets the value for this `FormGroup`.
*
* @param value The new value
*/
setValue(value) {
this.control.setValue(value);
}
/**
* @description
* Method called when the "submit" event is triggered on the form.
* Triggers the `ngSubmit` emitter to emit the "submit" event as its payload.
*
* @param $event The "submit" event object
*/
onSubmit($event) {
this.submittedReactive.set(true);
syncPendingControls(this.form, this._directives);
this.ngSubmit.emit($event);
this.form._events.next(new FormSubmittedEvent(this.control));
return $event?.target?.method === "dialog";
}
/**
* @description
* Method called when the "reset" event is triggered on the form.
*/
onReset() {
this.resetForm();
}
/**
* @description
* Resets the form to an initial value and resets its submitted status.
*
* @param value The new value for the form.
*/
resetForm(value = void 0) {
this.form.reset(value);
this.submittedReactive.set(false);
this.form._events.next(new FormResetEvent(this.form));
}
_setUpdateStrategy() {
if (this.options && this.options.updateOn != null) {
this.form._updateOn = this.options.updateOn;
}
}
_findContainer(path) {
path.pop();
return path.length ? this.form.get(path) : this.form;
}
static \u0275fac = function NgForm_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgForm)(\u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10), \u0275\u0275directiveInject(CALL_SET_DISABLED_STATE, 8));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgForm,
selectors: [["form", 3, "ngNoForm", "", 3, "formGroup", ""], ["ng-form"], ["", "ngForm", ""]],
hostBindings: function NgForm_HostBindings(rf, ctx) {
if (rf & 1) {
\u0275\u0275listener("submit", function NgForm_submit_HostBindingHandler($event) {
return ctx.onSubmit($event);
})("reset", function NgForm_reset_HostBindingHandler() {
return ctx.onReset();
});
}
},
inputs: {
options: [0, "ngFormOptions", "options"]
},
outputs: {
ngSubmit: "ngSubmit"
},
exportAs: ["ngForm"],
standalone: false,
features: [\u0275\u0275ProvidersFeature([formDirectiveProvider$1]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgForm, [{
type: Directive,
args: [{
selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]",
providers: [formDirectiveProvider$1],
host: {
"(submit)": "onSubmit($event)",
"(reset)": "onReset()"
},
outputs: ["ngSubmit"],
exportAs: "ngForm",
standalone: false
}]
}], () => [{
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_VALIDATORS]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_ASYNC_VALIDATORS]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Inject,
args: [CALL_SET_DISABLED_STATE]
}]
}], {
options: [{
type: Input,
args: ["ngFormOptions"]
}]
});
})();
function removeListItem(list, el) {
const index = list.indexOf(el);
if (index > -1) list.splice(index, 1);
}
function isFormControlState(formState) {
return typeof formState === "object" && formState !== null && Object.keys(formState).length === 2 && "value" in formState && "disabled" in formState;
}
var FormControl = class FormControl2 extends AbstractControl {
/** @publicApi */
defaultValue = null;
/** @internal */
_onChange = [];
/** @internal */
_pendingValue;
/** @internal */
_pendingChange = false;
constructor(formState = null, validatorOrOpts, asyncValidator) {
super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));
this._applyFormState(formState);
this._setUpdateStrategy(validatorOrOpts);
this._initObservables();
this.updateValueAndValidity({
onlySelf: true,
// If `asyncValidator` is present, it will trigger control status change from `PENDING` to
// `VALID` or `INVALID`.
// The status should be broadcasted via the `statusChanges` observable, so we set
// `emitEvent` to `true` to allow that during the control creation process.
emitEvent: !!this.asyncValidator
});
if (isOptionsObj(validatorOrOpts) && (validatorOrOpts.nonNullable || validatorOrOpts.initialValueIsDefault)) {
if (isFormControlState(formState)) {
this.defaultValue = formState.value;
} else {
this.defaultValue = formState;
}
}
}
setValue(value, options = {}) {
this.value = this._pendingValue = value;
if (this._onChange.length && options.emitModelToViewChange !== false) {
this._onChange.forEach((changeFn) => changeFn(this.value, options.emitViewToModelChange !== false));
}
this.updateValueAndValidity(options);
}
patchValue(value, options = {}) {
this.setValue(value, options);
}
reset(formState = this.defaultValue, options = {}) {
this._applyFormState(formState);
this.markAsPristine(options);
this.markAsUntouched(options);
this.setValue(this.value, options);
this._pendingChange = false;
}
/** @internal */
_updateValue() {
}
/** @internal */
_anyControls(condition) {
return false;
}
/** @internal */
_allControlsDisabled() {
return this.disabled;
}
registerOnChange(fn) {
this._onChange.push(fn);
}
/** @internal */
_unregisterOnChange(fn) {
removeListItem(this._onChange, fn);
}
registerOnDisabledChange(fn) {
this._onDisabledChange.push(fn);
}
/** @internal */
_unregisterOnDisabledChange(fn) {
removeListItem(this._onDisabledChange, fn);
}
/** @internal */
_forEachChild(cb) {
}
/** @internal */
_syncPendingControls() {
if (this.updateOn === "submit") {
if (this._pendingDirty) this.markAsDirty();
if (this._pendingTouched) this.markAsTouched();
if (this._pendingChange) {
this.setValue(this._pendingValue, {
onlySelf: true,
emitModelToViewChange: false
});
return true;
}
}
return false;
}
_applyFormState(formState) {
if (isFormControlState(formState)) {
this.value = this._pendingValue = formState.value;
formState.disabled ? this.disable({
onlySelf: true,
emitEvent: false
}) : this.enable({
onlySelf: true,
emitEvent: false
});
} else {
this.value = this._pendingValue = formState;
}
}
};
var isFormControl = (control) => control instanceof FormControl;
var AbstractFormGroupDirective = class _AbstractFormGroupDirective extends ControlContainer {
/**
* @description
* The parent control for the group
*
* @internal
*/
_parent;
/** @docs-private */
ngOnInit() {
this._checkParentType();
this.formDirective.addFormGroup(this);
}
/** @docs-private */
ngOnDestroy() {
if (this.formDirective) {
this.formDirective.removeFormGroup(this);
}
}
/**
* @description
* The `FormGroup` bound to this directive.
*/
get control() {
return this.formDirective.getFormGroup(this);
}
/**
* @description
* The path to this group from the top-level directive.
*/
get path() {
return controlPath(this.name == null ? this.name : this.name.toString(), this._parent);
}
/**
* @description
* The top-level directive for this group if present, otherwise null.
*/
get formDirective() {
return this._parent ? this._parent.formDirective : null;
}
/** @internal */
_checkParentType() {
}
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275AbstractFormGroupDirective_BaseFactory;
return function AbstractFormGroupDirective_Factory(__ngFactoryType__) {
return (\u0275AbstractFormGroupDirective_BaseFactory || (\u0275AbstractFormGroupDirective_BaseFactory = \u0275\u0275getInheritedFactory(_AbstractFormGroupDirective)))(__ngFactoryType__ || _AbstractFormGroupDirective);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _AbstractFormGroupDirective,
standalone: false,
features: [\u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AbstractFormGroupDirective, [{
type: Directive,
args: [{
standalone: false
}]
}], null, null);
})();
function modelParentException() {
return new RuntimeError(1350, `
ngModel cannot be used to register form controls with a parent formGroup directive. Try using
formGroup's partner directive "formControlName" instead. Example:
${formControlNameExample}
Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions:
Example:
${ngModelWithFormGroupExample}`);
}
function formGroupNameException() {
return new RuntimeError(1351, `
ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.
Option 1: Use formControlName instead of ngModel (reactive strategy):
${formGroupNameExample}
Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):
${ngModelGroupExample}`);
}
function missingNameException() {
return new RuntimeError(1352, `If ngModel is used within a form tag, either the name attribute must be set or the form
control must be defined as 'standalone' in ngModelOptions.
Example 1: <input [(ngModel)]="person.firstName" name="first">
Example 2: <input [(ngModel)]="person.firstName" [ngModelOptions]="{standalone: true}">`);
}
function modelGroupParentException() {
return new RuntimeError(1353, `
ngModelGroup cannot be used with a parent formGroup directive.
Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):
${formGroupNameExample}
Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):
${ngModelGroupExample}`);
}
var modelGroupProvider = {
provide: ControlContainer,
useExisting: forwardRef(() => NgModelGroup)
};
var NgModelGroup = class _NgModelGroup extends AbstractFormGroupDirective {
/**
* @description
* Tracks the name of the `NgModelGroup` bound to the directive. The name corresponds
* to a key in the parent `NgForm`.
*/
name = "";
constructor(parent, validators, asyncValidators) {
super();
this._parent = parent;
this._setValidators(validators);
this._setAsyncValidators(asyncValidators);
}
/** @internal */
_checkParentType() {
if (!(this._parent instanceof _NgModelGroup) && !(this._parent instanceof NgForm) && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw modelGroupParentException();
}
}
static \u0275fac = function NgModelGroup_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgModelGroup)(\u0275\u0275directiveInject(ControlContainer, 5), \u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgModelGroup,
selectors: [["", "ngModelGroup", ""]],
inputs: {
name: [0, "ngModelGroup", "name"]
},
exportAs: ["ngModelGroup"],
standalone: false,
features: [\u0275\u0275ProvidersFeature([modelGroupProvider]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgModelGroup, [{
type: Directive,
args: [{
selector: "[ngModelGroup]",
providers: [modelGroupProvider],
exportAs: "ngModelGroup",
standalone: false
}]
}], () => [{
type: ControlContainer,
decorators: [{
type: Host
}, {
type: SkipSelf
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_VALIDATORS]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_ASYNC_VALIDATORS]
}]
}], {
name: [{
type: Input,
args: ["ngModelGroup"]
}]
});
})();
var formControlBinding$1 = {
provide: NgControl,
useExisting: forwardRef(() => NgModel)
};
var resolvedPromise = (() => Promise.resolve())();
var NgModel = class _NgModel extends NgControl {
_changeDetectorRef;
callSetDisabledState;
control = new FormControl();
// At runtime we coerce arbitrary values assigned to the "disabled" input to a "boolean".
// This is not reflected in the type of the property because outside of templates, consumers
// should only deal with booleans. In templates, a string is allowed for convenience and to
// match the native "disabled attribute" semantics which can be observed on input elements.
// This static member tells the compiler that values of type "string" can also be assigned
// to the input in a template.
/** @docs-private */
static ngAcceptInputType_isDisabled;
/** @internal */
_registered = false;
/**
* Internal reference to the view model value.
* @docs-private
*/
viewModel;
/**
* @description
* Tracks the name bound to the directive. If a parent form exists, it
* uses this name as a key to retrieve this control's value.
*/
name = "";
/**
* @description
* Tracks whether the control is disabled.
*/
isDisabled;
/**
* @description
* Tracks the value bound to this directive.
*/
model;
/**
* @description
* Tracks the configuration options for this `ngModel` instance.
*
* **name**: An alternative to setting the name attribute on the form control element. See
* the [example](api/forms/NgModel#using-ngmodel-on-a-standalone-control) for using `NgModel`
* as a standalone control.
*
* **standalone**: When set to true, the `ngModel` will not register itself with its parent form,
* and acts as if it's not in the form. Defaults to false. If no parent form exists, this option
* has no effect.
*
* **updateOn**: Defines the event upon which the form control value and validity update.
* Defaults to 'change'. Possible values: `'change'` | `'blur'` | `'submit'`.
*
*/
options;
/**
* @description
* Event emitter for producing the `ngModelChange` event after
* the view model updates.
*/
update = new EventEmitter();
constructor(parent, validators, asyncValidators, valueAccessors, _changeDetectorRef, callSetDisabledState) {
super();
this._changeDetectorRef = _changeDetectorRef;
this.callSetDisabledState = callSetDisabledState;
this._parent = parent;
this._setValidators(validators);
this._setAsyncValidators(asyncValidators);
this.valueAccessor = selectValueAccessor(this, valueAccessors);
}
/** @docs-private */
ngOnChanges(changes) {
this._checkForErrors();
if (!this._registered || "name" in changes) {
if (this._registered) {
this._checkName();
if (this.formDirective) {
const oldName = changes["name"].previousValue;
this.formDirective.removeControl({
name: oldName,
path: this._getPath(oldName)
});
}
}
this._setUpControl();
}
if ("isDisabled" in changes) {
this._updateDisabled(changes);
}
if (isPropertyUpdated(changes, this.viewModel)) {
this._updateValue(this.model);
this.viewModel = this.model;
}
}
/** @docs-private */
ngOnDestroy() {
this.formDirective && this.formDirective.removeControl(this);
}
/**
* @description
* Returns an array that represents the path from the top-level form to this control.
* Each index is the string name of the control on that level.
*/
get path() {
return this._getPath(this.name);
}
/**
* @description
* The top-level directive for this control if present, otherwise null.
*/
get formDirective() {
return this._parent ? this._parent.formDirective : null;
}
/**
* @description
* Sets the new value for the view model and emits an `ngModelChange` event.
*
* @param newValue The new value emitted by `ngModelChange`.
*/
viewToModelUpdate(newValue) {
this.viewModel = newValue;
this.update.emit(newValue);
}
_setUpControl() {
this._setUpdateStrategy();
this._isStandalone() ? this._setUpStandalone() : this.formDirective.addControl(this);
this._registered = true;
}
_setUpdateStrategy() {
if (this.options && this.options.updateOn != null) {
this.control._updateOn = this.options.updateOn;
}
}
_isStandalone() {
return !this._parent || !!(this.options && this.options.standalone);
}
_setUpStandalone() {
setUpControl(this.control, this, this.callSetDisabledState);
this.control.updateValueAndValidity({
emitEvent: false
});
}
_checkForErrors() {
if ((typeof ngDevMode === "undefined" || ngDevMode) && !this._isStandalone()) {
checkParentType$1(this._parent);
}
this._checkName();
}
_checkName() {
if (this.options && this.options.name) this.name = this.options.name;
if (!this._isStandalone() && !this.name && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw missingNameException();
}
}
_updateValue(value) {
resolvedPromise.then(() => {
this.control.setValue(value, {
emitViewToModelChange: false
});
this._changeDetectorRef?.markForCheck();
});
}
_updateDisabled(changes) {
const disabledValue = changes["isDisabled"].currentValue;
const isDisabled = disabledValue !== 0 && booleanAttribute(disabledValue);
resolvedPromise.then(() => {
if (isDisabled && !this.control.disabled) {
this.control.disable();
} else if (!isDisabled && this.control.disabled) {
this.control.enable();
}
this._changeDetectorRef?.markForCheck();
});
}
_getPath(controlName) {
return this._parent ? controlPath(controlName, this._parent) : [controlName];
}
static \u0275fac = function NgModel_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgModel)(\u0275\u0275directiveInject(ControlContainer, 9), \u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10), \u0275\u0275directiveInject(NG_VALUE_ACCESSOR, 10), \u0275\u0275directiveInject(ChangeDetectorRef, 8), \u0275\u0275directiveInject(CALL_SET_DISABLED_STATE, 8));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgModel,
selectors: [["", "ngModel", "", 3, "formControlName", "", 3, "formControl", ""]],
inputs: {
name: "name",
isDisabled: [0, "disabled", "isDisabled"],
model: [0, "ngModel", "model"],
options: [0, "ngModelOptions", "options"]
},
outputs: {
update: "ngModelChange"
},
exportAs: ["ngModel"],
standalone: false,
features: [\u0275\u0275ProvidersFeature([formControlBinding$1]), \u0275\u0275InheritDefinitionFeature, \u0275\u0275NgOnChangesFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgModel, [{
type: Directive,
args: [{
selector: "[ngModel]:not([formControlName]):not([formControl])",
providers: [formControlBinding$1],
exportAs: "ngModel",
standalone: false
}]
}], () => [{
type: ControlContainer,
decorators: [{
type: Optional
}, {
type: Host
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_VALIDATORS]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_ASYNC_VALIDATORS]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_VALUE_ACCESSOR]
}]
}, {
type: ChangeDetectorRef,
decorators: [{
type: Optional
}, {
type: Inject,
args: [ChangeDetectorRef]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Inject,
args: [CALL_SET_DISABLED_STATE]
}]
}], {
name: [{
type: Input
}],
isDisabled: [{
type: Input,
args: ["disabled"]
}],
model: [{
type: Input,
args: ["ngModel"]
}],
options: [{
type: Input,
args: ["ngModelOptions"]
}],
update: [{
type: Output,
args: ["ngModelChange"]
}]
});
})();
function checkParentType$1(parent) {
if (!(parent instanceof NgModelGroup) && parent instanceof AbstractFormGroupDirective) {
throw formGroupNameException();
} else if (!(parent instanceof NgModelGroup) && !(parent instanceof NgForm)) {
throw modelParentException();
}
}
var \u0275NgNoValidate = class _\u0275NgNoValidate {
static \u0275fac = function \u0275NgNoValidate_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _\u0275NgNoValidate)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _\u0275NgNoValidate,
selectors: [["form", 3, "ngNoForm", "", 3, "ngNativeValidate", ""]],
hostAttrs: ["novalidate", ""],
standalone: false
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(\u0275NgNoValidate, [{
type: Directive,
args: [{
selector: "form:not([ngNoForm]):not([ngNativeValidate])",
host: {
"novalidate": ""
},
standalone: false
}]
}], null, null);
})();
var NUMBER_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => NumberValueAccessor),
multi: true
};
var NumberValueAccessor = class _NumberValueAccessor extends BuiltInControlValueAccessor {
/**
* Sets the "value" property on the input element.
* @docs-private
*/
writeValue(value) {
const normalizedValue = value == null ? "" : value;
this.setProperty("value", normalizedValue);
}
/**
* Registers a function called when the control value changes.
* @docs-private
*/
registerOnChange(fn) {
this.onChange = (value) => {
fn(value == "" ? null : parseFloat(value));
};
}
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275NumberValueAccessor_BaseFactory;
return function NumberValueAccessor_Factory(__ngFactoryType__) {
return (\u0275NumberValueAccessor_BaseFactory || (\u0275NumberValueAccessor_BaseFactory = \u0275\u0275getInheritedFactory(_NumberValueAccessor)))(__ngFactoryType__ || _NumberValueAccessor);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NumberValueAccessor,
selectors: [["input", "type", "number", "formControlName", ""], ["input", "type", "number", "formControl", ""], ["input", "type", "number", "ngModel", ""]],
hostBindings: function NumberValueAccessor_HostBindings(rf, ctx) {
if (rf & 1) {
\u0275\u0275listener("input", function NumberValueAccessor_input_HostBindingHandler($event) {
return ctx.onChange($event.target.value);
})("blur", function NumberValueAccessor_blur_HostBindingHandler() {
return ctx.onTouched();
});
}
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([NUMBER_VALUE_ACCESSOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NumberValueAccessor, [{
type: Directive,
args: [{
selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]",
host: {
"(input)": "onChange($any($event.target).value)",
"(blur)": "onTouched()"
},
providers: [NUMBER_VALUE_ACCESSOR],
standalone: false
}]
}], null, null);
})();
var RADIO_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => RadioControlValueAccessor),
multi: true
};
function throwNameError() {
throw new RuntimeError(1202, `
If you define both a name and a formControlName attribute on your radio button, their values
must match. Ex: <input type="radio" formControlName="food" name="food">
`);
}
var RadioControlRegistry = class _RadioControlRegistry {
_accessors = [];
/**
* @description
* Adds a control to the internal registry. For internal use only.
*/
add(control, accessor) {
this._accessors.push([control, accessor]);
}
/**
* @description
* Removes a control from the internal registry. For internal use only.
*/
remove(accessor) {
for (let i = this._accessors.length - 1; i >= 0; --i) {
if (this._accessors[i][1] === accessor) {
this._accessors.splice(i, 1);
return;
}
}
}
/**
* @description
* Selects a radio button. For internal use only.
*/
select(accessor) {
this._accessors.forEach((c) => {
if (this._isSameGroup(c, accessor) && c[1] !== accessor) {
c[1].fireUncheck(accessor.value);
}
});
}
_isSameGroup(controlPair, accessor) {
if (!controlPair[0].control) return false;
return controlPair[0]._parent === accessor._control._parent && controlPair[1].name === accessor.name;
}
static \u0275fac = function RadioControlRegistry_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _RadioControlRegistry)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _RadioControlRegistry,
factory: _RadioControlRegistry.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(RadioControlRegistry, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], null, null);
})();
var RadioControlValueAccessor = class _RadioControlValueAccessor extends BuiltInControlValueAccessor {
_registry;
_injector;
/** @internal */
_state;
/** @internal */
_control;
/** @internal */
_fn;
setDisabledStateFired = false;
/**
* The registered callback function called when a change event occurs on the input element.
* Note: we declare `onChange` here (also used as host listener) as a function with no arguments
* to override the `onChange` function (which expects 1 argument) in the parent
* `BaseControlValueAccessor` class.
* @docs-private
*/
onChange = () => {
};
/**
* @description
* Tracks the name of the radio input element.
*/
name;
/**
* @description
* Tracks the name of the `FormControl` bound to the directive. The name corresponds
* to a key in the parent `FormGroup` or `FormArray`.
*/
formControlName;
/**
* @description
* Tracks the value of the radio input element
*/
value;
callSetDisabledState = inject2(CALL_SET_DISABLED_STATE, {
optional: true
}) ?? setDisabledStateDefault;
constructor(renderer, elementRef, _registry, _injector) {
super(renderer, elementRef);
this._registry = _registry;
this._injector = _injector;
}
/** @docs-private */
ngOnInit() {
this._control = this._injector.get(NgControl);
this._checkName();
this._registry.add(this._control, this);
}
/** @docs-private */
ngOnDestroy() {
this._registry.remove(this);
}
/**
* Sets the "checked" property value on the radio input element.
* @docs-private
*/
writeValue(value) {
this._state = value === this.value;
this.setProperty("checked", this._state);
}
/**
* Registers a function called when the control value changes.
* @docs-private
*/
registerOnChange(fn) {
this._fn = fn;
this.onChange = () => {
fn(this.value);
this._registry.select(this);
};
}
/** @docs-private */
setDisabledState(isDisabled) {
if (this.setDisabledStateFired || isDisabled || this.callSetDisabledState === "whenDisabledForLegacyCode") {
this.setProperty("disabled", isDisabled);
}
this.setDisabledStateFired = true;
}
/**
* Sets the "value" on the radio input element and unchecks it.
*
* @param value
*/
fireUncheck(value) {
this.writeValue(value);
}
_checkName() {
if (this.name && this.formControlName && this.name !== this.formControlName && (typeof ngDevMode === "undefined" || ngDevMode)) {
throwNameError();
}
if (!this.name && this.formControlName) this.name = this.formControlName;
}
static \u0275fac = function RadioControlValueAccessor_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _RadioControlValueAccessor)(\u0275\u0275directiveInject(Renderer2), \u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(RadioControlRegistry), \u0275\u0275directiveInject(Injector));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _RadioControlValueAccessor,
selectors: [["input", "type", "radio", "formControlName", ""], ["input", "type", "radio", "formControl", ""], ["input", "type", "radio", "ngModel", ""]],
hostBindings: function RadioControlValueAccessor_HostBindings(rf, ctx) {
if (rf & 1) {
\u0275\u0275listener("change", function RadioControlValueAccessor_change_HostBindingHandler() {
return ctx.onChange();
})("blur", function RadioControlValueAccessor_blur_HostBindingHandler() {
return ctx.onTouched();
});
}
},
inputs: {
name: "name",
formControlName: "formControlName",
value: "value"
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([RADIO_VALUE_ACCESSOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(RadioControlValueAccessor, [{
type: Directive,
args: [{
selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]",
host: {
"(change)": "onChange()",
"(blur)": "onTouched()"
},
providers: [RADIO_VALUE_ACCESSOR],
standalone: false
}]
}], () => [{
type: Renderer2
}, {
type: ElementRef
}, {
type: RadioControlRegistry
}, {
type: Injector
}], {
name: [{
type: Input
}],
formControlName: [{
type: Input
}],
value: [{
type: Input
}]
});
})();
var RANGE_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => RangeValueAccessor),
multi: true
};
var RangeValueAccessor = class _RangeValueAccessor extends BuiltInControlValueAccessor {
/**
* Sets the "value" property on the input element.
* @docs-private
*/
writeValue(value) {
this.setProperty("value", parseFloat(value));
}
/**
* Registers a function called when the control value changes.
* @docs-private
*/
registerOnChange(fn) {
this.onChange = (value) => {
fn(value == "" ? null : parseFloat(value));
};
}
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275RangeValueAccessor_BaseFactory;
return function RangeValueAccessor_Factory(__ngFactoryType__) {
return (\u0275RangeValueAccessor_BaseFactory || (\u0275RangeValueAccessor_BaseFactory = \u0275\u0275getInheritedFactory(_RangeValueAccessor)))(__ngFactoryType__ || _RangeValueAccessor);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _RangeValueAccessor,
selectors: [["input", "type", "range", "formControlName", ""], ["input", "type", "range", "formControl", ""], ["input", "type", "range", "ngModel", ""]],
hostBindings: function RangeValueAccessor_HostBindings(rf, ctx) {
if (rf & 1) {
\u0275\u0275listener("change", function RangeValueAccessor_change_HostBindingHandler($event) {
return ctx.onChange($event.target.value);
})("input", function RangeValueAccessor_input_HostBindingHandler($event) {
return ctx.onChange($event.target.value);
})("blur", function RangeValueAccessor_blur_HostBindingHandler() {
return ctx.onTouched();
});
}
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([RANGE_VALUE_ACCESSOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(RangeValueAccessor, [{
type: Directive,
args: [{
selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]",
host: {
"(change)": "onChange($any($event.target).value)",
"(input)": "onChange($any($event.target).value)",
"(blur)": "onTouched()"
},
providers: [RANGE_VALUE_ACCESSOR],
standalone: false
}]
}], null, null);
})();
var NG_MODEL_WITH_FORM_CONTROL_WARNING = new InjectionToken(ngDevMode ? "NgModelWithFormControlWarning" : "");
var formControlBinding = {
provide: NgControl,
useExisting: forwardRef(() => FormControlDirective)
};
var FormControlDirective = class _FormControlDirective extends NgControl {
_ngModelWarningConfig;
callSetDisabledState;
/**
* Internal reference to the view model value.
* @docs-private
*/
viewModel;
/**
* @description
* Tracks the `FormControl` instance bound to the directive.
*/
form;
/**
* @description
* Triggers a warning in dev mode that this input should not be used with reactive forms.
*/
set isDisabled(isDisabled) {
if (typeof ngDevMode === "undefined" || ngDevMode) {
console.warn(disabledAttrWarning);
}
}
// TODO(kara): remove next 4 properties once deprecation period is over
/** @deprecated as of v6 */
model;
/** @deprecated as of v6 */
update = new EventEmitter();
/**
* @description
* Static property used to track whether any ngModel warnings have been sent across
* all instances of FormControlDirective. Used to support warning config of "once".
*
* @internal
*/
static _ngModelWarningSentOnce = false;
/**
* @description
* Instance property used to track whether an ngModel warning has been sent out for this
* particular `FormControlDirective` instance. Used to support warning config of "always".
*
* @internal
*/
_ngModelWarningSent = false;
constructor(validators, asyncValidators, valueAccessors, _ngModelWarningConfig, callSetDisabledState) {
super();
this._ngModelWarningConfig = _ngModelWarningConfig;
this.callSetDisabledState = callSetDisabledState;
this._setValidators(validators);
this._setAsyncValidators(asyncValidators);
this.valueAccessor = selectValueAccessor(this, valueAccessors);
}
/** @docs-private */
ngOnChanges(changes) {
if (this._isControlChanged(changes)) {
const previousForm = changes["form"].previousValue;
if (previousForm) {
cleanUpControl(
previousForm,
this,
/* validateControlPresenceOnChange */
false
);
}
setUpControl(this.form, this, this.callSetDisabledState);
this.form.updateValueAndValidity({
emitEvent: false
});
}
if (isPropertyUpdated(changes, this.viewModel)) {
if (typeof ngDevMode === "undefined" || ngDevMode) {
_ngModelWarning("formControl", _FormControlDirective, this, this._ngModelWarningConfig);
}
this.form.setValue(this.model);
this.viewModel = this.model;
}
}
/** @docs-private */
ngOnDestroy() {
if (this.form) {
cleanUpControl(
this.form,
this,
/* validateControlPresenceOnChange */
false
);
}
}
/**
* @description
* Returns an array that represents the path from the top-level form to this control.
* Each index is the string name of the control on that level.
*/
get path() {
return [];
}
/**
* @description
* The `FormControl` bound to this directive.
*/
get control() {
return this.form;
}
/**
* @description
* Sets the new value for the view model and emits an `ngModelChange` event.
*
* @param newValue The new value for the view model.
*/
viewToModelUpdate(newValue) {
this.viewModel = newValue;
this.update.emit(newValue);
}
_isControlChanged(changes) {
return changes.hasOwnProperty("form");
}
static \u0275fac = function FormControlDirective_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _FormControlDirective)(\u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10), \u0275\u0275directiveInject(NG_VALUE_ACCESSOR, 10), \u0275\u0275directiveInject(NG_MODEL_WITH_FORM_CONTROL_WARNING, 8), \u0275\u0275directiveInject(CALL_SET_DISABLED_STATE, 8));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _FormControlDirective,
selectors: [["", "formControl", ""]],
inputs: {
form: [0, "formControl", "form"],
isDisabled: [0, "disabled", "isDisabled"],
model: [0, "ngModel", "model"]
},
outputs: {
update: "ngModelChange"
},
exportAs: ["ngForm"],
standalone: false,
features: [\u0275\u0275ProvidersFeature([formControlBinding]), \u0275\u0275InheritDefinitionFeature, \u0275\u0275NgOnChangesFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormControlDirective, [{
type: Directive,
args: [{
selector: "[formControl]",
providers: [formControlBinding],
exportAs: "ngForm",
standalone: false
}]
}], () => [{
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_VALIDATORS]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_ASYNC_VALIDATORS]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_VALUE_ACCESSOR]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Inject,
args: [NG_MODEL_WITH_FORM_CONTROL_WARNING]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Inject,
args: [CALL_SET_DISABLED_STATE]
}]
}], {
form: [{
type: Input,
args: ["formControl"]
}],
isDisabled: [{
type: Input,
args: ["disabled"]
}],
model: [{
type: Input,
args: ["ngModel"]
}],
update: [{
type: Output,
args: ["ngModelChange"]
}]
});
})();
var formDirectiveProvider = {
provide: ControlContainer,
useExisting: forwardRef(() => FormGroupDirective)
};
var FormGroupDirective = class _FormGroupDirective extends ControlContainer {
callSetDisabledState;
/**
* @description
* Reports whether the form submission has been triggered.
*/
get submitted() {
return untracked2(this._submittedReactive);
}
// TODO(atscott): Remove once invalid API usage is cleaned up internally
set submitted(value) {
this._submittedReactive.set(value);
}
/** @internal */
_submitted = computed(() => this._submittedReactive(), ...ngDevMode ? [{
debugName: "_submitted"
}] : []);
_submittedReactive = signal(false, ...ngDevMode ? [{
debugName: "_submittedReactive"
}] : []);
/**
* Reference to an old form group input value, which is needed to cleanup
* old instance in case it was replaced with a new one.
*/
_oldForm;
/**
* Callback that should be invoked when controls in FormGroup or FormArray collection change
* (added or removed). This callback triggers corresponding DOM updates.
*/
_onCollectionChange = () => this._updateDomValue();
/**
* @description
* Tracks the list of added `FormControlName` instances
*/
directives = [];
/**
* @description
* Tracks the `FormGroup` bound to this directive.
*/
form = null;
/**
* @description
* Emits an event when the form submission has been triggered.
*/
ngSubmit = new EventEmitter();
constructor(validators, asyncValidators, callSetDisabledState) {
super();
this.callSetDisabledState = callSetDisabledState;
this._setValidators(validators);
this._setAsyncValidators(asyncValidators);
}
/** @docs-private */
ngOnChanges(changes) {
if ((typeof ngDevMode === "undefined" || ngDevMode) && !this.form) {
throw missingFormException();
}
if (changes.hasOwnProperty("form")) {
this._updateValidators();
this._updateDomValue();
this._updateRegistrations();
this._oldForm = this.form;
}
}
/** @docs-private */
ngOnDestroy() {
if (this.form) {
cleanUpValidators(this.form, this);
if (this.form._onCollectionChange === this._onCollectionChange) {
this.form._registerOnCollectionChange(() => {
});
}
}
}
/**
* @description
* Returns this directive's instance.
*/
get formDirective() {
return this;
}
/**
* @description
* Returns the `FormGroup` bound to this directive.
*/
get control() {
return this.form;
}
/**
* @description
* Returns an array representing the path to this group. Because this directive
* always lives at the top level of a form, it always an empty array.
*/
get path() {
return [];
}
/**
* @description
* Method that sets up the control directive in this group, re-calculates its value
* and validity, and adds the instance to the internal list of directives.
*
* @param dir The `FormControlName` directive instance.
*/
addControl(dir) {
const ctrl = this.form.get(dir.path);
setUpControl(ctrl, dir, this.callSetDisabledState);
ctrl.updateValueAndValidity({
emitEvent: false
});
this.directives.push(dir);
return ctrl;
}
/**
* @description
* Retrieves the `FormControl` instance from the provided `FormControlName` directive
*
* @param dir The `FormControlName` directive instance.
*/
getControl(dir) {
return this.form.get(dir.path);
}
/**
* @description
* Removes the `FormControlName` instance from the internal list of directives
*
* @param dir The `FormControlName` directive instance.
*/
removeControl(dir) {
cleanUpControl(
dir.control || null,
dir,
/* validateControlPresenceOnChange */
false
);
removeListItem$1(this.directives, dir);
}
/**
* Adds a new `FormGroupName` directive instance to the form.
*
* @param dir The `FormGroupName` directive instance.
*/
addFormGroup(dir) {
this._setUpFormContainer(dir);
}
/**
* Performs the necessary cleanup when a `FormGroupName` directive instance is removed from the
* view.
*
* @param dir The `FormGroupName` directive instance.
*/
removeFormGroup(dir) {
this._cleanUpFormContainer(dir);
}
/**
* @description
* Retrieves the `FormGroup` for a provided `FormGroupName` directive instance
*
* @param dir The `FormGroupName` directive instance.
*/
getFormGroup(dir) {
return this.form.get(dir.path);
}
/**
* Performs the necessary setup when a `FormArrayName` directive instance is added to the view.
*
* @param dir The `FormArrayName` directive instance.
*/
addFormArray(dir) {
this._setUpFormContainer(dir);
}
/**
* Performs the necessary cleanup when a `FormArrayName` directive instance is removed from the
* view.
*
* @param dir The `FormArrayName` directive instance.
*/
removeFormArray(dir) {
this._cleanUpFormContainer(dir);
}
/**
* @description
* Retrieves the `FormArray` for a provided `FormArrayName` directive instance.
*
* @param dir The `FormArrayName` directive instance.
*/
getFormArray(dir) {
return this.form.get(dir.path);
}
/**
* Sets the new value for the provided `FormControlName` directive.
*
* @param dir The `FormControlName` directive instance.
* @param value The new value for the directive's control.
*/
updateModel(dir, value) {
const ctrl = this.form.get(dir.path);
ctrl.setValue(value);
}
/**
* @description
* Method called with the "submit" event is triggered on the form.
* Triggers the `ngSubmit` emitter to emit the "submit" event as its payload.
*
* @param $event The "submit" event object
*/
onSubmit($event) {
this._submittedReactive.set(true);
syncPendingControls(this.form, this.directives);
this.ngSubmit.emit($event);
this.form._events.next(new FormSubmittedEvent(this.control));
return $event?.target?.method === "dialog";
}
/**
* @description
* Method called when the "reset" event is triggered on the form.
*/
onReset() {
this.resetForm();
}
/**
* @description
* Resets the form to an initial value and resets its submitted status.
*
* @param value The new value for the form, `undefined` by default
*/
resetForm(value = void 0, options = {}) {
this.form.reset(value, options);
this._submittedReactive.set(false);
if (options?.emitEvent !== false) {
this.form._events.next(new FormResetEvent(this.form));
}
}
/** @internal */
_updateDomValue() {
this.directives.forEach((dir) => {
const oldCtrl = dir.control;
const newCtrl = this.form.get(dir.path);
if (oldCtrl !== newCtrl) {
cleanUpControl(oldCtrl || null, dir);
if (isFormControl(newCtrl)) {
setUpControl(newCtrl, dir, this.callSetDisabledState);
dir.control = newCtrl;
}
}
});
this.form._updateTreeValidity({
emitEvent: false
});
}
_setUpFormContainer(dir) {
const ctrl = this.form.get(dir.path);
setUpFormContainer(ctrl, dir);
ctrl.updateValueAndValidity({
emitEvent: false
});
}
_cleanUpFormContainer(dir) {
if (this.form) {
const ctrl = this.form.get(dir.path);
if (ctrl) {
const isControlUpdated = cleanUpFormContainer(ctrl, dir);
if (isControlUpdated) {
ctrl.updateValueAndValidity({
emitEvent: false
});
}
}
}
}
_updateRegistrations() {
this.form._registerOnCollectionChange(this._onCollectionChange);
if (this._oldForm) {
this._oldForm._registerOnCollectionChange(() => {
});
}
}
_updateValidators() {
setUpValidators(this.form, this);
if (this._oldForm) {
cleanUpValidators(this._oldForm, this);
}
}
static \u0275fac = function FormGroupDirective_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _FormGroupDirective)(\u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10), \u0275\u0275directiveInject(CALL_SET_DISABLED_STATE, 8));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _FormGroupDirective,
selectors: [["", "formGroup", ""]],
hostBindings: function FormGroupDirective_HostBindings(rf, ctx) {
if (rf & 1) {
\u0275\u0275listener("submit", function FormGroupDirective_submit_HostBindingHandler($event) {
return ctx.onSubmit($event);
})("reset", function FormGroupDirective_reset_HostBindingHandler() {
return ctx.onReset();
});
}
},
inputs: {
form: [0, "formGroup", "form"]
},
outputs: {
ngSubmit: "ngSubmit"
},
exportAs: ["ngForm"],
standalone: false,
features: [\u0275\u0275ProvidersFeature([formDirectiveProvider]), \u0275\u0275InheritDefinitionFeature, \u0275\u0275NgOnChangesFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormGroupDirective, [{
type: Directive,
args: [{
selector: "[formGroup]",
providers: [formDirectiveProvider],
host: {
"(submit)": "onSubmit($event)",
"(reset)": "onReset()"
},
exportAs: "ngForm",
standalone: false
}]
}], () => [{
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_VALIDATORS]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_ASYNC_VALIDATORS]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Inject,
args: [CALL_SET_DISABLED_STATE]
}]
}], {
form: [{
type: Input,
args: ["formGroup"]
}],
ngSubmit: [{
type: Output
}]
});
})();
var formGroupNameProvider = {
provide: ControlContainer,
useExisting: forwardRef(() => FormGroupName)
};
var FormGroupName = class _FormGroupName extends AbstractFormGroupDirective {
/**
* @description
* Tracks the name of the `FormGroup` bound to the directive. The name corresponds
* to a key in the parent `FormGroup` or `FormArray`.
* Accepts a name as a string or a number.
* The name in the form of a string is useful for individual forms,
* while the numerical form allows for form groups to be bound
* to indices when iterating over groups in a `FormArray`.
*/
name = null;
constructor(parent, validators, asyncValidators) {
super();
this._parent = parent;
this._setValidators(validators);
this._setAsyncValidators(asyncValidators);
}
/** @internal */
_checkParentType() {
if (hasInvalidParent(this._parent) && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw groupParentException();
}
}
static \u0275fac = function FormGroupName_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _FormGroupName)(\u0275\u0275directiveInject(ControlContainer, 13), \u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _FormGroupName,
selectors: [["", "formGroupName", ""]],
inputs: {
name: [0, "formGroupName", "name"]
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([formGroupNameProvider]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormGroupName, [{
type: Directive,
args: [{
selector: "[formGroupName]",
providers: [formGroupNameProvider],
standalone: false
}]
}], () => [{
type: ControlContainer,
decorators: [{
type: Optional
}, {
type: Host
}, {
type: SkipSelf
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_VALIDATORS]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_ASYNC_VALIDATORS]
}]
}], {
name: [{
type: Input,
args: ["formGroupName"]
}]
});
})();
var formArrayNameProvider = {
provide: ControlContainer,
useExisting: forwardRef(() => FormArrayName)
};
var FormArrayName = class _FormArrayName extends ControlContainer {
/** @internal */
_parent;
/**
* @description
* Tracks the name of the `FormArray` bound to the directive. The name corresponds
* to a key in the parent `FormGroup` or `FormArray`.
* Accepts a name as a string or a number.
* The name in the form of a string is useful for individual forms,
* while the numerical form allows for form arrays to be bound
* to indices when iterating over arrays in a `FormArray`.
*/
name = null;
constructor(parent, validators, asyncValidators) {
super();
this._parent = parent;
this._setValidators(validators);
this._setAsyncValidators(asyncValidators);
}
/**
* A lifecycle method called when the directive's inputs are initialized. For internal use only.
* @throws If the directive does not have a valid parent.
* @docs-private
*/
ngOnInit() {
if (hasInvalidParent(this._parent) && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw arrayParentException();
}
this.formDirective.addFormArray(this);
}
/**
* A lifecycle method called before the directive's instance is destroyed. For internal use only.
* @docs-private
*/
ngOnDestroy() {
this.formDirective?.removeFormArray(this);
}
/**
* @description
* The `FormArray` bound to this directive.
*/
get control() {
return this.formDirective.getFormArray(this);
}
/**
* @description
* The top-level directive for this group if present, otherwise null.
*/
get formDirective() {
return this._parent ? this._parent.formDirective : null;
}
/**
* @description
* Returns an array that represents the path from the top-level form to this control.
* Each index is the string name of the control on that level.
*/
get path() {
return controlPath(this.name == null ? this.name : this.name.toString(), this._parent);
}
static \u0275fac = function FormArrayName_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _FormArrayName)(\u0275\u0275directiveInject(ControlContainer, 13), \u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _FormArrayName,
selectors: [["", "formArrayName", ""]],
inputs: {
name: [0, "formArrayName", "name"]
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([formArrayNameProvider]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormArrayName, [{
type: Directive,
args: [{
selector: "[formArrayName]",
providers: [formArrayNameProvider],
standalone: false
}]
}], () => [{
type: ControlContainer,
decorators: [{
type: Optional
}, {
type: Host
}, {
type: SkipSelf
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_VALIDATORS]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_ASYNC_VALIDATORS]
}]
}], {
name: [{
type: Input,
args: ["formArrayName"]
}]
});
})();
function hasInvalidParent(parent) {
return !(parent instanceof FormGroupName) && !(parent instanceof FormGroupDirective) && !(parent instanceof FormArrayName);
}
var controlNameBinding = {
provide: NgControl,
useExisting: forwardRef(() => FormControlName)
};
var FormControlName = class _FormControlName extends NgControl {
_ngModelWarningConfig;
_added = false;
/**
* Internal reference to the view model value.
* @internal
*/
viewModel;
/**
* @description
* Tracks the `FormControl` instance bound to the directive.
*/
control;
/**
* @description
* Tracks the name of the `FormControl` bound to the directive. The name corresponds
* to a key in the parent `FormGroup` or `FormArray`.
* Accepts a name as a string or a number.
* The name in the form of a string is useful for individual forms,
* while the numerical form allows for form controls to be bound
* to indices when iterating over controls in a `FormArray`.
*/
name = null;
/**
* @description
* Triggers a warning in dev mode that this input should not be used with reactive forms.
*/
set isDisabled(isDisabled) {
if (typeof ngDevMode === "undefined" || ngDevMode) {
console.warn(disabledAttrWarning);
}
}
// TODO(kara): remove next 4 properties once deprecation period is over
/** @deprecated as of v6 */
model;
/** @deprecated as of v6 */
update = new EventEmitter();
/**
* @description
* Static property used to track whether any ngModel warnings have been sent across
* all instances of FormControlName. Used to support warning config of "once".
*
* @internal
*/
static _ngModelWarningSentOnce = false;
/**
* @description
* Instance property used to track whether an ngModel warning has been sent out for this
* particular FormControlName instance. Used to support warning config of "always".
*
* @internal
*/
_ngModelWarningSent = false;
constructor(parent, validators, asyncValidators, valueAccessors, _ngModelWarningConfig) {
super();
this._ngModelWarningConfig = _ngModelWarningConfig;
this._parent = parent;
this._setValidators(validators);
this._setAsyncValidators(asyncValidators);
this.valueAccessor = selectValueAccessor(this, valueAccessors);
}
/** @docs-private */
ngOnChanges(changes) {
if (!this._added) this._setUpControl();
if (isPropertyUpdated(changes, this.viewModel)) {
if (typeof ngDevMode === "undefined" || ngDevMode) {
_ngModelWarning("formControlName", _FormControlName, this, this._ngModelWarningConfig);
}
this.viewModel = this.model;
this.formDirective.updateModel(this, this.model);
}
}
/** @docs-private */
ngOnDestroy() {
if (this.formDirective) {
this.formDirective.removeControl(this);
}
}
/**
* @description
* Sets the new value for the view model and emits an `ngModelChange` event.
*
* @param newValue The new value for the view model.
*/
viewToModelUpdate(newValue) {
this.viewModel = newValue;
this.update.emit(newValue);
}
/**
* @description
* Returns an array that represents the path from the top-level form to this control.
* Each index is the string name of the control on that level.
*/
get path() {
return controlPath(this.name == null ? this.name : this.name.toString(), this._parent);
}
/**
* @description
* The top-level directive for this group if present, otherwise null.
*/
get formDirective() {
return this._parent ? this._parent.formDirective : null;
}
_setUpControl() {
if (typeof ngDevMode === "undefined" || ngDevMode) {
checkParentType(this._parent, this.name);
}
this.control = this.formDirective.addControl(this);
this._added = true;
}
static \u0275fac = function FormControlName_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _FormControlName)(\u0275\u0275directiveInject(ControlContainer, 13), \u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10), \u0275\u0275directiveInject(NG_VALUE_ACCESSOR, 10), \u0275\u0275directiveInject(NG_MODEL_WITH_FORM_CONTROL_WARNING, 8));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _FormControlName,
selectors: [["", "formControlName", ""]],
inputs: {
name: [0, "formControlName", "name"],
isDisabled: [0, "disabled", "isDisabled"],
model: [0, "ngModel", "model"]
},
outputs: {
update: "ngModelChange"
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([controlNameBinding]), \u0275\u0275InheritDefinitionFeature, \u0275\u0275NgOnChangesFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormControlName, [{
type: Directive,
args: [{
selector: "[formControlName]",
providers: [controlNameBinding],
standalone: false
}]
}], () => [{
type: ControlContainer,
decorators: [{
type: Optional
}, {
type: Host
}, {
type: SkipSelf
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_VALIDATORS]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_ASYNC_VALIDATORS]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Self
}, {
type: Inject,
args: [NG_VALUE_ACCESSOR]
}]
}, {
type: void 0,
decorators: [{
type: Optional
}, {
type: Inject,
args: [NG_MODEL_WITH_FORM_CONTROL_WARNING]
}]
}], {
name: [{
type: Input,
args: ["formControlName"]
}],
isDisabled: [{
type: Input,
args: ["disabled"]
}],
model: [{
type: Input,
args: ["ngModel"]
}],
update: [{
type: Output,
args: ["ngModelChange"]
}]
});
})();
function checkParentType(parent, name) {
if (!(parent instanceof FormGroupName) && parent instanceof AbstractFormGroupDirective) {
throw ngModelGroupException();
} else if (!(parent instanceof FormGroupName) && !(parent instanceof FormGroupDirective) && !(parent instanceof FormArrayName)) {
throw controlParentException(name);
}
}
var SELECT_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => SelectControlValueAccessor),
multi: true
};
function _buildValueString$1(id, value) {
if (id == null) return `${value}`;
if (value && typeof value === "object") value = "Object";
return `${id}: ${value}`.slice(0, 50);
}
function _extractId$1(valueString) {
return valueString.split(":")[0];
}
var SelectControlValueAccessor = class _SelectControlValueAccessor extends BuiltInControlValueAccessor {
/** @docs-private */
value;
/** @internal */
_optionMap = /* @__PURE__ */ new Map();
/** @internal */
_idCounter = 0;
/**
* @description
* Tracks the option comparison algorithm for tracking identities when
* checking for changes.
*/
set compareWith(fn) {
if (typeof fn !== "function" && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw new RuntimeError(1201, `compareWith must be a function, but received ${JSON.stringify(fn)}`);
}
this._compareWith = fn;
}
_compareWith = Object.is;
// We need this because we might be in the process of destroying the root
// injector, which is marked as destroyed before running destroy hooks.
// Attempting to use afterNextRender with the node injector would evntually
// run into that already destroyed injector.
appRefInjector = inject2(ApplicationRef).injector;
destroyRef = inject2(DestroyRef);
cdr = inject2(ChangeDetectorRef);
_queuedWrite = false;
/**
* This is needed to efficiently set the select value when adding/removing options. If
* writeValue is instead called for every added/removed option, this results in exponentially
* more _compareValue calls than the number of option elements (issue #41330).
*
* Secondly, calling writeValue when rendering individual option elements instead of after they
* are all rendered caused an issue in Safari and IE 11 where the first option element failed
* to be deselected when no option matched the select ngModel. This was because Angular would
* set the select element's value property before appending the option's child text node to the
* DOM (issue #14505).
*
* Finally, this approach is necessary to avoid an issue with delayed element removal when
* using the animations module (in all browsers). Otherwise when a selected option is removed
* (so no option matches the ngModel anymore), Angular would change the select element value
* before actually removing the option from the DOM. Then when the option is finally removed
* from the DOM, the browser would change the select value to that of the first option, even
* though it doesn't match the ngModel (issue #18430).
*
* @internal
*/
_writeValueAfterRender() {
if (this._queuedWrite || this.appRefInjector.destroyed) {
return;
}
this._queuedWrite = true;
afterNextRender({
write: () => {
if (this.destroyRef.destroyed) {
return;
}
this._queuedWrite = false;
this.writeValue(this.value);
}
}, {
injector: this.appRefInjector
});
}
/**
* Sets the "value" property on the select element.
* @docs-private
*/
writeValue(value) {
this.cdr.markForCheck();
this.value = value;
const id = this._getOptionId(value);
const valueString = _buildValueString$1(id, value);
this.setProperty("value", valueString);
}
/**
* Registers a function called when the control value changes.
* @docs-private
*/
registerOnChange(fn) {
this.onChange = (valueString) => {
this.value = this._getOptionValue(valueString);
fn(this.value);
};
}
/** @internal */
_registerOption() {
return (this._idCounter++).toString();
}
/** @internal */
_getOptionId(value) {
for (const id of this._optionMap.keys()) {
if (this._compareWith(this._optionMap.get(id), value)) return id;
}
return null;
}
/** @internal */
_getOptionValue(valueString) {
const id = _extractId$1(valueString);
return this._optionMap.has(id) ? this._optionMap.get(id) : valueString;
}
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275SelectControlValueAccessor_BaseFactory;
return function SelectControlValueAccessor_Factory(__ngFactoryType__) {
return (\u0275SelectControlValueAccessor_BaseFactory || (\u0275SelectControlValueAccessor_BaseFactory = \u0275\u0275getInheritedFactory(_SelectControlValueAccessor)))(__ngFactoryType__ || _SelectControlValueAccessor);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _SelectControlValueAccessor,
selectors: [["select", "formControlName", "", 3, "multiple", ""], ["select", "formControl", "", 3, "multiple", ""], ["select", "ngModel", "", 3, "multiple", ""]],
hostBindings: function SelectControlValueAccessor_HostBindings(rf, ctx) {
if (rf & 1) {
\u0275\u0275listener("change", function SelectControlValueAccessor_change_HostBindingHandler($event) {
return ctx.onChange($event.target.value);
})("blur", function SelectControlValueAccessor_blur_HostBindingHandler() {
return ctx.onTouched();
});
}
},
inputs: {
compareWith: "compareWith"
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([SELECT_VALUE_ACCESSOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SelectControlValueAccessor, [{
type: Directive,
args: [{
selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",
host: {
"(change)": "onChange($any($event.target).value)",
"(blur)": "onTouched()"
},
providers: [SELECT_VALUE_ACCESSOR],
standalone: false
}]
}], null, {
compareWith: [{
type: Input
}]
});
})();
var NgSelectOption = class _NgSelectOption {
_element;
_renderer;
_select;
/**
* @description
* ID of the option element
*/
id;
constructor(_element, _renderer, _select) {
this._element = _element;
this._renderer = _renderer;
this._select = _select;
if (this._select) this.id = this._select._registerOption();
}
/**
* @description
* Tracks the value bound to the option element. Unlike the value binding,
* ngValue supports binding to objects.
*/
set ngValue(value) {
if (this._select == null) return;
this._select._optionMap.set(this.id, value);
this._setElementValue(_buildValueString$1(this.id, value));
this._select._writeValueAfterRender();
}
/**
* @description
* Tracks simple string values bound to the option element.
* For objects, use the `ngValue` input binding.
*/
set value(value) {
this._setElementValue(value);
if (this._select) this._select._writeValueAfterRender();
}
/** @internal */
_setElementValue(value) {
this._renderer.setProperty(this._element.nativeElement, "value", value);
}
/** @docs-private */
ngOnDestroy() {
if (this._select) {
this._select._optionMap.delete(this.id);
this._select._writeValueAfterRender();
}
}
static \u0275fac = function NgSelectOption_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NgSelectOption)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Renderer2), \u0275\u0275directiveInject(SelectControlValueAccessor, 9));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _NgSelectOption,
selectors: [["option"]],
inputs: {
ngValue: "ngValue",
value: "value"
},
standalone: false
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSelectOption, [{
type: Directive,
args: [{
selector: "option",
standalone: false
}]
}], () => [{
type: ElementRef
}, {
type: Renderer2
}, {
type: SelectControlValueAccessor,
decorators: [{
type: Optional
}, {
type: Host
}]
}], {
ngValue: [{
type: Input,
args: ["ngValue"]
}],
value: [{
type: Input,
args: ["value"]
}]
});
})();
var SELECT_MULTIPLE_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => SelectMultipleControlValueAccessor),
multi: true
};
function _buildValueString(id, value) {
if (id == null) return `${value}`;
if (typeof value === "string") value = `'${value}'`;
if (value && typeof value === "object") value = "Object";
return `${id}: ${value}`.slice(0, 50);
}
function _extractId(valueString) {
return valueString.split(":")[0];
}
var SelectMultipleControlValueAccessor = class _SelectMultipleControlValueAccessor extends BuiltInControlValueAccessor {
/**
* The current value.
* @docs-private
*/
value;
/** @internal */
_optionMap = /* @__PURE__ */ new Map();
/** @internal */
_idCounter = 0;
/**
* @description
* Tracks the option comparison algorithm for tracking identities when
* checking for changes.
*/
set compareWith(fn) {
if (typeof fn !== "function" && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw new RuntimeError(1201, `compareWith must be a function, but received ${JSON.stringify(fn)}`);
}
this._compareWith = fn;
}
_compareWith = Object.is;
/**
* Sets the "value" property on one or of more of the select's options.
* @docs-private
*/
writeValue(value) {
this.value = value;
let optionSelectedStateSetter;
if (Array.isArray(value)) {
const ids = value.map((v) => this._getOptionId(v));
optionSelectedStateSetter = (opt, o) => {
opt._setSelected(ids.indexOf(o.toString()) > -1);
};
} else {
optionSelectedStateSetter = (opt, o) => {
opt._setSelected(false);
};
}
this._optionMap.forEach(optionSelectedStateSetter);
}
/**
* Registers a function called when the control value changes
* and writes an array of the selected options.
* @docs-private
*/
registerOnChange(fn) {
this.onChange = (element) => {
const selected = [];
const selectedOptions = element.selectedOptions;
if (selectedOptions !== void 0) {
const options = selectedOptions;
for (let i = 0; i < options.length; i++) {
const opt = options[i];
const val = this._getOptionValue(opt.value);
selected.push(val);
}
} else {
const options = element.options;
for (let i = 0; i < options.length; i++) {
const opt = options[i];
if (opt.selected) {
const val = this._getOptionValue(opt.value);
selected.push(val);
}
}
}
this.value = selected;
fn(selected);
};
}
/** @internal */
_registerOption(value) {
const id = (this._idCounter++).toString();
this._optionMap.set(id, value);
return id;
}
/** @internal */
_getOptionId(value) {
for (const id of this._optionMap.keys()) {
if (this._compareWith(this._optionMap.get(id)._value, value)) return id;
}
return null;
}
/** @internal */
_getOptionValue(valueString) {
const id = _extractId(valueString);
return this._optionMap.has(id) ? this._optionMap.get(id)._value : valueString;
}
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275SelectMultipleControlValueAccessor_BaseFactory;
return function SelectMultipleControlValueAccessor_Factory(__ngFactoryType__) {
return (\u0275SelectMultipleControlValueAccessor_BaseFactory || (\u0275SelectMultipleControlValueAccessor_BaseFactory = \u0275\u0275getInheritedFactory(_SelectMultipleControlValueAccessor)))(__ngFactoryType__ || _SelectMultipleControlValueAccessor);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _SelectMultipleControlValueAccessor,
selectors: [["select", "multiple", "", "formControlName", ""], ["select", "multiple", "", "formControl", ""], ["select", "multiple", "", "ngModel", ""]],
hostBindings: function SelectMultipleControlValueAccessor_HostBindings(rf, ctx) {
if (rf & 1) {
\u0275\u0275listener("change", function SelectMultipleControlValueAccessor_change_HostBindingHandler($event) {
return ctx.onChange($event.target);
})("blur", function SelectMultipleControlValueAccessor_blur_HostBindingHandler() {
return ctx.onTouched();
});
}
},
inputs: {
compareWith: "compareWith"
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([SELECT_MULTIPLE_VALUE_ACCESSOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SelectMultipleControlValueAccessor, [{
type: Directive,
args: [{
selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]",
host: {
"(change)": "onChange($event.target)",
"(blur)": "onTouched()"
},
providers: [SELECT_MULTIPLE_VALUE_ACCESSOR],
standalone: false
}]
}], null, {
compareWith: [{
type: Input
}]
});
})();
var \u0275NgSelectMultipleOption = class _\u0275NgSelectMultipleOption {
_element;
_renderer;
_select;
id;
/** @internal */
_value;
constructor(_element, _renderer, _select) {
this._element = _element;
this._renderer = _renderer;
this._select = _select;
if (this._select) {
this.id = this._select._registerOption(this);
}
}
/**
* @description
* Tracks the value bound to the option element. Unlike the value binding,
* ngValue supports binding to objects.
*/
set ngValue(value) {
if (this._select == null) return;
this._value = value;
this._setElementValue(_buildValueString(this.id, value));
this._select.writeValue(this._select.value);
}
/**
* @description
* Tracks simple string values bound to the option element.
* For objects, use the `ngValue` input binding.
*/
set value(value) {
if (this._select) {
this._value = value;
this._setElementValue(_buildValueString(this.id, value));
this._select.writeValue(this._select.value);
} else {
this._setElementValue(value);
}
}
/** @internal */
_setElementValue(value) {
this._renderer.setProperty(this._element.nativeElement, "value", value);
}
/** @internal */
_setSelected(selected) {
this._renderer.setProperty(this._element.nativeElement, "selected", selected);
}
/** @docs-private */
ngOnDestroy() {
if (this._select) {
this._select._optionMap.delete(this.id);
this._select.writeValue(this._select.value);
}
}
static \u0275fac = function \u0275NgSelectMultipleOption_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _\u0275NgSelectMultipleOption)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Renderer2), \u0275\u0275directiveInject(SelectMultipleControlValueAccessor, 9));
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _\u0275NgSelectMultipleOption,
selectors: [["option"]],
inputs: {
ngValue: "ngValue",
value: "value"
},
standalone: false
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(\u0275NgSelectMultipleOption, [{
type: Directive,
args: [{
selector: "option",
standalone: false
}]
}], () => [{
type: ElementRef
}, {
type: Renderer2
}, {
type: SelectMultipleControlValueAccessor,
decorators: [{
type: Optional
}, {
type: Host
}]
}], {
ngValue: [{
type: Input,
args: ["ngValue"]
}],
value: [{
type: Input,
args: ["value"]
}]
});
})();
function toInteger(value) {
return typeof value === "number" ? value : parseInt(value, 10);
}
function toFloat(value) {
return typeof value === "number" ? value : parseFloat(value);
}
var AbstractValidatorDirective = class _AbstractValidatorDirective {
_validator = nullValidator;
_onChange;
/**
* A flag that tracks whether this validator is enabled.
*
* Marking it `internal` (vs `protected`), so that this flag can be used in host bindings of
* directive classes that extend this base class.
* @internal
*/
_enabled;
/** @docs-private */
ngOnChanges(changes) {
if (this.inputName in changes) {
const input2 = this.normalizeInput(changes[this.inputName].currentValue);
this._enabled = this.enabled(input2);
this._validator = this._enabled ? this.createValidator(input2) : nullValidator;
if (this._onChange) {
this._onChange();
}
}
}
/** @docs-private */
validate(control) {
return this._validator(control);
}
/** @docs-private */
registerOnValidatorChange(fn) {
this._onChange = fn;
}
/**
* @description
* Determines whether this validator should be active or not based on an input.
* Base class implementation checks whether an input is defined (if the value is different from
* `null` and `undefined`). Validator classes that extend this base class can override this
* function with the logic specific to a particular validator directive.
*/
enabled(input2) {
return input2 != null;
}
static \u0275fac = function AbstractValidatorDirective_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _AbstractValidatorDirective)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _AbstractValidatorDirective,
features: [\u0275\u0275NgOnChangesFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AbstractValidatorDirective, [{
type: Directive
}], null, null);
})();
var MAX_VALIDATOR = {
provide: NG_VALIDATORS,
useExisting: forwardRef(() => MaxValidator),
multi: true
};
var MaxValidator = class _MaxValidator extends AbstractValidatorDirective {
/**
* @description
* Tracks changes to the max bound to this directive.
*/
max;
/** @internal */
inputName = "max";
/** @internal */
normalizeInput = (input2) => toFloat(input2);
/** @internal */
createValidator = (max) => maxValidator(max);
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275MaxValidator_BaseFactory;
return function MaxValidator_Factory(__ngFactoryType__) {
return (\u0275MaxValidator_BaseFactory || (\u0275MaxValidator_BaseFactory = \u0275\u0275getInheritedFactory(_MaxValidator)))(__ngFactoryType__ || _MaxValidator);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MaxValidator,
selectors: [["input", "type", "number", "max", "", "formControlName", ""], ["input", "type", "number", "max", "", "formControl", ""], ["input", "type", "number", "max", "", "ngModel", ""]],
hostVars: 1,
hostBindings: function MaxValidator_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275attribute("max", ctx._enabled ? ctx.max : null);
}
},
inputs: {
max: "max"
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([MAX_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MaxValidator, [{
type: Directive,
args: [{
selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]",
providers: [MAX_VALIDATOR],
host: {
"[attr.max]": "_enabled ? max : null"
},
standalone: false
}]
}], null, {
max: [{
type: Input
}]
});
})();
var MIN_VALIDATOR = {
provide: NG_VALIDATORS,
useExisting: forwardRef(() => MinValidator),
multi: true
};
var MinValidator = class _MinValidator extends AbstractValidatorDirective {
/**
* @description
* Tracks changes to the min bound to this directive.
*/
min;
/** @internal */
inputName = "min";
/** @internal */
normalizeInput = (input2) => toFloat(input2);
/** @internal */
createValidator = (min) => minValidator(min);
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275MinValidator_BaseFactory;
return function MinValidator_Factory(__ngFactoryType__) {
return (\u0275MinValidator_BaseFactory || (\u0275MinValidator_BaseFactory = \u0275\u0275getInheritedFactory(_MinValidator)))(__ngFactoryType__ || _MinValidator);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MinValidator,
selectors: [["input", "type", "number", "min", "", "formControlName", ""], ["input", "type", "number", "min", "", "formControl", ""], ["input", "type", "number", "min", "", "ngModel", ""]],
hostVars: 1,
hostBindings: function MinValidator_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275attribute("min", ctx._enabled ? ctx.min : null);
}
},
inputs: {
min: "min"
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([MIN_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MinValidator, [{
type: Directive,
args: [{
selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",
providers: [MIN_VALIDATOR],
host: {
"[attr.min]": "_enabled ? min : null"
},
standalone: false
}]
}], null, {
min: [{
type: Input
}]
});
})();
var REQUIRED_VALIDATOR = {
provide: NG_VALIDATORS,
useExisting: forwardRef(() => RequiredValidator),
multi: true
};
var CHECKBOX_REQUIRED_VALIDATOR = {
provide: NG_VALIDATORS,
useExisting: forwardRef(() => CheckboxRequiredValidator),
multi: true
};
var RequiredValidator = class _RequiredValidator extends AbstractValidatorDirective {
/**
* @description
* Tracks changes to the required attribute bound to this directive.
*/
required;
/** @internal */
inputName = "required";
/** @internal */
normalizeInput = booleanAttribute;
/** @internal */
createValidator = (input2) => requiredValidator;
/** @docs-private */
enabled(input2) {
return input2;
}
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275RequiredValidator_BaseFactory;
return function RequiredValidator_Factory(__ngFactoryType__) {
return (\u0275RequiredValidator_BaseFactory || (\u0275RequiredValidator_BaseFactory = \u0275\u0275getInheritedFactory(_RequiredValidator)))(__ngFactoryType__ || _RequiredValidator);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _RequiredValidator,
selectors: [["", "required", "", "formControlName", "", 3, "type", "checkbox"], ["", "required", "", "formControl", "", 3, "type", "checkbox"], ["", "required", "", "ngModel", "", 3, "type", "checkbox"]],
hostVars: 1,
hostBindings: function RequiredValidator_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275attribute("required", ctx._enabled ? "" : null);
}
},
inputs: {
required: "required"
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([REQUIRED_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(RequiredValidator, [{
type: Directive,
args: [{
selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
providers: [REQUIRED_VALIDATOR],
host: {
"[attr.required]": '_enabled ? "" : null'
},
standalone: false
}]
}], null, {
required: [{
type: Input
}]
});
})();
var CheckboxRequiredValidator = class _CheckboxRequiredValidator extends RequiredValidator {
/** @internal */
createValidator = (input2) => requiredTrueValidator;
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275CheckboxRequiredValidator_BaseFactory;
return function CheckboxRequiredValidator_Factory(__ngFactoryType__) {
return (\u0275CheckboxRequiredValidator_BaseFactory || (\u0275CheckboxRequiredValidator_BaseFactory = \u0275\u0275getInheritedFactory(_CheckboxRequiredValidator)))(__ngFactoryType__ || _CheckboxRequiredValidator);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CheckboxRequiredValidator,
selectors: [["input", "type", "checkbox", "required", "", "formControlName", ""], ["input", "type", "checkbox", "required", "", "formControl", ""], ["input", "type", "checkbox", "required", "", "ngModel", ""]],
hostVars: 1,
hostBindings: function CheckboxRequiredValidator_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275attribute("required", ctx._enabled ? "" : null);
}
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([CHECKBOX_REQUIRED_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CheckboxRequiredValidator, [{
type: Directive,
args: [{
selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]",
providers: [CHECKBOX_REQUIRED_VALIDATOR],
host: {
"[attr.required]": '_enabled ? "" : null'
},
standalone: false
}]
}], null, null);
})();
var EMAIL_VALIDATOR = {
provide: NG_VALIDATORS,
useExisting: forwardRef(() => EmailValidator),
multi: true
};
var EmailValidator = class _EmailValidator extends AbstractValidatorDirective {
/**
* @description
* Tracks changes to the email attribute bound to this directive.
*/
email;
/** @internal */
inputName = "email";
/** @internal */
normalizeInput = booleanAttribute;
/** @internal */
createValidator = (input2) => emailValidator;
/** @docs-private */
enabled(input2) {
return input2;
}
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275EmailValidator_BaseFactory;
return function EmailValidator_Factory(__ngFactoryType__) {
return (\u0275EmailValidator_BaseFactory || (\u0275EmailValidator_BaseFactory = \u0275\u0275getInheritedFactory(_EmailValidator)))(__ngFactoryType__ || _EmailValidator);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _EmailValidator,
selectors: [["", "email", "", "formControlName", ""], ["", "email", "", "formControl", ""], ["", "email", "", "ngModel", ""]],
inputs: {
email: "email"
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([EMAIL_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(EmailValidator, [{
type: Directive,
args: [{
selector: "[email][formControlName],[email][formControl],[email][ngModel]",
providers: [EMAIL_VALIDATOR],
standalone: false
}]
}], null, {
email: [{
type: Input
}]
});
})();
var MIN_LENGTH_VALIDATOR = {
provide: NG_VALIDATORS,
useExisting: forwardRef(() => MinLengthValidator),
multi: true
};
var MinLengthValidator = class _MinLengthValidator extends AbstractValidatorDirective {
/**
* @description
* Tracks changes to the minimum length bound to this directive.
*/
minlength;
/** @internal */
inputName = "minlength";
/** @internal */
normalizeInput = (input2) => toInteger(input2);
/** @internal */
createValidator = (minlength) => minLengthValidator(minlength);
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275MinLengthValidator_BaseFactory;
return function MinLengthValidator_Factory(__ngFactoryType__) {
return (\u0275MinLengthValidator_BaseFactory || (\u0275MinLengthValidator_BaseFactory = \u0275\u0275getInheritedFactory(_MinLengthValidator)))(__ngFactoryType__ || _MinLengthValidator);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MinLengthValidator,
selectors: [["", "minlength", "", "formControlName", ""], ["", "minlength", "", "formControl", ""], ["", "minlength", "", "ngModel", ""]],
hostVars: 1,
hostBindings: function MinLengthValidator_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275attribute("minlength", ctx._enabled ? ctx.minlength : null);
}
},
inputs: {
minlength: "minlength"
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([MIN_LENGTH_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MinLengthValidator, [{
type: Directive,
args: [{
selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]",
providers: [MIN_LENGTH_VALIDATOR],
host: {
"[attr.minlength]": "_enabled ? minlength : null"
},
standalone: false
}]
}], null, {
minlength: [{
type: Input
}]
});
})();
var MAX_LENGTH_VALIDATOR = {
provide: NG_VALIDATORS,
useExisting: forwardRef(() => MaxLengthValidator),
multi: true
};
var MaxLengthValidator = class _MaxLengthValidator extends AbstractValidatorDirective {
/**
* @description
* Tracks changes to the maximum length bound to this directive.
*/
maxlength;
/** @internal */
inputName = "maxlength";
/** @internal */
normalizeInput = (input2) => toInteger(input2);
/** @internal */
createValidator = (maxlength) => maxLengthValidator(maxlength);
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275MaxLengthValidator_BaseFactory;
return function MaxLengthValidator_Factory(__ngFactoryType__) {
return (\u0275MaxLengthValidator_BaseFactory || (\u0275MaxLengthValidator_BaseFactory = \u0275\u0275getInheritedFactory(_MaxLengthValidator)))(__ngFactoryType__ || _MaxLengthValidator);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MaxLengthValidator,
selectors: [["", "maxlength", "", "formControlName", ""], ["", "maxlength", "", "formControl", ""], ["", "maxlength", "", "ngModel", ""]],
hostVars: 1,
hostBindings: function MaxLengthValidator_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275attribute("maxlength", ctx._enabled ? ctx.maxlength : null);
}
},
inputs: {
maxlength: "maxlength"
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([MAX_LENGTH_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MaxLengthValidator, [{
type: Directive,
args: [{
selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",
providers: [MAX_LENGTH_VALIDATOR],
host: {
"[attr.maxlength]": "_enabled ? maxlength : null"
},
standalone: false
}]
}], null, {
maxlength: [{
type: Input
}]
});
})();
var PATTERN_VALIDATOR = {
provide: NG_VALIDATORS,
useExisting: forwardRef(() => PatternValidator),
multi: true
};
var PatternValidator = class _PatternValidator extends AbstractValidatorDirective {
/**
* @description
* Tracks changes to the pattern bound to this directive.
*/
pattern;
// This input is always defined, since the name matches selector.
/** @internal */
inputName = "pattern";
/** @internal */
normalizeInput = (input2) => input2;
/** @internal */
createValidator = (input2) => patternValidator(input2);
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275PatternValidator_BaseFactory;
return function PatternValidator_Factory(__ngFactoryType__) {
return (\u0275PatternValidator_BaseFactory || (\u0275PatternValidator_BaseFactory = \u0275\u0275getInheritedFactory(_PatternValidator)))(__ngFactoryType__ || _PatternValidator);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _PatternValidator,
selectors: [["", "pattern", "", "formControlName", ""], ["", "pattern", "", "formControl", ""], ["", "pattern", "", "ngModel", ""]],
hostVars: 1,
hostBindings: function PatternValidator_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275attribute("pattern", ctx._enabled ? ctx.pattern : null);
}
},
inputs: {
pattern: "pattern"
},
standalone: false,
features: [\u0275\u0275ProvidersFeature([PATTERN_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PatternValidator, [{
type: Directive,
args: [{
selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",
providers: [PATTERN_VALIDATOR],
host: {
"[attr.pattern]": "_enabled ? pattern : null"
},
standalone: false
}]
}], null, {
pattern: [{
type: Input
}]
});
})();
var SHARED_FORM_DIRECTIVES = [\u0275NgNoValidate, NgSelectOption, \u0275NgSelectMultipleOption, DefaultValueAccessor, NumberValueAccessor, RangeValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, RadioControlValueAccessor, NgControlStatus, NgControlStatusGroup, RequiredValidator, MinLengthValidator, MaxLengthValidator, PatternValidator, CheckboxRequiredValidator, EmailValidator, MinValidator, MaxValidator];
var TEMPLATE_DRIVEN_DIRECTIVES = [NgModel, NgModelGroup, NgForm];
var REACTIVE_DRIVEN_DIRECTIVES = [FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName];
var \u0275InternalFormsSharedModule = class _\u0275InternalFormsSharedModule {
static \u0275fac = function \u0275InternalFormsSharedModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _\u0275InternalFormsSharedModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _\u0275InternalFormsSharedModule,
declarations: [\u0275NgNoValidate, NgSelectOption, \u0275NgSelectMultipleOption, DefaultValueAccessor, NumberValueAccessor, RangeValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, RadioControlValueAccessor, NgControlStatus, NgControlStatusGroup, RequiredValidator, MinLengthValidator, MaxLengthValidator, PatternValidator, CheckboxRequiredValidator, EmailValidator, MinValidator, MaxValidator],
exports: [\u0275NgNoValidate, NgSelectOption, \u0275NgSelectMultipleOption, DefaultValueAccessor, NumberValueAccessor, RangeValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, RadioControlValueAccessor, NgControlStatus, NgControlStatusGroup, RequiredValidator, MinLengthValidator, MaxLengthValidator, PatternValidator, CheckboxRequiredValidator, EmailValidator, MinValidator, MaxValidator]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(\u0275InternalFormsSharedModule, [{
type: NgModule,
args: [{
declarations: SHARED_FORM_DIRECTIVES,
exports: SHARED_FORM_DIRECTIVES
}]
}], null, null);
})();
var FormArray = class extends AbstractControl {
/**
* Creates a new `FormArray` instance.
*
* @param controls An array of child controls. Each child control is given an index
* where it is registered.
*
* @param validatorOrOpts A synchronous validator function, or an array of
* such functions, or an `AbstractControlOptions` object that contains validation functions
* and a validation trigger.
*
* @param asyncValidator A single async validator or array of async validator functions
*
*/
constructor(controls, validatorOrOpts, asyncValidator) {
super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));
this.controls = controls;
this._initObservables();
this._setUpdateStrategy(validatorOrOpts);
this._setUpControls();
this.updateValueAndValidity({
onlySelf: true,
// If `asyncValidator` is present, it will trigger control status change from `PENDING` to
// `VALID` or `INVALID`.
// The status should be broadcasted via the `statusChanges` observable, so we set `emitEvent`
// to `true` to allow that during the control creation process.
emitEvent: !!this.asyncValidator
});
}
controls;
/**
* Get the `AbstractControl` at the given `index` in the array.
*
* @param index Index in the array to retrieve the control. If `index` is negative, it will wrap
* around from the back, and if index is greatly negative (less than `-length`), the result is
* undefined. This behavior is the same as `Array.at(index)`.
*/
at(index) {
return this.controls[this._adjustIndex(index)];
}
/**
* Insert a new `AbstractControl` at the end of the array.
*
* @param control Form control to be inserted
* @param options Specifies whether this FormArray instance should emit events after a new
* control is added.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges` observables emit events with the latest status and value when the control is
* inserted. When false, no events are emitted.
*/
push(control, options = {}) {
if (Array.isArray(control)) {
control.forEach((ctrl) => {
this.controls.push(ctrl);
this._registerControl(ctrl);
});
} else {
this.controls.push(control);
this._registerControl(control);
}
this.updateValueAndValidity({
emitEvent: options.emitEvent
});
this._onCollectionChange();
}
/**
* Insert a new `AbstractControl` at the given `index` in the array.
*
* @param index Index in the array to insert the control. If `index` is negative, wraps around
* from the back. If `index` is greatly negative (less than `-length`), prepends to the array.
* This behavior is the same as `Array.splice(index, 0, control)`.
* @param control Form control to be inserted
* @param options Specifies whether this FormArray instance should emit events after a new
* control is inserted.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges` observables emit events with the latest status and value when the control is
* inserted. When false, no events are emitted.
*/
insert(index, control, options = {}) {
this.controls.splice(index, 0, control);
this._registerControl(control);
this.updateValueAndValidity({
emitEvent: options.emitEvent
});
}
/**
* Remove the control at the given `index` in the array.
*
* @param index Index in the array to remove the control. If `index` is negative, wraps around
* from the back. If `index` is greatly negative (less than `-length`), removes the first
* element. This behavior is the same as `Array.splice(index, 1)`.
* @param options Specifies whether this FormArray instance should emit events after a
* control is removed.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges` observables emit events with the latest status and value when the control is
* removed. When false, no events are emitted.
*/
removeAt(index, options = {}) {
let adjustedIndex = this._adjustIndex(index);
if (adjustedIndex < 0) adjustedIndex = 0;
if (this.controls[adjustedIndex]) this.controls[adjustedIndex]._registerOnCollectionChange(() => {
});
this.controls.splice(adjustedIndex, 1);
this.updateValueAndValidity({
emitEvent: options.emitEvent
});
}
/**
* Replace an existing control.
*
* @param index Index in the array to replace the control. If `index` is negative, wraps around
* from the back. If `index` is greatly negative (less than `-length`), replaces the first
* element. This behavior is the same as `Array.splice(index, 1, control)`.
* @param control The `AbstractControl` control to replace the existing control
* @param options Specifies whether this FormArray instance should emit events after an
* existing control is replaced with a new one.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges` observables emit events with the latest status and value when the control is
* replaced with a new one. When false, no events are emitted.
*/
setControl(index, control, options = {}) {
let adjustedIndex = this._adjustIndex(index);
if (adjustedIndex < 0) adjustedIndex = 0;
if (this.controls[adjustedIndex]) this.controls[adjustedIndex]._registerOnCollectionChange(() => {
});
this.controls.splice(adjustedIndex, 1);
if (control) {
this.controls.splice(adjustedIndex, 0, control);
this._registerControl(control);
}
this.updateValueAndValidity({
emitEvent: options.emitEvent
});
this._onCollectionChange();
}
/**
* Length of the control array.
*/
get length() {
return this.controls.length;
}
/**
* Sets the value of the `FormArray`. It accepts an array that matches
* the structure of the control.
*
* This method performs strict checks, and throws an error if you try
* to set the value of a control that doesn't exist or if you exclude the
* value of a control.
*
* @usageNotes
* ### Set the values for the controls in the form array
*
* ```ts
* const arr = new FormArray([
* new FormControl(),
* new FormControl()
* ]);
* console.log(arr.value); // [null, null]
*
* arr.setValue(['Nancy', 'Drew']);
* console.log(arr.value); // ['Nancy', 'Drew']
* ```
*
* @param value Array of values for the controls
* @param options Configure options that determine how the control propagates changes and
* emits events after the value changes
*
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default
* is false.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control value is updated.
* When false, no events are emitted.
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
* updateValueAndValidity} method.
*/
setValue(value, options = {}) {
assertAllValuesPresent(this, false, value);
value.forEach((newValue, index) => {
assertControlPresent(this, false, index);
this.at(index).setValue(newValue, {
onlySelf: true,
emitEvent: options.emitEvent
});
});
this.updateValueAndValidity(options);
}
/**
* Patches the value of the `FormArray`. It accepts an array that matches the
* structure of the control, and does its best to match the values to the correct
* controls in the group.
*
* It accepts both super-sets and sub-sets of the array without throwing an error.
*
* @usageNotes
* ### Patch the values for controls in a form array
*
* ```ts
* const arr = new FormArray([
* new FormControl(),
* new FormControl()
* ]);
* console.log(arr.value); // [null, null]
*
* arr.patchValue(['Nancy']);
* console.log(arr.value); // ['Nancy', null]
* ```
*
* @param value Array of latest values for the controls
* @param options Configure options that determine how the control propagates changes and
* emits events after the value changes
*
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default
* is false.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges` observables emit events with the latest status and value when the control
* value is updated. When false, no events are emitted. The configuration options are passed to
* the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method.
*/
patchValue(value, options = {}) {
if (value == null) return;
value.forEach((newValue, index) => {
if (this.at(index)) {
this.at(index).patchValue(newValue, {
onlySelf: true,
emitEvent: options.emitEvent
});
}
});
this.updateValueAndValidity(options);
}
/**
* Resets the `FormArray` and all descendants are marked `pristine` and `untouched`, and the
* value of all descendants to null or null maps.
*
* You reset to a specific form state by passing in an array of states
* that matches the structure of the control. The state is a standalone value
* or a form state object with both a value and a disabled status.
*
* @usageNotes
* ### Reset the values in a form array
*
* ```ts
* const arr = new FormArray([
* new FormControl(),
* new FormControl()
* ]);
* arr.reset(['name', 'last name']);
*
* console.log(arr.value); // ['name', 'last name']
* ```
*
* ### Reset the values in a form array and the disabled status for the first control
*
* ```ts
* arr.reset([
* {value: 'name', disabled: true},
* 'last'
* ]);
*
* console.log(arr.value); // ['last']
* console.log(arr.at(0).status); // 'DISABLED'
* ```
*
* @param value Array of values for the controls
* @param options Configure options that determine how the control propagates changes and
* emits events after the value changes
*
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default
* is false.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges`
* observables emit events with the latest status and value when the control is reset.
* When false, no events are emitted.
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
* updateValueAndValidity} method.
*/
reset(value = [], options = {}) {
this._forEachChild((control, index) => {
control.reset(value[index], {
onlySelf: true,
emitEvent: options.emitEvent
});
});
this._updatePristine(options, this);
this._updateTouched(options, this);
this.updateValueAndValidity(options);
}
/**
* The aggregate value of the array, including any disabled controls.
*
* Reports all values regardless of disabled status.
*/
getRawValue() {
return this.controls.map((control) => control.getRawValue());
}
/**
* Remove all controls in the `FormArray`.
*
* @param options Specifies whether this FormArray instance should emit events after all
* controls are removed.
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
* `valueChanges` observables emit events with the latest status and value when all controls
* in this FormArray instance are removed. When false, no events are emitted.
*
* @usageNotes
* ### Remove all elements from a FormArray
*
* ```ts
* const arr = new FormArray([
* new FormControl(),
* new FormControl()
* ]);
* console.log(arr.length); // 2
*
* arr.clear();
* console.log(arr.length); // 0
* ```
*
* It's a simpler and more efficient alternative to removing all elements one by one:
*
* ```ts
* const arr = new FormArray([
* new FormControl(),
* new FormControl()
* ]);
*
* while (arr.length) {
* arr.removeAt(0);
* }
* ```
*/
clear(options = {}) {
if (this.controls.length < 1) return;
this._forEachChild((control) => control._registerOnCollectionChange(() => {
}));
this.controls.splice(0);
this.updateValueAndValidity({
emitEvent: options.emitEvent
});
}
/**
* Adjusts a negative index by summing it with the length of the array. For very negative
* indices, the result may remain negative.
* @internal
*/
_adjustIndex(index) {
return index < 0 ? index + this.length : index;
}
/** @internal */
_syncPendingControls() {
let subtreeUpdated = this.controls.reduce((updated, child) => {
return child._syncPendingControls() ? true : updated;
}, false);
if (subtreeUpdated) this.updateValueAndValidity({
onlySelf: true
});
return subtreeUpdated;
}
/** @internal */
_forEachChild(cb) {
this.controls.forEach((control, index) => {
cb(control, index);
});
}
/** @internal */
_updateValue() {
this.value = this.controls.filter((control) => control.enabled || this.disabled).map((control) => control.value);
}
/** @internal */
_anyControls(condition) {
return this.controls.some((control) => control.enabled && condition(control));
}
/** @internal */
_setUpControls() {
this._forEachChild((control) => this._registerControl(control));
}
/** @internal */
_allControlsDisabled() {
for (const control of this.controls) {
if (control.enabled) return false;
}
return this.controls.length > 0 || this.disabled;
}
_registerControl(control) {
control.setParent(this);
control._registerOnCollectionChange(this._onCollectionChange);
}
/** @internal */
_find(name) {
return this.at(name) ?? null;
}
};
function isAbstractControlOptions(options) {
return !!options && (options.asyncValidators !== void 0 || options.validators !== void 0 || options.updateOn !== void 0);
}
var FormBuilder = class _FormBuilder {
useNonNullable = false;
/**
* @description
* Returns a FormBuilder in which automatically constructed `FormControl` elements
* have `{nonNullable: true}` and are non-nullable.
*
* **Constructing non-nullable controls**
*
* When constructing a control, it will be non-nullable, and will reset to its initial value.
*
* ```ts
* let nnfb = new FormBuilder().nonNullable;
* let name = nnfb.control('Alex'); // FormControl<string>
* name.reset();
* console.log(name); // 'Alex'
* ```
*
* **Constructing non-nullable groups or arrays**
*
* When constructing a group or array, all automatically created inner controls will be
* non-nullable, and will reset to their initial values.
*
* ```ts
* let nnfb = new FormBuilder().nonNullable;
* let name = nnfb.group({who: 'Alex'}); // FormGroup<{who: FormControl<string>}>
* name.reset();
* console.log(name); // {who: 'Alex'}
* ```
* **Constructing *nullable* fields on groups or arrays**
*
* It is still possible to have a nullable field. In particular, any `FormControl` which is
* *already* constructed will not be altered. For example:
*
* ```ts
* let nnfb = new FormBuilder().nonNullable;
* // FormGroup<{who: FormControl<string|null>}>
* let name = nnfb.group({who: new FormControl('Alex')});
* name.reset(); console.log(name); // {who: null}
* ```
*
* Because the inner control is constructed explicitly by the caller, the builder has
* no control over how it is created, and cannot exclude the `null`.
*/
get nonNullable() {
const nnfb = new _FormBuilder();
nnfb.useNonNullable = true;
return nnfb;
}
group(controls, options = null) {
const reducedControls = this._reduceControls(controls);
let newOptions = {};
if (isAbstractControlOptions(options)) {
newOptions = options;
} else if (options !== null) {
newOptions.validators = options.validator;
newOptions.asyncValidators = options.asyncValidator;
}
return new FormGroup(reducedControls, newOptions);
}
/**
* @description
* Constructs a new `FormRecord` instance. Accepts a single generic argument, which is an object
* containing all the keys and corresponding inner control types.
*
* @param controls A collection of child controls. The key for each child is the name
* under which it is registered.
*
* @param options Configuration options object for the `FormRecord`. The object should have the
* `AbstractControlOptions` type and might contain the following fields:
* * `validators`: A synchronous validator function, or an array of validator functions.
* * `asyncValidators`: A single async validator or array of async validator functions.
* * `updateOn`: The event upon which the control should be updated (options: 'change' | 'blur'
* | submit').
*/
record(controls, options = null) {
const reducedControls = this._reduceControls(controls);
return new FormRecord(reducedControls, options);
}
/**
* @description
* Constructs a new `FormControl` with the given state, validators and options. Sets
* `{nonNullable: true}` in the options to get a non-nullable control. Otherwise, the
* control will be nullable. Accepts a single generic argument, which is the type of the
* control's value.
*
* @param formState Initializes the control with an initial state value, or
* with an object that contains both a value and a disabled status.
*
* @param validatorOrOpts A synchronous validator function, or an array of
* such functions, or a `FormControlOptions` object that contains
* validation functions and a validation trigger.
*
* @param asyncValidator A single async validator or array of async validator
* functions.
*
* @usageNotes
*
* ### Initialize a control as disabled
*
* The following example returns a control with an initial value in a disabled state.
*
* {@example forms/ts/formBuilder/form_builder_example.ts region='disabled-control'}
*/
control(formState, validatorOrOpts, asyncValidator) {
let newOptions = {};
if (!this.useNonNullable) {
return new FormControl(formState, validatorOrOpts, asyncValidator);
}
if (isAbstractControlOptions(validatorOrOpts)) {
newOptions = validatorOrOpts;
} else {
newOptions.validators = validatorOrOpts;
newOptions.asyncValidators = asyncValidator;
}
return new FormControl(formState, __spreadProps(__spreadValues({}, newOptions), {
nonNullable: true
}));
}
/**
* Constructs a new `FormArray` from the given array of configurations,
* validators and options. Accepts a single generic argument, which is the type of each control
* inside the array.
*
* @param controls An array of child controls or control configs. Each child control is given an
* index when it is registered.
*
* @param validatorOrOpts A synchronous validator function, or an array of such functions, or an
* `AbstractControlOptions` object that contains
* validation functions and a validation trigger.
*
* @param asyncValidator A single async validator or array of async validator functions.
*/
array(controls, validatorOrOpts, asyncValidator) {
const createdControls = controls.map((c) => this._createControl(c));
return new FormArray(createdControls, validatorOrOpts, asyncValidator);
}
/** @internal */
_reduceControls(controls) {
const createdControls = {};
Object.keys(controls).forEach((controlName) => {
createdControls[controlName] = this._createControl(controls[controlName]);
});
return createdControls;
}
/** @internal */
_createControl(controls) {
if (controls instanceof FormControl) {
return controls;
} else if (controls instanceof AbstractControl) {
return controls;
} else if (Array.isArray(controls)) {
const value = controls[0];
const validator = controls.length > 1 ? controls[1] : null;
const asyncValidator = controls.length > 2 ? controls[2] : null;
return this.control(value, validator, asyncValidator);
} else {
return this.control(controls);
}
}
static \u0275fac = function FormBuilder_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _FormBuilder)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _FormBuilder,
factory: _FormBuilder.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormBuilder, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], null, null);
})();
var NonNullableFormBuilder = class _NonNullableFormBuilder {
static \u0275fac = function NonNullableFormBuilder_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _NonNullableFormBuilder)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _NonNullableFormBuilder,
factory: () => (() => inject2(FormBuilder).nonNullable)(),
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NonNullableFormBuilder, [{
type: Injectable,
args: [{
providedIn: "root",
useFactory: () => inject2(FormBuilder).nonNullable
}]
}], null, null);
})();
var UntypedFormBuilder = class _UntypedFormBuilder extends FormBuilder {
group(controlsConfig, options = null) {
return super.group(controlsConfig, options);
}
/**
* Like `FormBuilder#control`, except the resulting control is untyped.
*/
control(formState, validatorOrOpts, asyncValidator) {
return super.control(formState, validatorOrOpts, asyncValidator);
}
/**
* Like `FormBuilder#array`, except the resulting array is untyped.
*/
array(controlsConfig, validatorOrOpts, asyncValidator) {
return super.array(controlsConfig, validatorOrOpts, asyncValidator);
}
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275UntypedFormBuilder_BaseFactory;
return function UntypedFormBuilder_Factory(__ngFactoryType__) {
return (\u0275UntypedFormBuilder_BaseFactory || (\u0275UntypedFormBuilder_BaseFactory = \u0275\u0275getInheritedFactory(_UntypedFormBuilder)))(__ngFactoryType__ || _UntypedFormBuilder);
};
})();
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _UntypedFormBuilder,
factory: _UntypedFormBuilder.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(UntypedFormBuilder, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], null, null);
})();
var VERSION4 = new Version("20.2.1");
var FormsModule = class _FormsModule {
/**
* @description
* Provides options for configuring the forms module.
*
* @param opts An object of configuration options
* * `callSetDisabledState` Configures whether to `always` call `setDisabledState`, which is more
* correct, or to only call it `whenDisabled`, which is the legacy behavior.
*/
static withConfig(opts) {
return {
ngModule: _FormsModule,
providers: [{
provide: CALL_SET_DISABLED_STATE,
useValue: opts.callSetDisabledState ?? setDisabledStateDefault
}]
};
}
static \u0275fac = function FormsModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _FormsModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _FormsModule,
declarations: [NgModel, NgModelGroup, NgForm],
exports: [\u0275InternalFormsSharedModule, NgModel, NgModelGroup, NgForm]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
imports: [\u0275InternalFormsSharedModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormsModule, [{
type: NgModule,
args: [{
declarations: TEMPLATE_DRIVEN_DIRECTIVES,
exports: [\u0275InternalFormsSharedModule, TEMPLATE_DRIVEN_DIRECTIVES]
}]
}], null, null);
})();
var ReactiveFormsModule = class _ReactiveFormsModule {
/**
* @description
* Provides options for configuring the reactive forms module.
*
* @param opts An object of configuration options
* * `warnOnNgModelWithFormControl` Configures when to emit a warning when an `ngModel`
* binding is used with reactive form directives.
* * `callSetDisabledState` Configures whether to `always` call `setDisabledState`, which is more
* correct, or to only call it `whenDisabled`, which is the legacy behavior.
*/
static withConfig(opts) {
return {
ngModule: _ReactiveFormsModule,
providers: [{
provide: NG_MODEL_WITH_FORM_CONTROL_WARNING,
useValue: opts.warnOnNgModelWithFormControl ?? "always"
}, {
provide: CALL_SET_DISABLED_STATE,
useValue: opts.callSetDisabledState ?? setDisabledStateDefault
}]
};
}
static \u0275fac = function ReactiveFormsModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ReactiveFormsModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _ReactiveFormsModule,
declarations: [FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName],
exports: [\u0275InternalFormsSharedModule, FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
imports: [\u0275InternalFormsSharedModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ReactiveFormsModule, [{
type: NgModule,
args: [{
declarations: [REACTIVE_DRIVEN_DIRECTIVES],
exports: [\u0275InternalFormsSharedModule, REACTIVE_DRIVEN_DIRECTIVES]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/observers/private.mjs
var loopLimitExceededErrorHandler = (e) => {
if (e instanceof ErrorEvent && e.message === "ResizeObserver loop limit exceeded") {
console.error(`${e.message}. This could indicate a performance issue with your app. See https://github.com/WICG/resize-observer/blob/master/explainer.md#error-handling`);
}
};
var SingleBoxSharedResizeObserver = class {
_box;
/** Stream that emits when the shared observer is destroyed. */
_destroyed = new Subject();
/** Stream of all events from the ResizeObserver. */
_resizeSubject = new Subject();
/** ResizeObserver used to observe element resize events. */
_resizeObserver;
/** A map of elements to streams of their resize events. */
_elementObservables = /* @__PURE__ */ new Map();
constructor(_box) {
this._box = _box;
if (typeof ResizeObserver !== "undefined") {
this._resizeObserver = new ResizeObserver((entries) => this._resizeSubject.next(entries));
}
}
/**
* Gets a stream of resize events for the given element.
* @param target The element to observe.
* @return The stream of resize events for the element.
*/
observe(target) {
if (!this._elementObservables.has(target)) {
this._elementObservables.set(target, new Observable((observer) => {
const subscription = this._resizeSubject.subscribe(observer);
this._resizeObserver?.observe(target, {
box: this._box
});
return () => {
this._resizeObserver?.unobserve(target);
subscription.unsubscribe();
this._elementObservables.delete(target);
};
}).pipe(
filter((entries) => entries.some((entry) => entry.target === target)),
// Share a replay of the last event so that subsequent calls to observe the same element
// receive initial sizing info like the first one. Also enable ref counting so the
// element will be automatically unobserved when there are no more subscriptions.
shareReplay({
bufferSize: 1,
refCount: true
}),
takeUntil(this._destroyed)
));
}
return this._elementObservables.get(target);
}
/** Destroys this instance. */
destroy() {
this._destroyed.next();
this._destroyed.complete();
this._resizeSubject.complete();
this._elementObservables.clear();
}
};
var SharedResizeObserver = class _SharedResizeObserver {
_cleanupErrorListener;
/** Map of box type to shared resize observer. */
_observers = /* @__PURE__ */ new Map();
/** The Angular zone. */
_ngZone = inject2(NgZone);
constructor() {
if (typeof ResizeObserver !== "undefined" && (typeof ngDevMode === "undefined" || ngDevMode)) {
this._ngZone.runOutsideAngular(() => {
const renderer = inject2(RendererFactory2).createRenderer(null, null);
this._cleanupErrorListener = renderer.listen("window", "error", loopLimitExceededErrorHandler);
});
}
}
ngOnDestroy() {
for (const [, observer] of this._observers) {
observer.destroy();
}
this._observers.clear();
this._cleanupErrorListener?.();
}
/**
* Gets a stream of resize events for the given target element and box type.
* @param target The element to observe for resizes.
* @param options Options to pass to the `ResizeObserver`
* @return The stream of resize events for the element.
*/
observe(target, options) {
const box = options?.box || "content-box";
if (!this._observers.has(box)) {
this._observers.set(box, new SingleBoxSharedResizeObserver(box));
}
return this._observers.get(box).observe(target);
}
static \u0275fac = function SharedResizeObserver_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _SharedResizeObserver)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _SharedResizeObserver,
factory: _SharedResizeObserver.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SharedResizeObserver, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/form-field2.mjs
var _c05 = ["notch"];
var _c13 = ["matFormFieldNotchedOutline", ""];
var _c22 = ["*"];
var _c32 = ["iconPrefixContainer"];
var _c42 = ["textPrefixContainer"];
var _c52 = ["iconSuffixContainer"];
var _c6 = ["textSuffixContainer"];
var _c7 = ["textField"];
var _c8 = ["*", [["mat-label"]], [["", "matPrefix", ""], ["", "matIconPrefix", ""]], [["", "matTextPrefix", ""]], [["", "matTextSuffix", ""]], [["", "matSuffix", ""], ["", "matIconSuffix", ""]], [["mat-error"], ["", "matError", ""]], [["mat-hint", 3, "align", "end"]], [["mat-hint", "align", "end"]]];
var _c9 = ["*", "mat-label", "[matPrefix], [matIconPrefix]", "[matTextPrefix]", "[matTextSuffix]", "[matSuffix], [matIconSuffix]", "mat-error, [matError]", "mat-hint:not([align='end'])", "mat-hint[align='end']"];
function MatFormField_ng_template_0_Conditional_0_Conditional_2_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275element(0, "span", 20);
}
}
function MatFormField_ng_template_0_Conditional_0_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "label", 19);
\u0275\u0275projection(1, 1);
\u0275\u0275conditionalCreate(2, MatFormField_ng_template_0_Conditional_0_Conditional_2_Template, 1, 0, "span", 20);
\u0275\u0275elementEnd();
}
if (rf & 2) {
const ctx_r1 = \u0275\u0275nextContext(2);
\u0275\u0275property("floating", ctx_r1._shouldLabelFloat())("monitorResize", ctx_r1._hasOutline())("id", ctx_r1._labelId);
\u0275\u0275attribute("for", ctx_r1._control.disableAutomaticLabeling ? null : ctx_r1._control.id);
\u0275\u0275advance(2);
\u0275\u0275conditional(!ctx_r1.hideRequiredMarker && ctx_r1._control.required ? 2 : -1);
}
}
function MatFormField_ng_template_0_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275conditionalCreate(0, MatFormField_ng_template_0_Conditional_0_Template, 3, 5, "label", 19);
}
if (rf & 2) {
const ctx_r1 = \u0275\u0275nextContext();
\u0275\u0275conditional(ctx_r1._hasFloatingLabel() ? 0 : -1);
}
}
function MatFormField_Conditional_4_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275element(0, "div", 7);
}
}
function MatFormField_Conditional_6_Conditional_1_ng_template_0_Template(rf, ctx) {
}
function MatFormField_Conditional_6_Conditional_1_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275template(0, MatFormField_Conditional_6_Conditional_1_ng_template_0_Template, 0, 0, "ng-template", 13);
}
if (rf & 2) {
\u0275\u0275nextContext(2);
const labelTemplate_r3 = \u0275\u0275reference(1);
\u0275\u0275property("ngTemplateOutlet", labelTemplate_r3);
}
}
function MatFormField_Conditional_6_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "div", 9);
\u0275\u0275conditionalCreate(1, MatFormField_Conditional_6_Conditional_1_Template, 1, 1, null, 13);
\u0275\u0275elementEnd();
}
if (rf & 2) {
const ctx_r1 = \u0275\u0275nextContext();
\u0275\u0275property("matFormFieldNotchedOutlineOpen", ctx_r1._shouldLabelFloat());
\u0275\u0275advance();
\u0275\u0275conditional(!ctx_r1._forceDisplayInfixLabel() ? 1 : -1);
}
}
function MatFormField_Conditional_7_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "div", 10, 2);
\u0275\u0275projection(2, 2);
\u0275\u0275elementEnd();
}
}
function MatFormField_Conditional_8_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "div", 11, 3);
\u0275\u0275projection(2, 3);
\u0275\u0275elementEnd();
}
}
function MatFormField_Conditional_10_ng_template_0_Template(rf, ctx) {
}
function MatFormField_Conditional_10_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275template(0, MatFormField_Conditional_10_ng_template_0_Template, 0, 0, "ng-template", 13);
}
if (rf & 2) {
\u0275\u0275nextContext();
const labelTemplate_r3 = \u0275\u0275reference(1);
\u0275\u0275property("ngTemplateOutlet", labelTemplate_r3);
}
}
function MatFormField_Conditional_12_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "div", 14, 4);
\u0275\u0275projection(2, 4);
\u0275\u0275elementEnd();
}
}
function MatFormField_Conditional_13_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "div", 15, 5);
\u0275\u0275projection(2, 5);
\u0275\u0275elementEnd();
}
}
function MatFormField_Conditional_14_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275element(0, "div", 16);
}
}
function MatFormField_Case_17_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275projection(0, 6);
}
}
function MatFormField_Case_18_Conditional_0_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "mat-hint", 21);
\u0275\u0275text(1);
\u0275\u0275elementEnd();
}
if (rf & 2) {
const ctx_r1 = \u0275\u0275nextContext(2);
\u0275\u0275property("id", ctx_r1._hintLabelId);
\u0275\u0275advance();
\u0275\u0275textInterpolate(ctx_r1.hintLabel);
}
}
function MatFormField_Case_18_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275conditionalCreate(0, MatFormField_Case_18_Conditional_0_Template, 2, 2, "mat-hint", 21);
\u0275\u0275projection(1, 7);
\u0275\u0275element(2, "div", 22);
\u0275\u0275projection(3, 8);
}
if (rf & 2) {
const ctx_r1 = \u0275\u0275nextContext();
\u0275\u0275conditional(ctx_r1.hintLabel ? 0 : -1);
}
}
var MatLabel = class _MatLabel {
static \u0275fac = function MatLabel_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatLabel)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MatLabel,
selectors: [["mat-label"]]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatLabel, [{
type: Directive,
args: [{
selector: "mat-label"
}]
}], null, null);
})();
var MAT_ERROR = new InjectionToken("MatError");
var MatError = class _MatError {
id = inject2(_IdGenerator).getId("mat-mdc-error-");
constructor() {
}
static \u0275fac = function MatError_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatError)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MatError,
selectors: [["mat-error"], ["", "matError", ""]],
hostAttrs: [1, "mat-mdc-form-field-error", "mat-mdc-form-field-bottom-align"],
hostVars: 1,
hostBindings: function MatError_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275domProperty("id", ctx.id);
}
},
inputs: {
id: "id"
},
features: [\u0275\u0275ProvidersFeature([{
provide: MAT_ERROR,
useExisting: _MatError
}])]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatError, [{
type: Directive,
args: [{
selector: "mat-error, [matError]",
host: {
"class": "mat-mdc-form-field-error mat-mdc-form-field-bottom-align",
"[id]": "id"
},
providers: [{
provide: MAT_ERROR,
useExisting: MatError
}]
}]
}], () => [], {
id: [{
type: Input
}]
});
})();
var MatHint = class _MatHint {
/** Whether to align the hint label at the start or end of the line. */
align = "start";
/** Unique ID for the hint. Used for the aria-describedby on the form field control. */
id = inject2(_IdGenerator).getId("mat-mdc-hint-");
static \u0275fac = function MatHint_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatHint)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MatHint,
selectors: [["mat-hint"]],
hostAttrs: [1, "mat-mdc-form-field-hint", "mat-mdc-form-field-bottom-align"],
hostVars: 4,
hostBindings: function MatHint_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275domProperty("id", ctx.id);
\u0275\u0275attribute("align", null);
\u0275\u0275classProp("mat-mdc-form-field-hint-end", ctx.align === "end");
}
},
inputs: {
align: "align",
id: "id"
}
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatHint, [{
type: Directive,
args: [{
selector: "mat-hint",
host: {
"class": "mat-mdc-form-field-hint mat-mdc-form-field-bottom-align",
"[class.mat-mdc-form-field-hint-end]": 'align === "end"',
"[id]": "id",
// Remove align attribute to prevent it from interfering with layout.
"[attr.align]": "null"
}
}]
}], null, {
align: [{
type: Input
}],
id: [{
type: Input
}]
});
})();
var MAT_PREFIX = new InjectionToken("MatPrefix");
var MatPrefix = class _MatPrefix {
set _isTextSelector(value) {
this._isText = true;
}
_isText = false;
static \u0275fac = function MatPrefix_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatPrefix)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MatPrefix,
selectors: [["", "matPrefix", ""], ["", "matIconPrefix", ""], ["", "matTextPrefix", ""]],
inputs: {
_isTextSelector: [0, "matTextPrefix", "_isTextSelector"]
},
features: [\u0275\u0275ProvidersFeature([{
provide: MAT_PREFIX,
useExisting: _MatPrefix
}])]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatPrefix, [{
type: Directive,
args: [{
selector: "[matPrefix], [matIconPrefix], [matTextPrefix]",
providers: [{
provide: MAT_PREFIX,
useExisting: MatPrefix
}]
}]
}], null, {
_isTextSelector: [{
type: Input,
args: ["matTextPrefix"]
}]
});
})();
var MAT_SUFFIX = new InjectionToken("MatSuffix");
var MatSuffix = class _MatSuffix {
set _isTextSelector(value) {
this._isText = true;
}
_isText = false;
static \u0275fac = function MatSuffix_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatSuffix)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MatSuffix,
selectors: [["", "matSuffix", ""], ["", "matIconSuffix", ""], ["", "matTextSuffix", ""]],
inputs: {
_isTextSelector: [0, "matTextSuffix", "_isTextSelector"]
},
features: [\u0275\u0275ProvidersFeature([{
provide: MAT_SUFFIX,
useExisting: _MatSuffix
}])]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatSuffix, [{
type: Directive,
args: [{
selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
providers: [{
provide: MAT_SUFFIX,
useExisting: MatSuffix
}]
}]
}], null, {
_isTextSelector: [{
type: Input,
args: ["matTextSuffix"]
}]
});
})();
var FLOATING_LABEL_PARENT = new InjectionToken("FloatingLabelParent");
var MatFormFieldFloatingLabel = class _MatFormFieldFloatingLabel {
_elementRef = inject2(ElementRef);
/** Whether the label is floating. */
get floating() {
return this._floating;
}
set floating(value) {
this._floating = value;
if (this.monitorResize) {
this._handleResize();
}
}
_floating = false;
/** Whether to monitor for resize events on the floating label. */
get monitorResize() {
return this._monitorResize;
}
set monitorResize(value) {
this._monitorResize = value;
if (this._monitorResize) {
this._subscribeToResize();
} else {
this._resizeSubscription.unsubscribe();
}
}
_monitorResize = false;
/** The shared ResizeObserver. */
_resizeObserver = inject2(SharedResizeObserver);
/** The Angular zone. */
_ngZone = inject2(NgZone);
/** The parent form-field. */
_parent = inject2(FLOATING_LABEL_PARENT);
/** The current resize event subscription. */
_resizeSubscription = new Subscription();
constructor() {
}
ngOnDestroy() {
this._resizeSubscription.unsubscribe();
}
/** Gets the width of the label. Used for the outline notch. */
getWidth() {
return estimateScrollWidth(this._elementRef.nativeElement);
}
/** Gets the HTML element for the floating label. */
get element() {
return this._elementRef.nativeElement;
}
/** Handles resize events from the ResizeObserver. */
_handleResize() {
setTimeout(() => this._parent._handleLabelResized());
}
/** Subscribes to resize events. */
_subscribeToResize() {
this._resizeSubscription.unsubscribe();
this._ngZone.runOutsideAngular(() => {
this._resizeSubscription = this._resizeObserver.observe(this._elementRef.nativeElement, {
box: "border-box"
}).subscribe(() => this._handleResize());
});
}
static \u0275fac = function MatFormFieldFloatingLabel_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatFormFieldFloatingLabel)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MatFormFieldFloatingLabel,
selectors: [["label", "matFormFieldFloatingLabel", ""]],
hostAttrs: [1, "mdc-floating-label", "mat-mdc-floating-label"],
hostVars: 2,
hostBindings: function MatFormFieldFloatingLabel_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275classProp("mdc-floating-label--float-above", ctx.floating);
}
},
inputs: {
floating: "floating",
monitorResize: "monitorResize"
}
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFormFieldFloatingLabel, [{
type: Directive,
args: [{
selector: "label[matFormFieldFloatingLabel]",
host: {
"class": "mdc-floating-label mat-mdc-floating-label",
"[class.mdc-floating-label--float-above]": "floating"
}
}]
}], () => [], {
floating: [{
type: Input
}],
monitorResize: [{
type: Input
}]
});
})();
function estimateScrollWidth(element) {
const htmlEl = element;
if (htmlEl.offsetParent !== null) {
return htmlEl.scrollWidth;
}
const clone = htmlEl.cloneNode(true);
clone.style.setProperty("position", "absolute");
clone.style.setProperty("transform", "translate(-9999px, -9999px)");
document.documentElement.appendChild(clone);
const scrollWidth = clone.scrollWidth;
clone.remove();
return scrollWidth;
}
var ACTIVATE_CLASS = "mdc-line-ripple--active";
var DEACTIVATING_CLASS = "mdc-line-ripple--deactivating";
var MatFormFieldLineRipple = class _MatFormFieldLineRipple {
_elementRef = inject2(ElementRef);
_cleanupTransitionEnd;
constructor() {
const ngZone = inject2(NgZone);
const renderer = inject2(Renderer2);
ngZone.runOutsideAngular(() => {
this._cleanupTransitionEnd = renderer.listen(this._elementRef.nativeElement, "transitionend", this._handleTransitionEnd);
});
}
activate() {
const classList = this._elementRef.nativeElement.classList;
classList.remove(DEACTIVATING_CLASS);
classList.add(ACTIVATE_CLASS);
}
deactivate() {
this._elementRef.nativeElement.classList.add(DEACTIVATING_CLASS);
}
_handleTransitionEnd = (event) => {
const classList = this._elementRef.nativeElement.classList;
const isDeactivating = classList.contains(DEACTIVATING_CLASS);
if (event.propertyName === "opacity" && isDeactivating) {
classList.remove(ACTIVATE_CLASS, DEACTIVATING_CLASS);
}
};
ngOnDestroy() {
this._cleanupTransitionEnd();
}
static \u0275fac = function MatFormFieldLineRipple_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatFormFieldLineRipple)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MatFormFieldLineRipple,
selectors: [["div", "matFormFieldLineRipple", ""]],
hostAttrs: [1, "mdc-line-ripple"]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFormFieldLineRipple, [{
type: Directive,
args: [{
selector: "div[matFormFieldLineRipple]",
host: {
"class": "mdc-line-ripple"
}
}]
}], () => [], null);
})();
var MatFormFieldNotchedOutline = class _MatFormFieldNotchedOutline {
_elementRef = inject2(ElementRef);
_ngZone = inject2(NgZone);
/** Whether the notch should be opened. */
open = false;
_notch;
ngAfterViewInit() {
const element = this._elementRef.nativeElement;
const label = element.querySelector(".mdc-floating-label");
if (label) {
element.classList.add("mdc-notched-outline--upgraded");
if (typeof requestAnimationFrame === "function") {
label.style.transitionDuration = "0s";
this._ngZone.runOutsideAngular(() => {
requestAnimationFrame(() => label.style.transitionDuration = "");
});
}
} else {
element.classList.add("mdc-notched-outline--no-label");
}
}
_setNotchWidth(labelWidth) {
const notch = this._notch.nativeElement;
if (!this.open || !labelWidth) {
notch.style.width = "";
} else {
const NOTCH_ELEMENT_PADDING = 8;
const NOTCH_ELEMENT_BORDER = 1;
notch.style.width = `calc(${labelWidth}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + ${NOTCH_ELEMENT_PADDING + NOTCH_ELEMENT_BORDER}px)`;
}
}
_setMaxWidth(prefixAndSuffixWidth) {
this._notch.nativeElement.style.setProperty("--mat-form-field-notch-max-width", `calc(100% - ${prefixAndSuffixWidth}px)`);
}
static \u0275fac = function MatFormFieldNotchedOutline_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatFormFieldNotchedOutline)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: _MatFormFieldNotchedOutline,
selectors: [["div", "matFormFieldNotchedOutline", ""]],
viewQuery: function MatFormFieldNotchedOutline_Query(rf, ctx) {
if (rf & 1) {
\u0275\u0275viewQuery(_c05, 5);
}
if (rf & 2) {
let _t;
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._notch = _t.first);
}
},
hostAttrs: [1, "mdc-notched-outline"],
hostVars: 2,
hostBindings: function MatFormFieldNotchedOutline_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275classProp("mdc-notched-outline--notched", ctx.open);
}
},
inputs: {
open: [0, "matFormFieldNotchedOutlineOpen", "open"]
},
attrs: _c13,
ngContentSelectors: _c22,
decls: 5,
vars: 0,
consts: [["notch", ""], [1, "mat-mdc-notch-piece", "mdc-notched-outline__leading"], [1, "mat-mdc-notch-piece", "mdc-notched-outline__notch"], [1, "mat-mdc-notch-piece", "mdc-notched-outline__trailing"]],
template: function MatFormFieldNotchedOutline_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275projectionDef();
\u0275\u0275domElement(0, "div", 1);
\u0275\u0275domElementStart(1, "div", 2, 0);
\u0275\u0275projection(3);
\u0275\u0275domElementEnd();
\u0275\u0275domElement(4, "div", 3);
}
},
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFormFieldNotchedOutline, [{
type: Component,
args: [{
selector: "div[matFormFieldNotchedOutline]",
host: {
"class": "mdc-notched-outline",
// Besides updating the notch state through the MDC component, we toggle this class through
// a host binding in order to ensure that the notched-outline renders correctly on the server.
"[class.mdc-notched-outline--notched]": "open"
},
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: '<div class="mat-mdc-notch-piece mdc-notched-outline__leading"></div>\n<div class="mat-mdc-notch-piece mdc-notched-outline__notch" #notch>\n <ng-content></ng-content>\n</div>\n<div class="mat-mdc-notch-piece mdc-notched-outline__trailing"></div>\n'
}]
}], null, {
open: [{
type: Input,
args: ["matFormFieldNotchedOutlineOpen"]
}],
_notch: [{
type: ViewChild,
args: ["notch"]
}]
});
})();
var MatFormFieldControl = class _MatFormFieldControl {
/** The value of the control. */
value;
/**
* Stream that emits whenever the state of the control changes such that the parent `MatFormField`
* needs to run change detection.
*/
stateChanges;
/** The element ID for this control. */
id;
/** The placeholder for this control. */
placeholder;
/** Gets the AbstractControlDirective for this control. */
ngControl;
/** Whether the control is focused. */
focused;
/** Whether the control is empty. */
empty;
/** Whether the `MatFormField` label should try to float. */
shouldLabelFloat;
/** Whether the control is required. */
required;
/** Whether the control is disabled. */
disabled;
/** Whether the control is in an error state. */
errorState;
/**
* An optional name for the control type that can be used to distinguish `mat-form-field` elements
* based on their control type. The form field will add a class,
* `mat-form-field-type-{{controlType}}` to its root element.
*/
controlType;
/**
* Whether the input is currently in an autofilled state. If property is not present on the
* control it is assumed to be false.
*/
autofilled;
/**
* Value of `aria-describedby` that should be merged with the described-by ids
* which are set by the form-field.
*/
userAriaDescribedBy;
/**
* Whether to automatically assign the ID of the form field as the `for` attribute
* on the `<label>` inside the form field. Set this to true to prevent the form
* field from associating the label with non-native elements.
*/
disableAutomaticLabeling;
/** Gets the list of element IDs that currently describe this control. */
describedByIds;
static \u0275fac = function MatFormFieldControl_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatFormFieldControl)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MatFormFieldControl
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFormFieldControl, [{
type: Directive
}], null, null);
})();
function getMatFormFieldDuplicatedHintError(align) {
return Error(`A hint was already declared for 'align="${align}"'.`);
}
function getMatFormFieldMissingControlError() {
return Error("mat-form-field must contain a MatFormFieldControl.");
}
var MAT_FORM_FIELD = new InjectionToken("MatFormField");
var MAT_FORM_FIELD_DEFAULT_OPTIONS = new InjectionToken("MAT_FORM_FIELD_DEFAULT_OPTIONS");
var DEFAULT_APPEARANCE = "fill";
var DEFAULT_FLOAT_LABEL = "auto";
var DEFAULT_SUBSCRIPT_SIZING = "fixed";
var FLOATING_LABEL_DEFAULT_DOCKED_TRANSFORM = `translateY(-50%)`;
var MatFormField = class _MatFormField {
_elementRef = inject2(ElementRef);
_changeDetectorRef = inject2(ChangeDetectorRef);
_platform = inject2(Platform);
_idGenerator = inject2(_IdGenerator);
_ngZone = inject2(NgZone);
_defaults = inject2(MAT_FORM_FIELD_DEFAULT_OPTIONS, {
optional: true
});
_currentDirection;
_textField;
_iconPrefixContainer;
_textPrefixContainer;
_iconSuffixContainer;
_textSuffixContainer;
_floatingLabel;
_notchedOutline;
_lineRipple;
_iconPrefixContainerSignal = viewChild("iconPrefixContainer", ...ngDevMode ? [{
debugName: "_iconPrefixContainerSignal"
}] : []);
_textPrefixContainerSignal = viewChild("textPrefixContainer", ...ngDevMode ? [{
debugName: "_textPrefixContainerSignal"
}] : []);
_iconSuffixContainerSignal = viewChild("iconSuffixContainer", ...ngDevMode ? [{
debugName: "_iconSuffixContainerSignal"
}] : []);
_textSuffixContainerSignal = viewChild("textSuffixContainer", ...ngDevMode ? [{
debugName: "_textSuffixContainerSignal"
}] : []);
_prefixSuffixContainers = computed(() => {
return [this._iconPrefixContainerSignal(), this._textPrefixContainerSignal(), this._iconSuffixContainerSignal(), this._textSuffixContainerSignal()].map((container) => container?.nativeElement).filter((e) => e !== void 0);
}, ...ngDevMode ? [{
debugName: "_prefixSuffixContainers"
}] : []);
_formFieldControl;
_prefixChildren;
_suffixChildren;
_errorChildren;
_hintChildren;
_labelChild = contentChild(MatLabel, ...ngDevMode ? [{
debugName: "_labelChild"
}] : []);
/** Whether the required marker should be hidden. */
get hideRequiredMarker() {
return this._hideRequiredMarker;
}
set hideRequiredMarker(value) {
this._hideRequiredMarker = coerceBooleanProperty(value);
}
_hideRequiredMarker = false;
/**
* Theme color of the form field. This API is supported in M2 themes only, it
* has no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/form-field/styling.
*
* For information on applying color variants in M3, see
* https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants
*/
color = "primary";
/** Whether the label should always float or float as the user types. */
get floatLabel() {
return this._floatLabel || this._defaults?.floatLabel || DEFAULT_FLOAT_LABEL;
}
set floatLabel(value) {
if (value !== this._floatLabel) {
this._floatLabel = value;
this._changeDetectorRef.markForCheck();
}
}
_floatLabel;
/** The form field appearance style. */
get appearance() {
return this._appearanceSignal();
}
set appearance(value) {
const newAppearance = value || this._defaults?.appearance || DEFAULT_APPEARANCE;
if (typeof ngDevMode === "undefined" || ngDevMode) {
if (newAppearance !== "fill" && newAppearance !== "outline") {
throw new Error(`MatFormField: Invalid appearance "${newAppearance}", valid values are "fill" or "outline".`);
}
}
this._appearanceSignal.set(newAppearance);
}
_appearanceSignal = signal(DEFAULT_APPEARANCE, ...ngDevMode ? [{
debugName: "_appearanceSignal"
}] : []);
/**
* Whether the form field should reserve space for one line of hint/error text (default)
* or to have the spacing grow from 0px as needed based on the size of the hint/error content.
* Note that when using dynamic sizing, layout shifts will occur when hint/error text changes.
*/
get subscriptSizing() {
return this._subscriptSizing || this._defaults?.subscriptSizing || DEFAULT_SUBSCRIPT_SIZING;
}
set subscriptSizing(value) {
this._subscriptSizing = value || this._defaults?.subscriptSizing || DEFAULT_SUBSCRIPT_SIZING;
}
_subscriptSizing = null;
/** Text for the form field hint. */
get hintLabel() {
return this._hintLabel;
}
set hintLabel(value) {
this._hintLabel = value;
this._processHints();
}
_hintLabel = "";
_hasIconPrefix = false;
_hasTextPrefix = false;
_hasIconSuffix = false;
_hasTextSuffix = false;
// Unique id for the internal form field label.
_labelId = this._idGenerator.getId("mat-mdc-form-field-label-");
// Unique id for the hint label.
_hintLabelId = this._idGenerator.getId("mat-mdc-hint-");
// Ids obtained from the error and hint fields
_describedByIds;
/** Gets the current form field control */
get _control() {
return this._explicitFormFieldControl || this._formFieldControl;
}
set _control(value) {
this._explicitFormFieldControl = value;
}
_destroyed = new Subject();
_isFocused = null;
_explicitFormFieldControl;
_previousControl = null;
_previousControlValidatorFn = null;
_stateChanges;
_valueChanges;
_describedByChanges;
_outlineLabelOffsetResizeObserver = null;
_animationsDisabled = _animationsDisabled();
constructor() {
const defaults2 = this._defaults;
const dir = inject2(Directionality);
if (defaults2) {
if (defaults2.appearance) {
this.appearance = defaults2.appearance;
}
this._hideRequiredMarker = Boolean(defaults2?.hideRequiredMarker);
if (defaults2.color) {
this.color = defaults2.color;
}
}
effect(() => this._currentDirection = dir.valueSignal());
this._syncOutlineLabelOffset();
}
ngAfterViewInit() {
this._updateFocusState();
if (!this._animationsDisabled) {
this._ngZone.runOutsideAngular(() => {
setTimeout(() => {
this._elementRef.nativeElement.classList.add("mat-form-field-animations-enabled");
}, 300);
});
}
this._changeDetectorRef.detectChanges();
}
ngAfterContentInit() {
this._assertFormFieldControl();
this._initializeSubscript();
this._initializePrefixAndSuffix();
}
ngAfterContentChecked() {
this._assertFormFieldControl();
if (this._control !== this._previousControl) {
this._initializeControl(this._previousControl);
if (this._control.ngControl && this._control.ngControl.control) {
this._previousControlValidatorFn = this._control.ngControl.control.validator;
}
this._previousControl = this._control;
}
if (this._control.ngControl && this._control.ngControl.control) {
const validatorFn = this._control.ngControl.control.validator;
if (validatorFn !== this._previousControlValidatorFn) {
this._changeDetectorRef.markForCheck();
}
}
}
ngOnDestroy() {
this._outlineLabelOffsetResizeObserver?.disconnect();
this._stateChanges?.unsubscribe();
this._valueChanges?.unsubscribe();
this._describedByChanges?.unsubscribe();
this._destroyed.next();
this._destroyed.complete();
}
/**
* Gets the id of the label element. If no label is present, returns `null`.
*/
getLabelId = computed(() => this._hasFloatingLabel() ? this._labelId : null, ...ngDevMode ? [{
debugName: "getLabelId"
}] : []);
/**
* Gets an ElementRef for the element that a overlay attached to the form field
* should be positioned relative to.
*/
getConnectedOverlayOrigin() {
return this._textField || this._elementRef;
}
/** Animates the placeholder up and locks it in position. */
_animateAndLockLabel() {
if (this._hasFloatingLabel()) {
this.floatLabel = "always";
}
}
/** Initializes the registered form field control. */
_initializeControl(previousControl) {
const control = this._control;
const classPrefix = "mat-mdc-form-field-type-";
if (previousControl) {
this._elementRef.nativeElement.classList.remove(classPrefix + previousControl.controlType);
}
if (control.controlType) {
this._elementRef.nativeElement.classList.add(classPrefix + control.controlType);
}
this._stateChanges?.unsubscribe();
this._stateChanges = control.stateChanges.subscribe(() => {
this._updateFocusState();
this._changeDetectorRef.markForCheck();
});
this._describedByChanges?.unsubscribe();
this._describedByChanges = control.stateChanges.pipe(startWith([void 0, void 0]), map(() => [control.errorState, control.userAriaDescribedBy]), pairwise(), filter(([[prevErrorState, prevDescribedBy], [currentErrorState, currentDescribedBy]]) => {
return prevErrorState !== currentErrorState || prevDescribedBy !== currentDescribedBy;
})).subscribe(() => this._syncDescribedByIds());
this._valueChanges?.unsubscribe();
if (control.ngControl && control.ngControl.valueChanges) {
this._valueChanges = control.ngControl.valueChanges.pipe(takeUntil(this._destroyed)).subscribe(() => this._changeDetectorRef.markForCheck());
}
}
_checkPrefixAndSuffixTypes() {
this._hasIconPrefix = !!this._prefixChildren.find((p) => !p._isText);
this._hasTextPrefix = !!this._prefixChildren.find((p) => p._isText);
this._hasIconSuffix = !!this._suffixChildren.find((s) => !s._isText);
this._hasTextSuffix = !!this._suffixChildren.find((s) => s._isText);
}
/** Initializes the prefix and suffix containers. */
_initializePrefixAndSuffix() {
this._checkPrefixAndSuffixTypes();
merge(this._prefixChildren.changes, this._suffixChildren.changes).subscribe(() => {
this._checkPrefixAndSuffixTypes();
this._changeDetectorRef.markForCheck();
});
}
/**
* Initializes the subscript by validating hints and synchronizing "aria-describedby" ids
* with the custom form field control. Also subscribes to hint and error changes in order
* to be able to validate and synchronize ids on change.
*/
_initializeSubscript() {
this._hintChildren.changes.subscribe(() => {
this._processHints();
this._changeDetectorRef.markForCheck();
});
this._errorChildren.changes.subscribe(() => {
this._syncDescribedByIds();
this._changeDetectorRef.markForCheck();
});
this._validateHints();
this._syncDescribedByIds();
}
/** Throws an error if the form field's control is missing. */
_assertFormFieldControl() {
if (!this._control && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw getMatFormFieldMissingControlError();
}
}
_updateFocusState() {
const controlFocused = this._control.focused;
if (controlFocused && !this._isFocused) {
this._isFocused = true;
this._lineRipple?.activate();
} else if (!controlFocused && (this._isFocused || this._isFocused === null)) {
this._isFocused = false;
this._lineRipple?.deactivate();
}
this._elementRef.nativeElement.classList.toggle("mat-focused", controlFocused);
this._textField?.nativeElement.classList.toggle("mdc-text-field--focused", controlFocused);
}
/**
* The floating label in the docked state needs to account for prefixes. The horizontal offset
* is calculated whenever the appearance changes to `outline`, the prefixes change, or when the
* form field is added to the DOM. This method sets up all subscriptions which are needed to
* trigger the label offset update.
*/
_syncOutlineLabelOffset() {
afterRenderEffect({
earlyRead: () => {
if (this._appearanceSignal() !== "outline") {
this._outlineLabelOffsetResizeObserver?.disconnect();
return null;
}
if (globalThis.ResizeObserver) {
this._outlineLabelOffsetResizeObserver ||= new globalThis.ResizeObserver(() => {
this._writeOutlinedLabelStyles(this._getOutlinedLabelOffset());
});
for (const el of this._prefixSuffixContainers()) {
this._outlineLabelOffsetResizeObserver.observe(el, {
box: "border-box"
});
}
}
return this._getOutlinedLabelOffset();
},
write: (labelStyles) => this._writeOutlinedLabelStyles(labelStyles())
});
}
/** Whether the floating label should always float or not. */
_shouldAlwaysFloat() {
return this.floatLabel === "always";
}
_hasOutline() {
return this.appearance === "outline";
}
/**
* Whether the label should display in the infix. Labels in the outline appearance are
* displayed as part of the notched-outline and are horizontally offset to account for
* form field prefix content. This won't work in server side rendering since we cannot
* measure the width of the prefix container. To make the docked label appear as if the
* right offset has been calculated, we forcibly render the label inside the infix. Since
* the label is part of the infix, the label cannot overflow the prefix content.
*/
_forceDisplayInfixLabel() {
return !this._platform.isBrowser && this._prefixChildren.length && !this._shouldLabelFloat();
}
_hasFloatingLabel = computed(() => !!this._labelChild(), ...ngDevMode ? [{
debugName: "_hasFloatingLabel"
}] : []);
_shouldLabelFloat() {
if (!this._hasFloatingLabel()) {
return false;
}
return this._control.shouldLabelFloat || this._shouldAlwaysFloat();
}
/**
* Determines whether a class from the AbstractControlDirective
* should be forwarded to the host element.
*/
_shouldForward(prop) {
const control = this._control ? this._control.ngControl : null;
return control && control[prop];
}
/** Gets the type of subscript message to render (error or hint). */
_getSubscriptMessageType() {
return this._errorChildren && this._errorChildren.length > 0 && this._control.errorState ? "error" : "hint";
}
/** Handle label resize events. */
_handleLabelResized() {
this._refreshOutlineNotchWidth();
}
/** Refreshes the width of the outline-notch, if present. */
_refreshOutlineNotchWidth() {
if (!this._hasOutline() || !this._floatingLabel || !this._shouldLabelFloat()) {
this._notchedOutline?._setNotchWidth(0);
} else {
this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth());
}
}
/** Does any extra processing that is required when handling the hints. */
_processHints() {
this._validateHints();
this._syncDescribedByIds();
}
/**
* Ensure that there is a maximum of one of each "mat-hint" alignment specified. The hint
* label specified set through the input is being considered as "start" aligned.
*
* This method is a noop if Angular runs in production mode.
*/
_validateHints() {
if (this._hintChildren && (typeof ngDevMode === "undefined" || ngDevMode)) {
let startHint;
let endHint;
this._hintChildren.forEach((hint) => {
if (hint.align === "start") {
if (startHint || this.hintLabel) {
throw getMatFormFieldDuplicatedHintError("start");
}
startHint = hint;
} else if (hint.align === "end") {
if (endHint) {
throw getMatFormFieldDuplicatedHintError("end");
}
endHint = hint;
}
});
}
}
/**
* Sets the list of element IDs that describe the child control. This allows the control to update
* its `aria-describedby` attribute accordingly.
*/
_syncDescribedByIds() {
if (this._control) {
let ids = [];
if (this._control.userAriaDescribedBy && typeof this._control.userAriaDescribedBy === "string") {
ids.push(...this._control.userAriaDescribedBy.split(" "));
}
if (this._getSubscriptMessageType() === "hint") {
const startHint = this._hintChildren ? this._hintChildren.find((hint) => hint.align === "start") : null;
const endHint = this._hintChildren ? this._hintChildren.find((hint) => hint.align === "end") : null;
if (startHint) {
ids.push(startHint.id);
} else if (this._hintLabel) {
ids.push(this._hintLabelId);
}
if (endHint) {
ids.push(endHint.id);
}
} else if (this._errorChildren) {
ids.push(...this._errorChildren.map((error) => error.id));
}
const existingDescribedBy = this._control.describedByIds;
let toAssign;
if (existingDescribedBy) {
const exclude = this._describedByIds || ids;
toAssign = ids.concat(existingDescribedBy.filter((id) => id && !exclude.includes(id)));
} else {
toAssign = ids;
}
this._control.setDescribedByIds(toAssign);
this._describedByIds = ids;
}
}
/**
* Calculates the horizontal offset of the label in the outline appearance. In the outline
* appearance, the notched-outline and label are not relative to the infix container because
* the outline intends to surround prefixes, suffixes and the infix. This means that the
* floating label by default overlaps prefixes in the docked state. To avoid this, we need to
* horizontally offset the label by the width of the prefix container. The MDC text-field does
* not need to do this because they use a fixed width for prefixes. Hence, they can simply
* incorporate the horizontal offset into their default text-field styles.
*/
_getOutlinedLabelOffset() {
if (!this._hasOutline() || !this._floatingLabel) {
return null;
}
if (!this._iconPrefixContainer && !this._textPrefixContainer) {
return ["", null];
}
if (!this._isAttachedToDom()) {
return null;
}
const iconPrefixContainer = this._iconPrefixContainer?.nativeElement;
const textPrefixContainer = this._textPrefixContainer?.nativeElement;
const iconSuffixContainer = this._iconSuffixContainer?.nativeElement;
const textSuffixContainer = this._textSuffixContainer?.nativeElement;
const iconPrefixContainerWidth = iconPrefixContainer?.getBoundingClientRect().width ?? 0;
const textPrefixContainerWidth = textPrefixContainer?.getBoundingClientRect().width ?? 0;
const iconSuffixContainerWidth = iconSuffixContainer?.getBoundingClientRect().width ?? 0;
const textSuffixContainerWidth = textSuffixContainer?.getBoundingClientRect().width ?? 0;
const negate = this._currentDirection === "rtl" ? "-1" : "1";
const prefixWidth = `${iconPrefixContainerWidth + textPrefixContainerWidth}px`;
const labelOffset = `var(--mat-mdc-form-field-label-offset-x, 0px)`;
const labelHorizontalOffset = `calc(${negate} * (${prefixWidth} + ${labelOffset}))`;
const floatingLabelTransform = `var(--mat-mdc-form-field-label-transform, ${FLOATING_LABEL_DEFAULT_DOCKED_TRANSFORM} translateX(${labelHorizontalOffset}))`;
const notchedOutlineWidth = iconPrefixContainerWidth + textPrefixContainerWidth + iconSuffixContainerWidth + textSuffixContainerWidth;
return [floatingLabelTransform, notchedOutlineWidth];
}
/** Writes the styles produced by `_getOutlineLabelOffset` synchronously to the DOM. */
_writeOutlinedLabelStyles(styles) {
if (styles !== null) {
const [floatingLabelTransform, notchedOutlineWidth] = styles;
if (this._floatingLabel) {
this._floatingLabel.element.style.transform = floatingLabelTransform;
}
if (notchedOutlineWidth !== null) {
this._notchedOutline?._setMaxWidth(notchedOutlineWidth);
}
}
}
/** Checks whether the form field is attached to the DOM. */
_isAttachedToDom() {
const element = this._elementRef.nativeElement;
if (element.getRootNode) {
const rootNode = element.getRootNode();
return rootNode && rootNode !== element;
}
return document.documentElement.contains(element);
}
static \u0275fac = function MatFormField_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatFormField)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: _MatFormField,
selectors: [["mat-form-field"]],
contentQueries: function MatFormField_ContentQueries(rf, ctx, dirIndex) {
if (rf & 1) {
\u0275\u0275contentQuerySignal(dirIndex, ctx._labelChild, MatLabel, 5);
\u0275\u0275contentQuery(dirIndex, MatFormFieldControl, 5);
\u0275\u0275contentQuery(dirIndex, MAT_PREFIX, 5);
\u0275\u0275contentQuery(dirIndex, MAT_SUFFIX, 5);
\u0275\u0275contentQuery(dirIndex, MAT_ERROR, 5);
\u0275\u0275contentQuery(dirIndex, MatHint, 5);
}
if (rf & 2) {
\u0275\u0275queryAdvance();
let _t;
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._formFieldControl = _t.first);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._prefixChildren = _t);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._suffixChildren = _t);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._errorChildren = _t);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._hintChildren = _t);
}
},
viewQuery: function MatFormField_Query(rf, ctx) {
if (rf & 1) {
\u0275\u0275viewQuerySignal(ctx._iconPrefixContainerSignal, _c32, 5);
\u0275\u0275viewQuerySignal(ctx._textPrefixContainerSignal, _c42, 5);
\u0275\u0275viewQuerySignal(ctx._iconSuffixContainerSignal, _c52, 5);
\u0275\u0275viewQuerySignal(ctx._textSuffixContainerSignal, _c6, 5);
\u0275\u0275viewQuery(_c7, 5);
\u0275\u0275viewQuery(_c32, 5);
\u0275\u0275viewQuery(_c42, 5);
\u0275\u0275viewQuery(_c52, 5);
\u0275\u0275viewQuery(_c6, 5);
\u0275\u0275viewQuery(MatFormFieldFloatingLabel, 5);
\u0275\u0275viewQuery(MatFormFieldNotchedOutline, 5);
\u0275\u0275viewQuery(MatFormFieldLineRipple, 5);
}
if (rf & 2) {
\u0275\u0275queryAdvance(4);
let _t;
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._textField = _t.first);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._iconPrefixContainer = _t.first);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._textPrefixContainer = _t.first);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._iconSuffixContainer = _t.first);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._textSuffixContainer = _t.first);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._floatingLabel = _t.first);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._notchedOutline = _t.first);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._lineRipple = _t.first);
}
},
hostAttrs: [1, "mat-mdc-form-field"],
hostVars: 38,
hostBindings: function MatFormField_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275classProp("mat-mdc-form-field-label-always-float", ctx._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix", ctx._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix", ctx._hasIconSuffix)("mat-form-field-invalid", ctx._control.errorState)("mat-form-field-disabled", ctx._control.disabled)("mat-form-field-autofilled", ctx._control.autofilled)("mat-form-field-appearance-fill", ctx.appearance == "fill")("mat-form-field-appearance-outline", ctx.appearance == "outline")("mat-form-field-hide-placeholder", ctx._hasFloatingLabel() && !ctx._shouldLabelFloat())("mat-primary", ctx.color !== "accent" && ctx.color !== "warn")("mat-accent", ctx.color === "accent")("mat-warn", ctx.color === "warn")("ng-untouched", ctx._shouldForward("untouched"))("ng-touched", ctx._shouldForward("touched"))("ng-pristine", ctx._shouldForward("pristine"))("ng-dirty", ctx._shouldForward("dirty"))("ng-valid", ctx._shouldForward("valid"))("ng-invalid", ctx._shouldForward("invalid"))("ng-pending", ctx._shouldForward("pending"));
}
},
inputs: {
hideRequiredMarker: "hideRequiredMarker",
color: "color",
floatLabel: "floatLabel",
appearance: "appearance",
subscriptSizing: "subscriptSizing",
hintLabel: "hintLabel"
},
exportAs: ["matFormField"],
features: [\u0275\u0275ProvidersFeature([{
provide: MAT_FORM_FIELD,
useExisting: _MatFormField
}, {
provide: FLOATING_LABEL_PARENT,
useExisting: _MatFormField
}])],
ngContentSelectors: _c9,
decls: 19,
vars: 25,
consts: [["labelTemplate", ""], ["textField", ""], ["iconPrefixContainer", ""], ["textPrefixContainer", ""], ["textSuffixContainer", ""], ["iconSuffixContainer", ""], [1, "mat-mdc-text-field-wrapper", "mdc-text-field", 3, "click"], [1, "mat-mdc-form-field-focus-overlay"], [1, "mat-mdc-form-field-flex"], ["matFormFieldNotchedOutline", "", 3, "matFormFieldNotchedOutlineOpen"], [1, "mat-mdc-form-field-icon-prefix"], [1, "mat-mdc-form-field-text-prefix"], [1, "mat-mdc-form-field-infix"], [3, "ngTemplateOutlet"], [1, "mat-mdc-form-field-text-suffix"], [1, "mat-mdc-form-field-icon-suffix"], ["matFormFieldLineRipple", ""], [1, "mat-mdc-form-field-subscript-wrapper", "mat-mdc-form-field-bottom-align"], ["aria-atomic", "true", "aria-live", "polite"], ["matFormFieldFloatingLabel", "", 3, "floating", "monitorResize", "id"], ["aria-hidden", "true", 1, "mat-mdc-form-field-required-marker", "mdc-floating-label--required"], [3, "id"], [1, "mat-mdc-form-field-hint-spacer"]],
template: function MatFormField_Template(rf, ctx) {
if (rf & 1) {
const _r1 = \u0275\u0275getCurrentView();
\u0275\u0275projectionDef(_c8);
\u0275\u0275template(0, MatFormField_ng_template_0_Template, 1, 1, "ng-template", null, 0, \u0275\u0275templateRefExtractor);
\u0275\u0275elementStart(2, "div", 6, 1);
\u0275\u0275listener("click", function MatFormField_Template_div_click_2_listener($event) {
\u0275\u0275restoreView(_r1);
return \u0275\u0275resetView(ctx._control.onContainerClick($event));
});
\u0275\u0275conditionalCreate(4, MatFormField_Conditional_4_Template, 1, 0, "div", 7);
\u0275\u0275elementStart(5, "div", 8);
\u0275\u0275conditionalCreate(6, MatFormField_Conditional_6_Template, 2, 2, "div", 9);
\u0275\u0275conditionalCreate(7, MatFormField_Conditional_7_Template, 3, 0, "div", 10);
\u0275\u0275conditionalCreate(8, MatFormField_Conditional_8_Template, 3, 0, "div", 11);
\u0275\u0275elementStart(9, "div", 12);
\u0275\u0275conditionalCreate(10, MatFormField_Conditional_10_Template, 1, 1, null, 13);
\u0275\u0275projection(11);
\u0275\u0275elementEnd();
\u0275\u0275conditionalCreate(12, MatFormField_Conditional_12_Template, 3, 0, "div", 14);
\u0275\u0275conditionalCreate(13, MatFormField_Conditional_13_Template, 3, 0, "div", 15);
\u0275\u0275elementEnd();
\u0275\u0275conditionalCreate(14, MatFormField_Conditional_14_Template, 1, 0, "div", 16);
\u0275\u0275elementEnd();
\u0275\u0275elementStart(15, "div", 17)(16, "div", 18);
\u0275\u0275conditionalCreate(17, MatFormField_Case_17_Template, 1, 0)(18, MatFormField_Case_18_Template, 4, 1);
\u0275\u0275elementEnd()();
}
if (rf & 2) {
let tmp_19_0;
\u0275\u0275advance(2);
\u0275\u0275classProp("mdc-text-field--filled", !ctx._hasOutline())("mdc-text-field--outlined", ctx._hasOutline())("mdc-text-field--no-label", !ctx._hasFloatingLabel())("mdc-text-field--disabled", ctx._control.disabled)("mdc-text-field--invalid", ctx._control.errorState);
\u0275\u0275advance(2);
\u0275\u0275conditional(!ctx._hasOutline() && !ctx._control.disabled ? 4 : -1);
\u0275\u0275advance(2);
\u0275\u0275conditional(ctx._hasOutline() ? 6 : -1);
\u0275\u0275advance();
\u0275\u0275conditional(ctx._hasIconPrefix ? 7 : -1);
\u0275\u0275advance();
\u0275\u0275conditional(ctx._hasTextPrefix ? 8 : -1);
\u0275\u0275advance(2);
\u0275\u0275conditional(!ctx._hasOutline() || ctx._forceDisplayInfixLabel() ? 10 : -1);
\u0275\u0275advance(2);
\u0275\u0275conditional(ctx._hasTextSuffix ? 12 : -1);
\u0275\u0275advance();
\u0275\u0275conditional(ctx._hasIconSuffix ? 13 : -1);
\u0275\u0275advance();
\u0275\u0275conditional(!ctx._hasOutline() ? 14 : -1);
\u0275\u0275advance();
\u0275\u0275classProp("mat-mdc-form-field-subscript-dynamic-size", ctx.subscriptSizing === "dynamic");
const subscriptMessageType_r4 = ctx._getSubscriptMessageType();
\u0275\u0275advance();
\u0275\u0275classProp("mat-mdc-form-field-error-wrapper", subscriptMessageType_r4 === "error")("mat-mdc-form-field-hint-wrapper", subscriptMessageType_r4 === "hint");
\u0275\u0275advance();
\u0275\u0275conditional((tmp_19_0 = subscriptMessageType_r4) === "error" ? 17 : tmp_19_0 === "hint" ? 18 : -1);
}
},
dependencies: [MatFormFieldFloatingLabel, MatFormFieldNotchedOutline, NgTemplateOutlet, MatFormFieldLineRipple, MatHint],
styles: ['.mdc-text-field{display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field__input{width:100%;min-width:0;border:none;border-radius:0;background:none;padding:0;-moz-appearance:none;-webkit-appearance:none;height:28px}.mdc-text-field__input::-webkit-calendar-picker-indicator,.mdc-text-field__input::-webkit-search-cancel-button{display:none}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}.mdc-text-field__input::placeholder{opacity:0}.mdc-text-field__input::-moz-placeholder{opacity:0}.mdc-text-field__input::-webkit-input-placeholder{opacity:0}.mdc-text-field__input:-ms-input-placeholder{opacity:0}.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-moz-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-webkit-input-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive:-ms-input-placeholder{opacity:0}.mdc-text-field--outlined .mdc-text-field__input,.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-filled-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-filled-caret-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-outlined-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-outlined-caret-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-filled-error-caret-color, var(--mat-sys-error))}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-outlined-error-caret-color, var(--mat-sys-error))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-filled-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-outlined-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}}.mdc-text-field--filled{height:56px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mat-form-field-filled-container-color, var(--mat-sys-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mat-form-field-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 4%, transparent))}.mdc-text-field--outlined{height:56px;overflow:visible;padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)));padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px)}[dir=rtl] .mdc-text-field--outlined{padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px);padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}.mdc-floating-label{position:absolute;left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:auto}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label{left:auto;right:4px}.mdc-text-field--filled .mdc-floating-label{left:16px;right:auto}[dir=rtl] .mdc-text-field--filled .mdc-floating-label{left:auto;right:16px}.mdc-text-field--disabled .mdc-floating-label{cursor:default}@media(forced-colors: active){.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-filled-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-filled-hover-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-filled-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-filled-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mat-form-field-filled-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-filled-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-filled-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-filled-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-outlined-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-outlined-hover-label-text-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-outlined-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-outlined-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mat-form-field-outlined-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-outlined-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-outlined-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-outlined-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-floating-label--float-above{cursor:auto;transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1);font-size:.75rem}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline{text-align:right}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mat-mdc-notch-piece{box-sizing:border-box;height:100%;pointer-events:none;border-top:1px solid;border-bottom:1px solid}.mdc-text-field--focused .mat-mdc-notch-piece{border-width:2px}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-outline-color, var(--mat-sys-outline));border-width:var(--mat-form-field-outlined-outline-width, 1px)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-hover-outline-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-focus-outline-color, var(--mat-sys-primary))}.mdc-text-field--outlined.mdc-text-field--disabled .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-notched-outline .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-hover-outline-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-focus-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mat-mdc-notch-piece{border-width:var(--mat-form-field-outlined-focus-outline-width, 2px)}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}[dir=rtl] .mdc-notched-outline__leading{border-left:none;border-right:1px solid;border-bottom-left-radius:0;border-top-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__trailing{flex-grow:1;border-left:none;border-right:1px solid;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}[dir=rtl] .mdc-notched-outline__trailing{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:min(var(--mat-form-field-notch-max-width, 100%),calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{max-width:min(100%,calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1;border-bottom-width:var(--mat-form-field-filled-active-indicator-height, 1px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-active-indicator-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-hover-active-indicator-color, var(--mat-sys-on-surface))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-disabled-active-indicator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-active-indicator-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-hover-active-indicator-color, var(--mat-sys-on-error-container))}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mat-form-field-filled-focus-active-indicator-height, 2px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-focus-active-indicator-color, var(--mat-sys-primary))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-error-focus-active-indicator-color, var(--mat-sys-error))}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-text-field--disabled{pointer-events:none}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height, 56px);padding-top:var(--mat-form-field-filled-with-label-container-padding-top, 24px);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom, 8px)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding, 16px);padding-bottom:var(--mat-form-field-container-vertical-padding, 16px)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height, 56px)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height, 56px) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}@keyframes _mat-form-field-subscript-animation{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px;opacity:1;transform:translateY(0);animation:_mat-form-field-subscript-animation 0ms cubic-bezier(0.55, 0, 0.55, 0.2)}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color, var(--mat-sys-error))}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));letter-spacing:var(--mat-form-field-subscript-text-tracking, var(--mat-sys-body-small-tracking));font-weight:var(--mat-form-field-subscript-text-weight, var(--mat-sys-body-small-weight))}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color, var(--mat-sys-on-surface))}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity, 0)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color, var(--mat-sys-neutral10))}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color, color-mix(in srgb, var(--mat-sys-neutral10) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color, var(--mat-sys-on-surface-variant))}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}@media(forced-colors: active){.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}}@media(forced-colors: active){.mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-form-field-container-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-form-field-container-text-tracking, var(--mat-sys-body-large-tracking));font-weight:var(--mat-form-field-container-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color, var(--mat-sys-error))}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color, var(--mat-sys-on-error-container))}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color, var(--mat-sys-error))}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field-infix:has(textarea[cols]){width:auto}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input{transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-moz-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-webkit-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-error-wrapper{animation-duration:300ms}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)}\n'],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFormField, [{
type: Component,
args: [{
selector: "mat-form-field",
exportAs: "matFormField",
host: {
"class": "mat-mdc-form-field",
"[class.mat-mdc-form-field-label-always-float]": "_shouldAlwaysFloat()",
"[class.mat-mdc-form-field-has-icon-prefix]": "_hasIconPrefix",
"[class.mat-mdc-form-field-has-icon-suffix]": "_hasIconSuffix",
// Note that these classes reuse the same names as the non-MDC version, because they can be
// considered a public API since custom form controls may use them to style themselves.
// See https://github.com/angular/components/pull/20502#discussion_r486124901.
"[class.mat-form-field-invalid]": "_control.errorState",
"[class.mat-form-field-disabled]": "_control.disabled",
"[class.mat-form-field-autofilled]": "_control.autofilled",
"[class.mat-form-field-appearance-fill]": 'appearance == "fill"',
"[class.mat-form-field-appearance-outline]": 'appearance == "outline"',
"[class.mat-form-field-hide-placeholder]": "_hasFloatingLabel() && !_shouldLabelFloat()",
"[class.mat-primary]": 'color !== "accent" && color !== "warn"',
"[class.mat-accent]": 'color === "accent"',
"[class.mat-warn]": 'color === "warn"',
"[class.ng-untouched]": '_shouldForward("untouched")',
"[class.ng-touched]": '_shouldForward("touched")',
"[class.ng-pristine]": '_shouldForward("pristine")',
"[class.ng-dirty]": '_shouldForward("dirty")',
"[class.ng-valid]": '_shouldForward("valid")',
"[class.ng-invalid]": '_shouldForward("invalid")',
"[class.ng-pending]": '_shouldForward("pending")'
},
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [{
provide: MAT_FORM_FIELD,
useExisting: MatFormField
}, {
provide: FLOATING_LABEL_PARENT,
useExisting: MatFormField
}],
imports: [MatFormFieldFloatingLabel, MatFormFieldNotchedOutline, NgTemplateOutlet, MatFormFieldLineRipple, MatHint],
template: '<ng-template #labelTemplate>\n <!--\n MDC recommends that the text-field is a `<label>` element. This rather complicates the\n setup because it would require every form-field control to explicitly set `aria-labelledby`.\n This is because the `<label>` itself contains more than the actual label (e.g. prefix, suffix\n or other projected content), and screen readers could potentially read out undesired content.\n Excluding elements from being printed out requires them to be marked with `aria-hidden`, or\n the form control is set to a scoped element for the label (using `aria-labelledby`). Both of\n these options seem to complicate the setup because we know exactly what content is rendered\n as part of the label, and we don\'t want to spend resources on walking through projected content\n to set `aria-hidden`. Nor do we want to set `aria-labelledby` on every form control if we could\n simply link the label to the control using the label `for` attribute.\n -->\n @if (_hasFloatingLabel()) {\n <label\n matFormFieldFloatingLabel\n [floating]="_shouldLabelFloat()"\n [monitorResize]="_hasOutline()"\n [id]="_labelId"\n [attr.for]="_control.disableAutomaticLabeling ? null : _control.id"\n >\n <ng-content select="mat-label"></ng-content>\n <!--\n We set the required marker as a separate element, in order to make it easier to target if\n apps want to override it and to be able to set `aria-hidden` so that screen readers don\'t\n pick it up.\n -->\n @if (!hideRequiredMarker && _control.required) {\n <span\n aria-hidden="true"\n class="mat-mdc-form-field-required-marker mdc-floating-label--required"\n ></span>\n }\n </label>\n }\n</ng-template>\n\n<div\n class="mat-mdc-text-field-wrapper mdc-text-field"\n #textField\n [class.mdc-text-field--filled]="!_hasOutline()"\n [class.mdc-text-field--outlined]="_hasOutline()"\n [class.mdc-text-field--no-label]="!_hasFloatingLabel()"\n [class.mdc-text-field--disabled]="_control.disabled"\n [class.mdc-text-field--invalid]="_control.errorState"\n (click)="_control.onContainerClick($event)"\n>\n @if (!_hasOutline() && !_control.disabled) {\n <div class="mat-mdc-form-field-focus-overlay"></div>\n }\n <div class="mat-mdc-form-field-flex">\n @if (_hasOutline()) {\n <div matFormFieldNotchedOutline [matFormFieldNotchedOutlineOpen]="_shouldLabelFloat()">\n @if (!_forceDisplayInfixLabel()) {\n <ng-template [ngTemplateOutlet]="labelTemplate"></ng-template>\n }\n </div>\n }\n\n @if (_hasIconPrefix) {\n <div class="mat-mdc-form-field-icon-prefix" #iconPrefixContainer>\n <ng-content select="[matPrefix], [matIconPrefix]"></ng-content>\n </div>\n }\n\n @if (_hasTextPrefix) {\n <div class="mat-mdc-form-field-text-prefix" #textPrefixContainer>\n <ng-content select="[matTextPrefix]"></ng-content>\n </div>\n }\n\n <div class="mat-mdc-form-field-infix">\n @if (!_hasOutline() || _forceDisplayInfixLabel()) {\n <ng-template [ngTemplateOutlet]="labelTemplate"></ng-template>\n }\n\n <ng-content></ng-content>\n </div>\n\n @if (_hasTextSuffix) {\n <div class="mat-mdc-form-field-text-suffix" #textSuffixContainer>\n <ng-content select="[matTextSuffix]"></ng-content>\n </div>\n }\n\n @if (_hasIconSuffix) {\n <div class="mat-mdc-form-field-icon-suffix" #iconSuffixContainer>\n <ng-content select="[matSuffix], [matIconSuffix]"></ng-content>\n </div>\n }\n </div>\n\n @if (!_hasOutline()) {\n <div matFormFieldLineRipple></div>\n }\n</div>\n\n<div\n class="mat-mdc-form-field-subscript-wrapper mat-mdc-form-field-bottom-align"\n [class.mat-mdc-form-field-subscript-dynamic-size]="subscriptSizing === \'dynamic\'"\n>\n @let subscriptMessageType = _getSubscriptMessageType();\n\n <!-- \n Use a single permanent wrapper for both hints and errors so aria-live works correctly,\n as having it appear post render will not consistently work. We also do not want to add\n additional divs as it causes styling regressions.\n -->\n <div aria-atomic="true" aria-live="polite" \n [class.mat-mdc-form-field-error-wrapper]="subscriptMessageType === \'error\'"\n [class.mat-mdc-form-field-hint-wrapper]="subscriptMessageType === \'hint\'"\n >\n @switch (subscriptMessageType) {\n @case (\'error\') {\n <ng-content select="mat-error, [matError]"></ng-content>\n }\n\n @case (\'hint\') {\n @if (hintLabel) {\n <mat-hint [id]="_hintLabelId">{{hintLabel}}</mat-hint>\n }\n <ng-content select="mat-hint:not([align=\'end\'])"></ng-content>\n <div class="mat-mdc-form-field-hint-spacer"></div>\n <ng-content select="mat-hint[align=\'end\']"></ng-content>\n }\n }\n </div>\n</div>\n',
styles: ['.mdc-text-field{display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field__input{width:100%;min-width:0;border:none;border-radius:0;background:none;padding:0;-moz-appearance:none;-webkit-appearance:none;height:28px}.mdc-text-field__input::-webkit-calendar-picker-indicator,.mdc-text-field__input::-webkit-search-cancel-button{display:none}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}.mdc-text-field__input::placeholder{opacity:0}.mdc-text-field__input::-moz-placeholder{opacity:0}.mdc-text-field__input::-webkit-input-placeholder{opacity:0}.mdc-text-field__input:-ms-input-placeholder{opacity:0}.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-moz-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-webkit-input-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive:-ms-input-placeholder{opacity:0}.mdc-text-field--outlined .mdc-text-field__input,.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-filled-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-filled-caret-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-outlined-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-outlined-caret-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-filled-error-caret-color, var(--mat-sys-error))}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-outlined-error-caret-color, var(--mat-sys-error))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-filled-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-outlined-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}}.mdc-text-field--filled{height:56px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mat-form-field-filled-container-color, var(--mat-sys-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mat-form-field-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 4%, transparent))}.mdc-text-field--outlined{height:56px;overflow:visible;padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)));padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px)}[dir=rtl] .mdc-text-field--outlined{padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px);padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}.mdc-floating-label{position:absolute;left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:auto}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label{left:auto;right:4px}.mdc-text-field--filled .mdc-floating-label{left:16px;right:auto}[dir=rtl] .mdc-text-field--filled .mdc-floating-label{left:auto;right:16px}.mdc-text-field--disabled .mdc-floating-label{cursor:default}@media(forced-colors: active){.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-filled-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-filled-hover-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-filled-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-filled-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mat-form-field-filled-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-filled-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-filled-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-filled-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-outlined-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-outlined-hover-label-text-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-outlined-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-outlined-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mat-form-field-outlined-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-outlined-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-outlined-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-outlined-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-floating-label--float-above{cursor:auto;transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1);font-size:.75rem}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline{text-align:right}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mat-mdc-notch-piece{box-sizing:border-box;height:100%;pointer-events:none;border-top:1px solid;border-bottom:1px solid}.mdc-text-field--focused .mat-mdc-notch-piece{border-width:2px}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-outline-color, var(--mat-sys-outline));border-width:var(--mat-form-field-outlined-outline-width, 1px)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-hover-outline-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-focus-outline-color, var(--mat-sys-primary))}.mdc-text-field--outlined.mdc-text-field--disabled .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-notched-outline .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-hover-outline-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-focus-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mat-mdc-notch-piece{border-width:var(--mat-form-field-outlined-focus-outline-width, 2px)}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}[dir=rtl] .mdc-notched-outline__leading{border-left:none;border-right:1px solid;border-bottom-left-radius:0;border-top-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__trailing{flex-grow:1;border-left:none;border-right:1px solid;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}[dir=rtl] .mdc-notched-outline__trailing{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:min(var(--mat-form-field-notch-max-width, 100%),calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{max-width:min(100%,calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1;border-bottom-width:var(--mat-form-field-filled-active-indicator-height, 1px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-active-indicator-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-hover-active-indicator-color, var(--mat-sys-on-surface))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-disabled-active-indicator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-active-indicator-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-hover-active-indicator-color, var(--mat-sys-on-error-container))}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mat-form-field-filled-focus-active-indicator-height, 2px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-focus-active-indicator-color, var(--mat-sys-primary))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-error-focus-active-indicator-color, var(--mat-sys-error))}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-text-field--disabled{pointer-events:none}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height, 56px);padding-top:var(--mat-form-field-filled-with-label-container-padding-top, 24px);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom, 8px)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding, 16px);padding-bottom:var(--mat-form-field-container-vertical-padding, 16px)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height, 56px)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height, 56px) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}@keyframes _mat-form-field-subscript-animation{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px;opacity:1;transform:translateY(0);animation:_mat-form-field-subscript-animation 0ms cubic-bezier(0.55, 0, 0.55, 0.2)}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color, var(--mat-sys-error))}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));letter-spacing:var(--mat-form-field-subscript-text-tracking, var(--mat-sys-body-small-tracking));font-weight:var(--mat-form-field-subscript-text-weight, var(--mat-sys-body-small-weight))}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color, var(--mat-sys-on-surface))}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity, 0)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color, var(--mat-sys-neutral10))}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color, color-mix(in srgb, var(--mat-sys-neutral10) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color, var(--mat-sys-on-surface-variant))}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}@media(forced-colors: active){.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}}@media(forced-colors: active){.mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-form-field-container-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-form-field-container-text-tracking, var(--mat-sys-body-large-tracking));font-weight:var(--mat-form-field-container-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color, var(--mat-sys-error))}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color, var(--mat-sys-on-error-container))}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color, var(--mat-sys-error))}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field-infix:has(textarea[cols]){width:auto}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input{transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-moz-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-webkit-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-error-wrapper{animation-duration:300ms}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)}\n']
}]
}], () => [], {
_textField: [{
type: ViewChild,
args: ["textField"]
}],
_iconPrefixContainer: [{
type: ViewChild,
args: ["iconPrefixContainer"]
}],
_textPrefixContainer: [{
type: ViewChild,
args: ["textPrefixContainer"]
}],
_iconSuffixContainer: [{
type: ViewChild,
args: ["iconSuffixContainer"]
}],
_textSuffixContainer: [{
type: ViewChild,
args: ["textSuffixContainer"]
}],
_floatingLabel: [{
type: ViewChild,
args: [MatFormFieldFloatingLabel]
}],
_notchedOutline: [{
type: ViewChild,
args: [MatFormFieldNotchedOutline]
}],
_lineRipple: [{
type: ViewChild,
args: [MatFormFieldLineRipple]
}],
_formFieldControl: [{
type: ContentChild,
args: [MatFormFieldControl]
}],
_prefixChildren: [{
type: ContentChildren,
args: [MAT_PREFIX, {
descendants: true
}]
}],
_suffixChildren: [{
type: ContentChildren,
args: [MAT_SUFFIX, {
descendants: true
}]
}],
_errorChildren: [{
type: ContentChildren,
args: [MAT_ERROR, {
descendants: true
}]
}],
_hintChildren: [{
type: ContentChildren,
args: [MatHint, {
descendants: true
}]
}],
hideRequiredMarker: [{
type: Input
}],
color: [{
type: Input
}],
floatLabel: [{
type: Input
}],
appearance: [{
type: Input
}],
subscriptSizing: [{
type: Input
}],
hintLabel: [{
type: Input
}]
});
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/form-field-module.mjs
var MatFormFieldModule = class _MatFormFieldModule {
static \u0275fac = function MatFormFieldModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatFormFieldModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _MatFormFieldModule,
imports: [MatCommonModule, ObserversModule, MatFormField, MatLabel, MatError, MatHint, MatPrefix, MatSuffix],
exports: [MatFormField, MatLabel, MatHint, MatError, MatPrefix, MatSuffix, MatCommonModule]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
imports: [MatCommonModule, ObserversModule, MatFormField, MatCommonModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFormFieldModule, [{
type: NgModule,
args: [{
imports: [MatCommonModule, ObserversModule, MatFormField, MatLabel, MatError, MatHint, MatPrefix, MatSuffix],
exports: [MatFormField, MatLabel, MatHint, MatError, MatPrefix, MatSuffix, MatCommonModule]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/text-field.mjs
var _CdkTextFieldStyleLoader = class __CdkTextFieldStyleLoader {
static \u0275fac = function _CdkTextFieldStyleLoader_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || __CdkTextFieldStyleLoader)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: __CdkTextFieldStyleLoader,
selectors: [["ng-component"]],
hostAttrs: ["cdk-text-field-style-loader", ""],
decls: 0,
vars: 0,
template: function _CdkTextFieldStyleLoader_Template(rf, ctx) {
},
styles: ["textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms}\n"],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(_CdkTextFieldStyleLoader, [{
type: Component,
args: [{
template: "",
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
"cdk-text-field-style-loader": ""
},
styles: ["textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms}\n"]
}]
}], null, null);
})();
var listenerOptions = {
passive: true
};
var AutofillMonitor = class _AutofillMonitor {
_platform = inject2(Platform);
_ngZone = inject2(NgZone);
_renderer = inject2(RendererFactory2).createRenderer(null, null);
_styleLoader = inject2(_CdkPrivateStyleLoader);
_monitoredElements = /* @__PURE__ */ new Map();
constructor() {
}
monitor(elementOrRef) {
if (!this._platform.isBrowser) {
return EMPTY;
}
this._styleLoader.load(_CdkTextFieldStyleLoader);
const element = coerceElement(elementOrRef);
const info = this._monitoredElements.get(element);
if (info) {
return info.subject;
}
const subject = new Subject();
const cssClass = "cdk-text-field-autofilled";
const listener = (event) => {
if (event.animationName === "cdk-text-field-autofill-start" && !element.classList.contains(cssClass)) {
element.classList.add(cssClass);
this._ngZone.run(() => subject.next({
target: event.target,
isAutofilled: true
}));
} else if (event.animationName === "cdk-text-field-autofill-end" && element.classList.contains(cssClass)) {
element.classList.remove(cssClass);
this._ngZone.run(() => subject.next({
target: event.target,
isAutofilled: false
}));
}
};
const unlisten = this._ngZone.runOutsideAngular(() => {
element.classList.add("cdk-text-field-autofill-monitored");
return this._renderer.listen(element, "animationstart", listener, listenerOptions);
});
this._monitoredElements.set(element, {
subject,
unlisten
});
return subject;
}
stopMonitoring(elementOrRef) {
const element = coerceElement(elementOrRef);
const info = this._monitoredElements.get(element);
if (info) {
info.unlisten();
info.subject.complete();
element.classList.remove("cdk-text-field-autofill-monitored");
element.classList.remove("cdk-text-field-autofilled");
this._monitoredElements.delete(element);
}
}
ngOnDestroy() {
this._monitoredElements.forEach((_info, element) => this.stopMonitoring(element));
}
static \u0275fac = function AutofillMonitor_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _AutofillMonitor)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _AutofillMonitor,
factory: _AutofillMonitor.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AutofillMonitor, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var CdkAutofill = class _CdkAutofill {
_elementRef = inject2(ElementRef);
_autofillMonitor = inject2(AutofillMonitor);
/** Emits when the autofill state of the element changes. */
cdkAutofill = new EventEmitter();
constructor() {
}
ngOnInit() {
this._autofillMonitor.monitor(this._elementRef).subscribe((event) => this.cdkAutofill.emit(event));
}
ngOnDestroy() {
this._autofillMonitor.stopMonitoring(this._elementRef);
}
static \u0275fac = function CdkAutofill_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkAutofill)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkAutofill,
selectors: [["", "cdkAutofill", ""]],
outputs: {
cdkAutofill: "cdkAutofill"
}
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkAutofill, [{
type: Directive,
args: [{
selector: "[cdkAutofill]"
}]
}], () => [], {
cdkAutofill: [{
type: Output
}]
});
})();
var CdkTextareaAutosize = class _CdkTextareaAutosize {
_elementRef = inject2(ElementRef);
_platform = inject2(Platform);
_ngZone = inject2(NgZone);
_renderer = inject2(Renderer2);
_resizeEvents = new Subject();
/** Keep track of the previous textarea value to avoid resizing when the value hasn't changed. */
_previousValue;
_initialHeight;
_destroyed = new Subject();
_listenerCleanups;
_minRows;
_maxRows;
_enabled = true;
/**
* Value of minRows as of last resize. If the minRows has decreased, the
* height of the textarea needs to be recomputed to reflect the new minimum. The maxHeight
* does not have the same problem because it does not affect the textarea's scrollHeight.
*/
_previousMinRows = -1;
_textareaElement;
/** Minimum amount of rows in the textarea. */
get minRows() {
return this._minRows;
}
set minRows(value) {
this._minRows = coerceNumberProperty(value);
this._setMinHeight();
}
/** Maximum amount of rows in the textarea. */
get maxRows() {
return this._maxRows;
}
set maxRows(value) {
this._maxRows = coerceNumberProperty(value);
this._setMaxHeight();
}
/** Whether autosizing is enabled or not */
get enabled() {
return this._enabled;
}
set enabled(value) {
if (this._enabled !== value) {
(this._enabled = value) ? this.resizeToFitContent(true) : this.reset();
}
}
get placeholder() {
return this._textareaElement.placeholder;
}
set placeholder(value) {
this._cachedPlaceholderHeight = void 0;
if (value) {
this._textareaElement.setAttribute("placeholder", value);
} else {
this._textareaElement.removeAttribute("placeholder");
}
this._cacheTextareaPlaceholderHeight();
}
/** Cached height of a textarea with a single row. */
_cachedLineHeight;
/** Cached height of a textarea with only the placeholder. */
_cachedPlaceholderHeight;
/** Cached scroll top of a textarea */
_cachedScrollTop;
/** Used to reference correct document/window */
_document = inject2(DOCUMENT);
_hasFocus;
_isViewInited = false;
constructor() {
const styleLoader = inject2(_CdkPrivateStyleLoader);
styleLoader.load(_CdkTextFieldStyleLoader);
this._textareaElement = this._elementRef.nativeElement;
}
/** Sets the minimum height of the textarea as determined by minRows. */
_setMinHeight() {
const minHeight = this.minRows && this._cachedLineHeight ? `${this.minRows * this._cachedLineHeight}px` : null;
if (minHeight) {
this._textareaElement.style.minHeight = minHeight;
}
}
/** Sets the maximum height of the textarea as determined by maxRows. */
_setMaxHeight() {
const maxHeight = this.maxRows && this._cachedLineHeight ? `${this.maxRows * this._cachedLineHeight}px` : null;
if (maxHeight) {
this._textareaElement.style.maxHeight = maxHeight;
}
}
ngAfterViewInit() {
if (this._platform.isBrowser) {
this._initialHeight = this._textareaElement.style.height;
this.resizeToFitContent();
this._ngZone.runOutsideAngular(() => {
this._listenerCleanups = [this._renderer.listen("window", "resize", () => this._resizeEvents.next()), this._renderer.listen(this._textareaElement, "focus", this._handleFocusEvent), this._renderer.listen(this._textareaElement, "blur", this._handleFocusEvent)];
this._resizeEvents.pipe(auditTime(16)).subscribe(() => {
this._cachedLineHeight = this._cachedPlaceholderHeight = void 0;
this.resizeToFitContent(true);
});
});
this._isViewInited = true;
this.resizeToFitContent(true);
}
}
ngOnDestroy() {
this._listenerCleanups?.forEach((cleanup) => cleanup());
this._resizeEvents.complete();
this._destroyed.next();
this._destroyed.complete();
}
/**
* Cache the height of a single-row textarea if it has not already been cached.
*
* We need to know how large a single "row" of a textarea is in order to apply minRows and
* maxRows. For the initial version, we will assume that the height of a single line in the
* textarea does not ever change.
*/
_cacheTextareaLineHeight() {
if (this._cachedLineHeight) {
return;
}
const textareaClone = this._textareaElement.cloneNode(false);
const cloneStyles = textareaClone.style;
textareaClone.rows = 1;
cloneStyles.position = "absolute";
cloneStyles.visibility = "hidden";
cloneStyles.border = "none";
cloneStyles.padding = "0";
cloneStyles.height = "";
cloneStyles.minHeight = "";
cloneStyles.maxHeight = "";
cloneStyles.top = cloneStyles.bottom = cloneStyles.left = cloneStyles.right = "auto";
cloneStyles.overflow = "hidden";
this._textareaElement.parentNode.appendChild(textareaClone);
this._cachedLineHeight = textareaClone.clientHeight;
textareaClone.remove();
this._setMinHeight();
this._setMaxHeight();
}
_measureScrollHeight() {
const element = this._textareaElement;
const previousMargin = element.style.marginBottom || "";
const isFirefox = this._platform.FIREFOX;
const needsMarginFiller = isFirefox && this._hasFocus;
const measuringClass = isFirefox ? "cdk-textarea-autosize-measuring-firefox" : "cdk-textarea-autosize-measuring";
if (needsMarginFiller) {
element.style.marginBottom = `${element.clientHeight}px`;
}
element.classList.add(measuringClass);
const scrollHeight = element.scrollHeight - 4;
element.classList.remove(measuringClass);
if (needsMarginFiller) {
element.style.marginBottom = previousMargin;
}
return scrollHeight;
}
_cacheTextareaPlaceholderHeight() {
if (!this._isViewInited || this._cachedPlaceholderHeight != void 0) {
return;
}
if (!this.placeholder) {
this._cachedPlaceholderHeight = 0;
return;
}
const value = this._textareaElement.value;
this._textareaElement.value = this._textareaElement.placeholder;
this._cachedPlaceholderHeight = this._measureScrollHeight();
this._textareaElement.value = value;
}
/** Handles `focus` and `blur` events. */
_handleFocusEvent = (event) => {
this._hasFocus = event.type === "focus";
};
ngDoCheck() {
if (this._platform.isBrowser) {
this.resizeToFitContent();
}
}
/**
* Resize the textarea to fit its content.
* @param force Whether to force a height recalculation. By default the height will be
* recalculated only if the value changed since the last call.
*/
resizeToFitContent(force = false) {
if (!this._enabled) {
return;
}
this._cacheTextareaLineHeight();
this._cacheTextareaPlaceholderHeight();
this._cachedScrollTop = this._textareaElement.scrollTop;
if (!this._cachedLineHeight) {
return;
}
const textarea = this._elementRef.nativeElement;
const value = textarea.value;
if (!force && this._minRows === this._previousMinRows && value === this._previousValue) {
return;
}
const scrollHeight = this._measureScrollHeight();
const height = Math.max(scrollHeight, this._cachedPlaceholderHeight || 0);
textarea.style.height = `${height}px`;
this._ngZone.runOutsideAngular(() => {
if (typeof requestAnimationFrame !== "undefined") {
requestAnimationFrame(() => this._scrollToCaretPosition(textarea));
} else {
setTimeout(() => this._scrollToCaretPosition(textarea));
}
});
this._previousValue = value;
this._previousMinRows = this._minRows;
}
/**
* Resets the textarea to its original size
*/
reset() {
if (this._initialHeight !== void 0) {
this._textareaElement.style.height = this._initialHeight;
}
}
_noopInputHandler() {
}
/**
* Scrolls a textarea to the caret position. On Firefox resizing the textarea will
* prevent it from scrolling to the caret position. We need to re-set the selection
* in order for it to scroll to the proper position.
*/
_scrollToCaretPosition(textarea) {
const {
selectionStart,
selectionEnd
} = textarea;
if (!this._destroyed.isStopped && this._hasFocus) {
textarea.setSelectionRange(selectionStart, selectionEnd);
textarea.scrollTop = this._cachedScrollTop;
}
}
static \u0275fac = function CdkTextareaAutosize_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkTextareaAutosize)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkTextareaAutosize,
selectors: [["textarea", "cdkTextareaAutosize", ""]],
hostAttrs: ["rows", "1", 1, "cdk-textarea-autosize"],
hostBindings: function CdkTextareaAutosize_HostBindings(rf, ctx) {
if (rf & 1) {
\u0275\u0275listener("input", function CdkTextareaAutosize_input_HostBindingHandler() {
return ctx._noopInputHandler();
});
}
},
inputs: {
minRows: [0, "cdkAutosizeMinRows", "minRows"],
maxRows: [0, "cdkAutosizeMaxRows", "maxRows"],
enabled: [2, "cdkTextareaAutosize", "enabled", booleanAttribute],
placeholder: "placeholder"
},
exportAs: ["cdkTextareaAutosize"]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkTextareaAutosize, [{
type: Directive,
args: [{
selector: "textarea[cdkTextareaAutosize]",
exportAs: "cdkTextareaAutosize",
host: {
"class": "cdk-textarea-autosize",
// Textarea elements that have the directive applied should have a single row by default.
// Browsers normally show two rows by default and therefore this limits the minRows binding.
"rows": "1",
"(input)": "_noopInputHandler()"
}
}]
}], () => [], {
minRows: [{
type: Input,
args: ["cdkAutosizeMinRows"]
}],
maxRows: [{
type: Input,
args: ["cdkAutosizeMaxRows"]
}],
enabled: [{
type: Input,
args: [{
alias: "cdkTextareaAutosize",
transform: booleanAttribute
}]
}],
placeholder: [{
type: Input
}]
});
})();
var TextFieldModule = class _TextFieldModule {
static \u0275fac = function TextFieldModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _TextFieldModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _TextFieldModule,
imports: [CdkAutofill, CdkTextareaAutosize],
exports: [CdkAutofill, CdkTextareaAutosize]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TextFieldModule, [{
type: NgModule,
args: [{
imports: [CdkAutofill, CdkTextareaAutosize],
exports: [CdkAutofill, CdkTextareaAutosize]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/input-value-accessor.mjs
var MAT_INPUT_VALUE_ACCESSOR = new InjectionToken("MAT_INPUT_VALUE_ACCESSOR");
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/error-options.mjs
var ShowOnDirtyErrorStateMatcher = class _ShowOnDirtyErrorStateMatcher {
isErrorState(control, form) {
return !!(control && control.invalid && (control.dirty || form && form.submitted));
}
static \u0275fac = function ShowOnDirtyErrorStateMatcher_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ShowOnDirtyErrorStateMatcher)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _ShowOnDirtyErrorStateMatcher,
factory: _ShowOnDirtyErrorStateMatcher.\u0275fac
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ShowOnDirtyErrorStateMatcher, [{
type: Injectable
}], null, null);
})();
var ErrorStateMatcher = class _ErrorStateMatcher {
isErrorState(control, form) {
return !!(control && control.invalid && (control.touched || form && form.submitted));
}
static \u0275fac = function ErrorStateMatcher_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ErrorStateMatcher)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _ErrorStateMatcher,
factory: _ErrorStateMatcher.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ErrorStateMatcher, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/error-state.mjs
var _ErrorStateTracker = class {
_defaultMatcher;
ngControl;
_parentFormGroup;
_parentForm;
_stateChanges;
/** Whether the tracker is currently in an error state. */
errorState = false;
/** User-defined matcher for the error state. */
matcher;
constructor(_defaultMatcher, ngControl, _parentFormGroup, _parentForm, _stateChanges) {
this._defaultMatcher = _defaultMatcher;
this.ngControl = ngControl;
this._parentFormGroup = _parentFormGroup;
this._parentForm = _parentForm;
this._stateChanges = _stateChanges;
}
/** Updates the error state based on the provided error state matcher. */
updateErrorState() {
const oldState = this.errorState;
const parent = this._parentFormGroup || this._parentForm;
const matcher = this.matcher || this._defaultMatcher;
const control = this.ngControl ? this.ngControl.control : null;
const newState = matcher?.isErrorState(control, parent) ?? false;
if (newState !== oldState) {
this.errorState = newState;
this._stateChanges.next();
}
}
};
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/input.mjs
function getMatInputUnsupportedTypeError(type) {
return Error(`Input type "${type}" isn't supported by matInput.`);
}
var MAT_INPUT_INVALID_TYPES = ["button", "checkbox", "file", "hidden", "image", "radio", "range", "reset", "submit"];
var MAT_INPUT_CONFIG = new InjectionToken("MAT_INPUT_CONFIG");
var MatInput = class _MatInput {
_elementRef = inject2(ElementRef);
_platform = inject2(Platform);
ngControl = inject2(NgControl, {
optional: true,
self: true
});
_autofillMonitor = inject2(AutofillMonitor);
_ngZone = inject2(NgZone);
_formField = inject2(MAT_FORM_FIELD, {
optional: true
});
_renderer = inject2(Renderer2);
_uid = inject2(_IdGenerator).getId("mat-input-");
_previousNativeValue;
_inputValueAccessor;
_signalBasedValueAccessor;
_previousPlaceholder;
_errorStateTracker;
_config = inject2(MAT_INPUT_CONFIG, {
optional: true
});
_cleanupIosKeyup;
_cleanupWebkitWheel;
/** Whether the component is being rendered on the server. */
_isServer;
/** Whether the component is a native html select. */
_isNativeSelect;
/** Whether the component is a textarea. */
_isTextarea;
/** Whether the input is inside of a form field. */
_isInFormField;
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
focused = false;
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
stateChanges = new Subject();
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
controlType = "mat-input";
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
autofilled = false;
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get disabled() {
return this._disabled;
}
set disabled(value) {
this._disabled = coerceBooleanProperty(value);
if (this.focused) {
this.focused = false;
this.stateChanges.next();
}
}
_disabled = false;
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get id() {
return this._id;
}
set id(value) {
this._id = value || this._uid;
}
_id;
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
placeholder;
/**
* Name of the input.
* @docs-private
*/
name;
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get required() {
return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;
}
set required(value) {
this._required = coerceBooleanProperty(value);
}
_required;
/** Input type of the element. */
get type() {
return this._type;
}
set type(value) {
this._type = value || "text";
this._validateType();
if (!this._isTextarea && getSupportedInputTypes().has(this._type)) {
this._elementRef.nativeElement.type = this._type;
}
}
_type = "text";
/** An object used to control when error messages are shown. */
get errorStateMatcher() {
return this._errorStateTracker.matcher;
}
set errorStateMatcher(value) {
this._errorStateTracker.matcher = value;
}
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
userAriaDescribedBy;
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get value() {
return this._signalBasedValueAccessor ? this._signalBasedValueAccessor.value() : this._inputValueAccessor.value;
}
set value(value) {
if (value !== this.value) {
if (this._signalBasedValueAccessor) {
this._signalBasedValueAccessor.value.set(value);
} else {
this._inputValueAccessor.value = value;
}
this.stateChanges.next();
}
}
/** Whether the element is readonly. */
get readonly() {
return this._readonly;
}
set readonly(value) {
this._readonly = coerceBooleanProperty(value);
}
_readonly = false;
/** Whether the input should remain interactive when it is disabled. */
disabledInteractive;
/** Whether the input is in an error state. */
get errorState() {
return this._errorStateTracker.errorState;
}
set errorState(value) {
this._errorStateTracker.errorState = value;
}
_neverEmptyInputTypes = ["date", "datetime", "datetime-local", "month", "time", "week"].filter((t) => getSupportedInputTypes().has(t));
constructor() {
const parentForm = inject2(NgForm, {
optional: true
});
const parentFormGroup = inject2(FormGroupDirective, {
optional: true
});
const defaultErrorStateMatcher = inject2(ErrorStateMatcher);
const accessor = inject2(MAT_INPUT_VALUE_ACCESSOR, {
optional: true,
self: true
});
const element = this._elementRef.nativeElement;
const nodeName = element.nodeName.toLowerCase();
if (accessor) {
if (isSignal(accessor.value)) {
this._signalBasedValueAccessor = accessor;
} else {
this._inputValueAccessor = accessor;
}
} else {
this._inputValueAccessor = element;
}
this._previousNativeValue = this.value;
this.id = this.id;
if (this._platform.IOS) {
this._ngZone.runOutsideAngular(() => {
this._cleanupIosKeyup = this._renderer.listen(element, "keyup", this._iOSKeyupListener);
});
}
this._errorStateTracker = new _ErrorStateTracker(defaultErrorStateMatcher, this.ngControl, parentFormGroup, parentForm, this.stateChanges);
this._isServer = !this._platform.isBrowser;
this._isNativeSelect = nodeName === "select";
this._isTextarea = nodeName === "textarea";
this._isInFormField = !!this._formField;
this.disabledInteractive = this._config?.disabledInteractive || false;
if (this._isNativeSelect) {
this.controlType = element.multiple ? "mat-native-select-multiple" : "mat-native-select";
}
if (this._signalBasedValueAccessor) {
effect(() => {
this._signalBasedValueAccessor.value();
this.stateChanges.next();
});
}
}
ngAfterViewInit() {
if (this._platform.isBrowser) {
this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe((event) => {
this.autofilled = event.isAutofilled;
this.stateChanges.next();
});
}
}
ngOnChanges() {
this.stateChanges.next();
}
ngOnDestroy() {
this.stateChanges.complete();
if (this._platform.isBrowser) {
this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement);
}
this._cleanupIosKeyup?.();
this._cleanupWebkitWheel?.();
}
ngDoCheck() {
if (this.ngControl) {
this.updateErrorState();
if (this.ngControl.disabled !== null && this.ngControl.disabled !== this.disabled) {
this.disabled = this.ngControl.disabled;
this.stateChanges.next();
}
}
this._dirtyCheckNativeValue();
this._dirtyCheckPlaceholder();
}
/** Focuses the input. */
focus(options) {
this._elementRef.nativeElement.focus(options);
}
/** Refreshes the error state of the input. */
updateErrorState() {
this._errorStateTracker.updateErrorState();
}
/** Callback for the cases where the focused state of the input changes. */
_focusChanged(isFocused) {
if (isFocused === this.focused) {
return;
}
if (!this._isNativeSelect && isFocused && this.disabled && this.disabledInteractive) {
const element = this._elementRef.nativeElement;
if (element.type === "number") {
element.type = "text";
element.setSelectionRange(0, 0);
element.type = "number";
} else {
element.setSelectionRange(0, 0);
}
}
this.focused = isFocused;
this.stateChanges.next();
}
_onInput() {
}
/** Does some manual dirty checking on the native input `value` property. */
_dirtyCheckNativeValue() {
const newValue = this._elementRef.nativeElement.value;
if (this._previousNativeValue !== newValue) {
this._previousNativeValue = newValue;
this.stateChanges.next();
}
}
/** Does some manual dirty checking on the native input `placeholder` attribute. */
_dirtyCheckPlaceholder() {
const placeholder = this._getPlaceholder();
if (placeholder !== this._previousPlaceholder) {
const element = this._elementRef.nativeElement;
this._previousPlaceholder = placeholder;
placeholder ? element.setAttribute("placeholder", placeholder) : element.removeAttribute("placeholder");
}
}
/** Gets the current placeholder of the form field. */
_getPlaceholder() {
return this.placeholder || null;
}
/** Make sure the input is a supported type. */
_validateType() {
if (MAT_INPUT_INVALID_TYPES.indexOf(this._type) > -1 && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw getMatInputUnsupportedTypeError(this._type);
}
}
/** Checks whether the input type is one of the types that are never empty. */
_isNeverEmpty() {
return this._neverEmptyInputTypes.indexOf(this._type) > -1;
}
/** Checks whether the input is invalid based on the native validation. */
_isBadInput() {
let validity = this._elementRef.nativeElement.validity;
return validity && validity.badInput;
}
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get empty() {
return !this._isNeverEmpty() && !this._elementRef.nativeElement.value && !this._isBadInput() && !this.autofilled;
}
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get shouldLabelFloat() {
if (this._isNativeSelect) {
const selectElement = this._elementRef.nativeElement;
const firstOption = selectElement.options[0];
return this.focused || selectElement.multiple || !this.empty || !!(selectElement.selectedIndex > -1 && firstOption && firstOption.label);
} else {
return this.focused && !this.disabled || !this.empty;
}
}
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get describedByIds() {
const element = this._elementRef.nativeElement;
const existingDescribedBy = element.getAttribute("aria-describedby");
return existingDescribedBy?.split(" ") || [];
}
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
setDescribedByIds(ids) {
const element = this._elementRef.nativeElement;
if (ids.length) {
element.setAttribute("aria-describedby", ids.join(" "));
} else {
element.removeAttribute("aria-describedby");
}
}
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
onContainerClick() {
if (!this.focused) {
this.focus();
}
}
/** Whether the form control is a native select that is displayed inline. */
_isInlineSelect() {
const element = this._elementRef.nativeElement;
return this._isNativeSelect && (element.multiple || element.size > 1);
}
_iOSKeyupListener = (event) => {
const el = event.target;
if (!el.value && el.selectionStart === 0 && el.selectionEnd === 0) {
el.setSelectionRange(1, 1);
el.setSelectionRange(0, 0);
}
};
/** Gets the value to set on the `readonly` attribute. */
_getReadonlyAttribute() {
if (this._isNativeSelect) {
return null;
}
if (this.readonly || this.disabled && this.disabledInteractive) {
return "true";
}
return null;
}
static \u0275fac = function MatInput_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatInput)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MatInput,
selectors: [["input", "matInput", ""], ["textarea", "matInput", ""], ["select", "matNativeControl", ""], ["input", "matNativeControl", ""], ["textarea", "matNativeControl", ""]],
hostAttrs: [1, "mat-mdc-input-element"],
hostVars: 21,
hostBindings: function MatInput_HostBindings(rf, ctx) {
if (rf & 1) {
\u0275\u0275listener("focus", function MatInput_focus_HostBindingHandler() {
return ctx._focusChanged(true);
})("blur", function MatInput_blur_HostBindingHandler() {
return ctx._focusChanged(false);
})("input", function MatInput_input_HostBindingHandler() {
return ctx._onInput();
});
}
if (rf & 2) {
\u0275\u0275domProperty("id", ctx.id)("disabled", ctx.disabled && !ctx.disabledInteractive)("required", ctx.required);
\u0275\u0275attribute("name", ctx.name || null)("readonly", ctx._getReadonlyAttribute())("aria-disabled", ctx.disabled && ctx.disabledInteractive ? "true" : null)("aria-invalid", ctx.empty && ctx.required ? null : ctx.errorState)("aria-required", ctx.required)("id", ctx.id);
\u0275\u0275classProp("mat-input-server", ctx._isServer)("mat-mdc-form-field-textarea-control", ctx._isInFormField && ctx._isTextarea)("mat-mdc-form-field-input-control", ctx._isInFormField)("mat-mdc-input-disabled-interactive", ctx.disabledInteractive)("mdc-text-field__input", ctx._isInFormField)("mat-mdc-native-select-inline", ctx._isInlineSelect());
}
},
inputs: {
disabled: "disabled",
id: "id",
placeholder: "placeholder",
name: "name",
required: "required",
type: "type",
errorStateMatcher: "errorStateMatcher",
userAriaDescribedBy: [0, "aria-describedby", "userAriaDescribedBy"],
value: "value",
readonly: "readonly",
disabledInteractive: [2, "disabledInteractive", "disabledInteractive", booleanAttribute]
},
exportAs: ["matInput"],
features: [\u0275\u0275ProvidersFeature([{
provide: MatFormFieldControl,
useExisting: _MatInput
}]), \u0275\u0275NgOnChangesFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatInput, [{
type: Directive,
args: [{
selector: `input[matInput], textarea[matInput], select[matNativeControl],
input[matNativeControl], textarea[matNativeControl]`,
exportAs: "matInput",
host: {
"class": "mat-mdc-input-element",
// The BaseMatInput parent class adds `mat-input-element`, `mat-form-field-control` and
// `mat-form-field-autofill-control` to the CSS class list, but this should not be added for
// this MDC equivalent input.
"[class.mat-input-server]": "_isServer",
"[class.mat-mdc-form-field-textarea-control]": "_isInFormField && _isTextarea",
"[class.mat-mdc-form-field-input-control]": "_isInFormField",
"[class.mat-mdc-input-disabled-interactive]": "disabledInteractive",
"[class.mdc-text-field__input]": "_isInFormField",
"[class.mat-mdc-native-select-inline]": "_isInlineSelect()",
// Native input properties that are overwritten by Angular inputs need to be synced with
// the native input element. Otherwise property bindings for those don't work.
"[id]": "id",
"[disabled]": "disabled && !disabledInteractive",
"[required]": "required",
"[attr.name]": "name || null",
"[attr.readonly]": "_getReadonlyAttribute()",
"[attr.aria-disabled]": 'disabled && disabledInteractive ? "true" : null',
// Only mark the input as invalid for assistive technology if it has a value since the
// state usually overlaps with `aria-required` when the input is empty and can be redundant.
"[attr.aria-invalid]": "(empty && required) ? null : errorState",
"[attr.aria-required]": "required",
// Native input properties that are overwritten by Angular inputs need to be synced with
// the native input element. Otherwise property bindings for those don't work.
"[attr.id]": "id",
"(focus)": "_focusChanged(true)",
"(blur)": "_focusChanged(false)",
"(input)": "_onInput()"
},
providers: [{
provide: MatFormFieldControl,
useExisting: MatInput
}]
}]
}], () => [], {
disabled: [{
type: Input
}],
id: [{
type: Input
}],
placeholder: [{
type: Input
}],
name: [{
type: Input
}],
required: [{
type: Input
}],
type: [{
type: Input
}],
errorStateMatcher: [{
type: Input
}],
userAriaDescribedBy: [{
type: Input,
args: ["aria-describedby"]
}],
value: [{
type: Input
}],
readonly: [{
type: Input
}],
disabledInteractive: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}]
});
})();
var MatInputModule = class _MatInputModule {
static \u0275fac = function MatInputModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatInputModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _MatInputModule,
imports: [MatCommonModule, MatFormFieldModule, MatInput],
exports: [MatInput, MatFormFieldModule, TextFieldModule, MatCommonModule]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
imports: [MatCommonModule, MatFormFieldModule, MatFormFieldModule, TextFieldModule, MatCommonModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatInputModule, [{
type: NgModule,
args: [{
imports: [MatCommonModule, MatFormFieldModule, MatInput],
exports: [MatInput, MatFormFieldModule, TextFieldModule, MatCommonModule]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/pseudo-checkbox.mjs
var MatPseudoCheckbox = class _MatPseudoCheckbox {
_animationsDisabled = _animationsDisabled();
/** Display state of the checkbox. */
state = "unchecked";
/** Whether the checkbox is disabled. */
disabled = false;
/**
* Appearance of the pseudo checkbox. Default appearance of 'full' renders a checkmark/mixedmark
* indicator inside a square box. 'minimal' appearance only renders the checkmark/mixedmark.
*/
appearance = "full";
constructor() {
}
static \u0275fac = function MatPseudoCheckbox_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatPseudoCheckbox)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: _MatPseudoCheckbox,
selectors: [["mat-pseudo-checkbox"]],
hostAttrs: [1, "mat-pseudo-checkbox"],
hostVars: 12,
hostBindings: function MatPseudoCheckbox_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275classProp("mat-pseudo-checkbox-indeterminate", ctx.state === "indeterminate")("mat-pseudo-checkbox-checked", ctx.state === "checked")("mat-pseudo-checkbox-disabled", ctx.disabled)("mat-pseudo-checkbox-minimal", ctx.appearance === "minimal")("mat-pseudo-checkbox-full", ctx.appearance === "full")("_mat-animation-noopable", ctx._animationsDisabled);
}
},
inputs: {
state: "state",
disabled: "disabled",
appearance: "appearance"
},
decls: 0,
vars: 0,
template: function MatPseudoCheckbox_Template(rf, ctx) {
},
styles: ['.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-minimal-selected-checkmark-color, var(--mat-sys-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-pseudo-checkbox-full-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-pseudo-checkbox-full-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-pseudo-checkbox-full-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-full-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-pseudo-checkbox-full-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-full-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}\n'],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatPseudoCheckbox, [{
type: Component,
args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
selector: "mat-pseudo-checkbox",
template: "",
host: {
"class": "mat-pseudo-checkbox",
"[class.mat-pseudo-checkbox-indeterminate]": 'state === "indeterminate"',
"[class.mat-pseudo-checkbox-checked]": 'state === "checked"',
"[class.mat-pseudo-checkbox-disabled]": "disabled",
"[class.mat-pseudo-checkbox-minimal]": 'appearance === "minimal"',
"[class.mat-pseudo-checkbox-full]": 'appearance === "full"',
"[class._mat-animation-noopable]": "_animationsDisabled"
},
styles: ['.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-minimal-selected-checkmark-color, var(--mat-sys-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-pseudo-checkbox-full-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-pseudo-checkbox-full-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-pseudo-checkbox-full-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-full-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-pseudo-checkbox-full-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-full-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}\n']
}]
}], () => [], {
state: [{
type: Input
}],
disabled: [{
type: Input
}],
appearance: [{
type: Input
}]
});
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/option.mjs
var _c06 = ["*", [["mat-option"], ["ng-container"]]];
var _c14 = ["*", "mat-option, ng-container"];
var _c23 = ["text"];
var _c33 = [[["mat-icon"]], "*"];
var _c43 = ["mat-icon", "*"];
function MatOption_Conditional_0_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275element(0, "mat-pseudo-checkbox", 1);
}
if (rf & 2) {
const ctx_r0 = \u0275\u0275nextContext();
\u0275\u0275property("disabled", ctx_r0.disabled)("state", ctx_r0.selected ? "checked" : "unchecked");
}
}
function MatOption_Conditional_5_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275element(0, "mat-pseudo-checkbox", 3);
}
if (rf & 2) {
const ctx_r0 = \u0275\u0275nextContext();
\u0275\u0275property("disabled", ctx_r0.disabled);
}
}
function MatOption_Conditional_6_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "span", 4);
\u0275\u0275text(1);
\u0275\u0275elementEnd();
}
if (rf & 2) {
const ctx_r0 = \u0275\u0275nextContext();
\u0275\u0275advance();
\u0275\u0275textInterpolate1("(", ctx_r0.group.label, ")");
}
}
var MAT_OPTION_PARENT_COMPONENT = new InjectionToken("MAT_OPTION_PARENT_COMPONENT");
var MAT_OPTGROUP = new InjectionToken("MatOptgroup");
var MatOptgroup = class _MatOptgroup {
/** Label for the option group. */
label;
/** whether the option group is disabled. */
disabled = false;
/** Unique id for the underlying label. */
_labelId = inject2(_IdGenerator).getId("mat-optgroup-label-");
/** Whether the group is in inert a11y mode. */
_inert;
constructor() {
const parent = inject2(MAT_OPTION_PARENT_COMPONENT, {
optional: true
});
this._inert = parent?.inertGroups ?? false;
}
static \u0275fac = function MatOptgroup_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatOptgroup)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: _MatOptgroup,
selectors: [["mat-optgroup"]],
hostAttrs: [1, "mat-mdc-optgroup"],
hostVars: 3,
hostBindings: function MatOptgroup_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275attribute("role", ctx._inert ? null : "group")("aria-disabled", ctx._inert ? null : ctx.disabled.toString())("aria-labelledby", ctx._inert ? null : ctx._labelId);
}
},
inputs: {
label: "label",
disabled: [2, "disabled", "disabled", booleanAttribute]
},
exportAs: ["matOptgroup"],
features: [\u0275\u0275ProvidersFeature([{
provide: MAT_OPTGROUP,
useExisting: _MatOptgroup
}])],
ngContentSelectors: _c14,
decls: 5,
vars: 4,
consts: [["role", "presentation", 1, "mat-mdc-optgroup-label", 3, "id"], [1, "mdc-list-item__primary-text"]],
template: function MatOptgroup_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275projectionDef(_c06);
\u0275\u0275domElementStart(0, "span", 0)(1, "span", 1);
\u0275\u0275text(2);
\u0275\u0275projection(3);
\u0275\u0275domElementEnd()();
\u0275\u0275projection(4, 1);
}
if (rf & 2) {
\u0275\u0275classProp("mdc-list-item--disabled", ctx.disabled);
\u0275\u0275domProperty("id", ctx._labelId);
\u0275\u0275advance(2);
\u0275\u0275textInterpolate1("", ctx.label, " ");
}
},
styles: [".mat-mdc-optgroup{color:var(--mat-optgroup-label-text-color, var(--mat-sys-on-surface-variant));font-family:var(--mat-optgroup-label-text-font, var(--mat-sys-title-small-font));line-height:var(--mat-optgroup-label-text-line-height, var(--mat-sys-title-small-line-height));font-size:var(--mat-optgroup-label-text-size, var(--mat-sys-title-small-size));letter-spacing:var(--mat-optgroup-label-text-tracking, var(--mat-sys-title-small-tracking));font-weight:var(--mat-optgroup-label-text-weight, var(--mat-sys-title-small-weight))}.mat-mdc-optgroup-label{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;outline:none}.mat-mdc-optgroup-label.mdc-list-item--disabled{opacity:.38}.mat-mdc-optgroup-label .mdc-list-item__primary-text{font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;white-space:normal;color:inherit}\n"],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatOptgroup, [{
type: Component,
args: [{
selector: "mat-optgroup",
exportAs: "matOptgroup",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
"class": "mat-mdc-optgroup",
"[attr.role]": '_inert ? null : "group"',
"[attr.aria-disabled]": "_inert ? null : disabled.toString()",
"[attr.aria-labelledby]": "_inert ? null : _labelId"
},
providers: [{
provide: MAT_OPTGROUP,
useExisting: MatOptgroup
}],
template: '<span\n class="mat-mdc-optgroup-label"\n role="presentation"\n [class.mdc-list-item--disabled]="disabled"\n [id]="_labelId">\n <span class="mdc-list-item__primary-text">{{ label }} <ng-content></ng-content></span>\n</span>\n\n<ng-content select="mat-option, ng-container"></ng-content>\n',
styles: [".mat-mdc-optgroup{color:var(--mat-optgroup-label-text-color, var(--mat-sys-on-surface-variant));font-family:var(--mat-optgroup-label-text-font, var(--mat-sys-title-small-font));line-height:var(--mat-optgroup-label-text-line-height, var(--mat-sys-title-small-line-height));font-size:var(--mat-optgroup-label-text-size, var(--mat-sys-title-small-size));letter-spacing:var(--mat-optgroup-label-text-tracking, var(--mat-sys-title-small-tracking));font-weight:var(--mat-optgroup-label-text-weight, var(--mat-sys-title-small-weight))}.mat-mdc-optgroup-label{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;outline:none}.mat-mdc-optgroup-label.mdc-list-item--disabled{opacity:.38}.mat-mdc-optgroup-label .mdc-list-item__primary-text{font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;white-space:normal;color:inherit}\n"]
}]
}], () => [], {
label: [{
type: Input
}],
disabled: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}]
});
})();
var MatOptionSelectionChange = class {
source;
isUserInput;
constructor(source, isUserInput = false) {
this.source = source;
this.isUserInput = isUserInput;
}
};
var MatOption = class _MatOption {
_element = inject2(ElementRef);
_changeDetectorRef = inject2(ChangeDetectorRef);
_parent = inject2(MAT_OPTION_PARENT_COMPONENT, {
optional: true
});
group = inject2(MAT_OPTGROUP, {
optional: true
});
_signalDisableRipple = false;
_selected = false;
_active = false;
_mostRecentViewValue = "";
/** Whether the wrapping component is in multiple selection mode. */
get multiple() {
return this._parent && this._parent.multiple;
}
/** Whether or not the option is currently selected. */
get selected() {
return this._selected;
}
/** The form value of the option. */
value;
/** The unique ID of the option. */
id = inject2(_IdGenerator).getId("mat-option-");
/** Whether the option is disabled. */
get disabled() {
return this.group && this.group.disabled || this._disabled();
}
set disabled(value) {
this._disabled.set(value);
}
_disabled = signal(false, ...ngDevMode ? [{
debugName: "_disabled"
}] : []);
/** Whether ripples for the option are disabled. */
get disableRipple() {
return this._signalDisableRipple ? this._parent.disableRipple() : !!this._parent?.disableRipple;
}
/** Whether to display checkmark for single-selection. */
get hideSingleSelectionIndicator() {
return !!(this._parent && this._parent.hideSingleSelectionIndicator);
}
/** Event emitted when the option is selected or deselected. */
// tslint:disable-next-line:no-output-on-prefix
onSelectionChange = new EventEmitter();
/** Element containing the option's text. */
_text;
/** Emits when the state of the option changes and any parents have to be notified. */
_stateChanges = new Subject();
constructor() {
const styleLoader = inject2(_CdkPrivateStyleLoader);
styleLoader.load(_StructuralStylesLoader);
styleLoader.load(_VisuallyHiddenLoader);
this._signalDisableRipple = !!this._parent && isSignal(this._parent.disableRipple);
}
/**
* Whether or not the option is currently active and ready to be selected.
* An active option displays styles as if it is focused, but the
* focus is actually retained somewhere else. This comes in handy
* for components like autocomplete where focus must remain on the input.
*/
get active() {
return this._active;
}
/**
* The displayed value of the option. It is necessary to show the selected option in the
* select's trigger.
*/
get viewValue() {
return (this._text?.nativeElement.textContent || "").trim();
}
/** Selects the option. */
select(emitEvent = true) {
if (!this._selected) {
this._selected = true;
this._changeDetectorRef.markForCheck();
if (emitEvent) {
this._emitSelectionChangeEvent();
}
}
}
/** Deselects the option. */
deselect(emitEvent = true) {
if (this._selected) {
this._selected = false;
this._changeDetectorRef.markForCheck();
if (emitEvent) {
this._emitSelectionChangeEvent();
}
}
}
/** Sets focus onto this option. */
focus(_origin, options) {
const element = this._getHostElement();
if (typeof element.focus === "function") {
element.focus(options);
}
}
/**
* This method sets display styles on the option to make it appear
* active. This is used by the ActiveDescendantKeyManager so key
* events will display the proper options as active on arrow key events.
*/
setActiveStyles() {
if (!this._active) {
this._active = true;
this._changeDetectorRef.markForCheck();
}
}
/**
* This method removes display styles on the option that made it appear
* active. This is used by the ActiveDescendantKeyManager so key
* events will display the proper options as active on arrow key events.
*/
setInactiveStyles() {
if (this._active) {
this._active = false;
this._changeDetectorRef.markForCheck();
}
}
/** Gets the label to be used when determining whether the option should be focused. */
getLabel() {
return this.viewValue;
}
/** Ensures the option is selected when activated from the keyboard. */
_handleKeydown(event) {
if ((event.keyCode === ENTER || event.keyCode === SPACE) && !hasModifierKey(event)) {
this._selectViaInteraction();
event.preventDefault();
}
}
/**
* `Selects the option while indicating the selection came from the user. Used to
* determine if the select's view -> model callback should be invoked.`
*/
_selectViaInteraction() {
if (!this.disabled) {
this._selected = this.multiple ? !this._selected : true;
this._changeDetectorRef.markForCheck();
this._emitSelectionChangeEvent(true);
}
}
/** Returns the correct tabindex for the option depending on disabled state. */
// This method is only used by `MatLegacyOption`. Keeping it here to avoid breaking the types.
// That's because `MatLegacyOption` use `MatOption` type in a few places such as
// `MatOptionSelectionChange`. It is safe to delete this when `MatLegacyOption` is deleted.
_getTabIndex() {
return this.disabled ? "-1" : "0";
}
/** Gets the host DOM element. */
_getHostElement() {
return this._element.nativeElement;
}
ngAfterViewChecked() {
if (this._selected) {
const viewValue = this.viewValue;
if (viewValue !== this._mostRecentViewValue) {
if (this._mostRecentViewValue) {
this._stateChanges.next();
}
this._mostRecentViewValue = viewValue;
}
}
}
ngOnDestroy() {
this._stateChanges.complete();
}
/** Emits the selection change event. */
_emitSelectionChangeEvent(isUserInput = false) {
this.onSelectionChange.emit(new MatOptionSelectionChange(this, isUserInput));
}
static \u0275fac = function MatOption_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatOption)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: _MatOption,
selectors: [["mat-option"]],
viewQuery: function MatOption_Query(rf, ctx) {
if (rf & 1) {
\u0275\u0275viewQuery(_c23, 7);
}
if (rf & 2) {
let _t;
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._text = _t.first);
}
},
hostAttrs: ["role", "option", 1, "mat-mdc-option", "mdc-list-item"],
hostVars: 11,
hostBindings: function MatOption_HostBindings(rf, ctx) {
if (rf & 1) {
\u0275\u0275listener("click", function MatOption_click_HostBindingHandler() {
return ctx._selectViaInteraction();
})("keydown", function MatOption_keydown_HostBindingHandler($event) {
return ctx._handleKeydown($event);
});
}
if (rf & 2) {
\u0275\u0275domProperty("id", ctx.id);
\u0275\u0275attribute("aria-selected", ctx.selected)("aria-disabled", ctx.disabled.toString());
\u0275\u0275classProp("mdc-list-item--selected", ctx.selected)("mat-mdc-option-multiple", ctx.multiple)("mat-mdc-option-active", ctx.active)("mdc-list-item--disabled", ctx.disabled);
}
},
inputs: {
value: "value",
id: "id",
disabled: [2, "disabled", "disabled", booleanAttribute]
},
outputs: {
onSelectionChange: "onSelectionChange"
},
exportAs: ["matOption"],
ngContentSelectors: _c43,
decls: 8,
vars: 5,
consts: [["text", ""], ["aria-hidden", "true", 1, "mat-mdc-option-pseudo-checkbox", 3, "disabled", "state"], [1, "mdc-list-item__primary-text"], ["state", "checked", "aria-hidden", "true", "appearance", "minimal", 1, "mat-mdc-option-pseudo-checkbox", 3, "disabled"], [1, "cdk-visually-hidden"], ["aria-hidden", "true", "mat-ripple", "", 1, "mat-mdc-option-ripple", "mat-focus-indicator", 3, "matRippleTrigger", "matRippleDisabled"]],
template: function MatOption_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275projectionDef(_c33);
\u0275\u0275conditionalCreate(0, MatOption_Conditional_0_Template, 1, 2, "mat-pseudo-checkbox", 1);
\u0275\u0275projection(1);
\u0275\u0275elementStart(2, "span", 2, 0);
\u0275\u0275projection(4, 1);
\u0275\u0275elementEnd();
\u0275\u0275conditionalCreate(5, MatOption_Conditional_5_Template, 1, 1, "mat-pseudo-checkbox", 3);
\u0275\u0275conditionalCreate(6, MatOption_Conditional_6_Template, 2, 1, "span", 4);
\u0275\u0275element(7, "div", 5);
}
if (rf & 2) {
\u0275\u0275conditional(ctx.multiple ? 0 : -1);
\u0275\u0275advance(5);
\u0275\u0275conditional(!ctx.multiple && ctx.selected && !ctx.hideSingleSelectionIndicator ? 5 : -1);
\u0275\u0275advance();
\u0275\u0275conditional(ctx.group && ctx.group._inert ? 6 : -1);
\u0275\u0275advance();
\u0275\u0275property("matRippleTrigger", ctx._getHostElement())("matRippleDisabled", ctx.disabled || ctx.disableRipple);
}
},
dependencies: [MatPseudoCheckbox, MatRipple],
styles: ['.mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mat-list-list-item-selected-container-color: var(--mat-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:""}\n'],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatOption, [{
type: Component,
args: [{
selector: "mat-option",
exportAs: "matOption",
host: {
"role": "option",
"[class.mdc-list-item--selected]": "selected",
"[class.mat-mdc-option-multiple]": "multiple",
"[class.mat-mdc-option-active]": "active",
"[class.mdc-list-item--disabled]": "disabled",
"[id]": "id",
// Set aria-selected to false for non-selected items and true for selected items. Conform to
// [WAI ARIA Listbox authoring practices guide](
// https://www.w3.org/WAI/ARIA/apg/patterns/listbox/), "If any options are selected, each
// selected option has either aria-selected or aria-checked set to true. All options that are
// selectable but not selected have either aria-selected or aria-checked set to false." Align
// aria-selected implementation of Chips and List components.
//
// Set `aria-selected="false"` on not-selected listbox options to fix VoiceOver announcing
// every option as "selected" (#21491).
"[attr.aria-selected]": "selected",
"[attr.aria-disabled]": "disabled.toString()",
"(click)": "_selectViaInteraction()",
"(keydown)": "_handleKeydown($event)",
"class": "mat-mdc-option mdc-list-item"
},
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [MatPseudoCheckbox, MatRipple],
template: `<!-- Set aria-hidden="true" to this DOM node and other decorative nodes in this file. This might
be contributing to issue where sometimes VoiceOver focuses on a TextNode in the a11y tree instead
of the Option node (#23202). Most assistive technology will generally ignore non-role,
non-text-content elements. Adding aria-hidden seems to make VoiceOver behave more consistently. -->
@if (multiple) {
<mat-pseudo-checkbox
class="mat-mdc-option-pseudo-checkbox"
[disabled]="disabled"
[state]="selected ? 'checked' : 'unchecked'"
aria-hidden="true"></mat-pseudo-checkbox>
}
<ng-content select="mat-icon"></ng-content>
<span class="mdc-list-item__primary-text" #text><ng-content></ng-content></span>
<!-- Render checkmark at the end for single-selection. -->
@if (!multiple && selected && !hideSingleSelectionIndicator) {
<mat-pseudo-checkbox
class="mat-mdc-option-pseudo-checkbox"
[disabled]="disabled"
state="checked"
aria-hidden="true"
appearance="minimal"></mat-pseudo-checkbox>
}
<!-- See a11y notes inside optgroup.ts for context behind this element. -->
@if (group && group._inert) {
<span class="cdk-visually-hidden">({{ group.label }})</span>
}
<div class="mat-mdc-option-ripple mat-focus-indicator" aria-hidden="true" mat-ripple
[matRippleTrigger]="_getHostElement()" [matRippleDisabled]="disabled || disableRipple">
</div>
`,
styles: ['.mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mat-list-list-item-selected-container-color: var(--mat-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:""}\n']
}]
}], () => [], {
value: [{
type: Input
}],
id: [{
type: Input
}],
disabled: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
onSelectionChange: [{
type: Output
}],
_text: [{
type: ViewChild,
args: ["text", {
static: true
}]
}]
});
})();
function _countGroupLabelsBeforeOption(optionIndex, options, optionGroups) {
if (optionGroups.length) {
let optionsArray = options.toArray();
let groups = optionGroups.toArray();
let groupCounter = 0;
for (let i = 0; i < optionIndex + 1; i++) {
if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {
groupCounter++;
}
}
return groupCounter;
}
return 0;
}
function _getOptionScrollPosition(optionOffset, optionHeight, currentScrollPosition, panelHeight) {
if (optionOffset < currentScrollPosition) {
return optionOffset;
}
if (optionOffset + optionHeight > currentScrollPosition + panelHeight) {
return Math.max(0, optionOffset - panelHeight + optionHeight);
}
return currentScrollPosition;
}
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/data-source.mjs
var DataSource = class {
};
function isDataSource(value) {
return value && typeof value.connect === "function" && !(value instanceof ConnectableObservable);
}
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/recycle-view-repeater-strategy.mjs
var ArrayDataSource = class extends DataSource {
_data;
constructor(_data) {
super();
this._data = _data;
}
connect() {
return isObservable(this._data) ? this._data : of(this._data);
}
disconnect() {
}
};
var _ViewRepeaterOperation;
(function(_ViewRepeaterOperation2) {
_ViewRepeaterOperation2[_ViewRepeaterOperation2["REPLACED"] = 0] = "REPLACED";
_ViewRepeaterOperation2[_ViewRepeaterOperation2["INSERTED"] = 1] = "INSERTED";
_ViewRepeaterOperation2[_ViewRepeaterOperation2["MOVED"] = 2] = "MOVED";
_ViewRepeaterOperation2[_ViewRepeaterOperation2["REMOVED"] = 3] = "REMOVED";
})(_ViewRepeaterOperation || (_ViewRepeaterOperation = {}));
var _VIEW_REPEATER_STRATEGY = new InjectionToken("_ViewRepeater");
var _RecycleViewRepeaterStrategy = class {
/**
* The size of the cache used to store unused views.
* Setting the cache size to `0` will disable caching. Defaults to 20 views.
*/
viewCacheSize = 20;
/**
* View cache that stores embedded view instances that have been previously stamped out,
* but don't are not currently rendered. The view repeater will reuse these views rather than
* creating brand new ones.
*
* TODO(michaeljamesparsons) Investigate whether using a linked list would improve performance.
*/
_viewCache = [];
/** Apply changes to the DOM. */
applyChanges(changes, viewContainerRef, itemContextFactory, itemValueResolver, itemViewChanged) {
changes.forEachOperation((record, adjustedPreviousIndex, currentIndex) => {
let view;
let operation;
if (record.previousIndex == null) {
const viewArgsFactory = () => itemContextFactory(record, adjustedPreviousIndex, currentIndex);
view = this._insertView(viewArgsFactory, currentIndex, viewContainerRef, itemValueResolver(record));
operation = view ? _ViewRepeaterOperation.INSERTED : _ViewRepeaterOperation.REPLACED;
} else if (currentIndex == null) {
this._detachAndCacheView(adjustedPreviousIndex, viewContainerRef);
operation = _ViewRepeaterOperation.REMOVED;
} else {
view = this._moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, itemValueResolver(record));
operation = _ViewRepeaterOperation.MOVED;
}
if (itemViewChanged) {
itemViewChanged({
context: view?.context,
operation,
record
});
}
});
}
detach() {
for (const view of this._viewCache) {
view.destroy();
}
this._viewCache = [];
}
/**
* Inserts a view for a new item, either from the cache or by creating a new
* one. Returns `undefined` if the item was inserted into a cached view.
*/
_insertView(viewArgsFactory, currentIndex, viewContainerRef, value) {
const cachedView = this._insertViewFromCache(currentIndex, viewContainerRef);
if (cachedView) {
cachedView.context.$implicit = value;
return void 0;
}
const viewArgs = viewArgsFactory();
return viewContainerRef.createEmbeddedView(viewArgs.templateRef, viewArgs.context, viewArgs.index);
}
/** Detaches the view at the given index and inserts into the view cache. */
_detachAndCacheView(index, viewContainerRef) {
const detachedView = viewContainerRef.detach(index);
this._maybeCacheView(detachedView, viewContainerRef);
}
/** Moves view at the previous index to the current index. */
_moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, value) {
const view = viewContainerRef.get(adjustedPreviousIndex);
viewContainerRef.move(view, currentIndex);
view.context.$implicit = value;
return view;
}
/**
* Cache the given detached view. If the cache is full, the view will be
* destroyed.
*/
_maybeCacheView(view, viewContainerRef) {
if (this._viewCache.length < this.viewCacheSize) {
this._viewCache.push(view);
} else {
const index = viewContainerRef.indexOf(view);
if (index === -1) {
view.destroy();
} else {
viewContainerRef.remove(index);
}
}
}
/** Inserts a recycled view from the cache at the given index. */
_insertViewFromCache(index, viewContainerRef) {
const cachedView = this._viewCache.pop();
if (cachedView) {
viewContainerRef.insert(cachedView, index);
}
return cachedView || null;
}
};
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/scrolling.mjs
var _c07 = ["contentWrapper"];
var _c15 = ["*"];
var VIRTUAL_SCROLL_STRATEGY = new InjectionToken("VIRTUAL_SCROLL_STRATEGY");
var FixedSizeVirtualScrollStrategy = class {
_scrolledIndexChange = new Subject();
/** @docs-private Implemented as part of VirtualScrollStrategy. */
scrolledIndexChange = this._scrolledIndexChange.pipe(distinctUntilChanged());
/** The attached viewport. */
_viewport = null;
/** The size of the items in the virtually scrolling list. */
_itemSize;
/** The minimum amount of buffer rendered beyond the viewport (in pixels). */
_minBufferPx;
/** The number of buffer items to render beyond the edge of the viewport (in pixels). */
_maxBufferPx;
/**
* @param itemSize The size of the items in the virtually scrolling list.
* @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more
* @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.
*/
constructor(itemSize, minBufferPx, maxBufferPx) {
this._itemSize = itemSize;
this._minBufferPx = minBufferPx;
this._maxBufferPx = maxBufferPx;
}
/**
* Attaches this scroll strategy to a viewport.
* @param viewport The viewport to attach this strategy to.
*/
attach(viewport) {
this._viewport = viewport;
this._updateTotalContentSize();
this._updateRenderedRange();
}
/** Detaches this scroll strategy from the currently attached viewport. */
detach() {
this._scrolledIndexChange.complete();
this._viewport = null;
}
/**
* Update the item size and buffer size.
* @param itemSize The size of the items in the virtually scrolling list.
* @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more
* @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.
*/
updateItemAndBufferSize(itemSize, minBufferPx, maxBufferPx) {
if (maxBufferPx < minBufferPx && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw Error("CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx");
}
this._itemSize = itemSize;
this._minBufferPx = minBufferPx;
this._maxBufferPx = maxBufferPx;
this._updateTotalContentSize();
this._updateRenderedRange();
}
/** @docs-private Implemented as part of VirtualScrollStrategy. */
onContentScrolled() {
this._updateRenderedRange();
}
/** @docs-private Implemented as part of VirtualScrollStrategy. */
onDataLengthChanged() {
this._updateTotalContentSize();
this._updateRenderedRange();
}
/** @docs-private Implemented as part of VirtualScrollStrategy. */
onContentRendered() {
}
/** @docs-private Implemented as part of VirtualScrollStrategy. */
onRenderedOffsetChanged() {
}
/**
* Scroll to the offset for the given index.
* @param index The index of the element to scroll to.
* @param behavior The ScrollBehavior to use when scrolling.
*/
scrollToIndex(index, behavior) {
if (this._viewport) {
this._viewport.scrollToOffset(index * this._itemSize, behavior);
}
}
/** Update the viewport's total content size. */
_updateTotalContentSize() {
if (!this._viewport) {
return;
}
this._viewport.setTotalContentSize(this._viewport.getDataLength() * this._itemSize);
}
/** Update the viewport's rendered range. */
_updateRenderedRange() {
if (!this._viewport) {
return;
}
const renderedRange = this._viewport.getRenderedRange();
const newRange = {
start: renderedRange.start,
end: renderedRange.end
};
const viewportSize = this._viewport.getViewportSize();
const dataLength = this._viewport.getDataLength();
let scrollOffset = this._viewport.measureScrollOffset();
let firstVisibleIndex = this._itemSize > 0 ? scrollOffset / this._itemSize : 0;
if (newRange.end > dataLength) {
const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);
const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));
if (firstVisibleIndex != newVisibleIndex) {
firstVisibleIndex = newVisibleIndex;
scrollOffset = newVisibleIndex * this._itemSize;
newRange.start = Math.floor(firstVisibleIndex);
}
newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));
}
const startBuffer = scrollOffset - newRange.start * this._itemSize;
if (startBuffer < this._minBufferPx && newRange.start != 0) {
const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);
newRange.start = Math.max(0, newRange.start - expandStart);
newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));
} else {
const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);
if (endBuffer < this._minBufferPx && newRange.end != dataLength) {
const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);
if (expandEnd > 0) {
newRange.end = Math.min(dataLength, newRange.end + expandEnd);
newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));
}
}
}
this._viewport.setRenderedRange(newRange);
this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);
this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));
}
};
function _fixedSizeVirtualScrollStrategyFactory(fixedSizeDir) {
return fixedSizeDir._scrollStrategy;
}
var CdkFixedSizeVirtualScroll = class _CdkFixedSizeVirtualScroll {
/** The size of the items in the list (in pixels). */
get itemSize() {
return this._itemSize;
}
set itemSize(value) {
this._itemSize = coerceNumberProperty(value);
}
_itemSize = 20;
/**
* The minimum amount of buffer rendered beyond the viewport (in pixels).
* If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px.
*/
get minBufferPx() {
return this._minBufferPx;
}
set minBufferPx(value) {
this._minBufferPx = coerceNumberProperty(value);
}
_minBufferPx = 100;
/**
* The number of pixels worth of buffer to render for when rendering new items. Defaults to 200px.
*/
get maxBufferPx() {
return this._maxBufferPx;
}
set maxBufferPx(value) {
this._maxBufferPx = coerceNumberProperty(value);
}
_maxBufferPx = 200;
/** The scroll strategy used by this directive. */
_scrollStrategy = new FixedSizeVirtualScrollStrategy(this.itemSize, this.minBufferPx, this.maxBufferPx);
ngOnChanges() {
this._scrollStrategy.updateItemAndBufferSize(this.itemSize, this.minBufferPx, this.maxBufferPx);
}
static \u0275fac = function CdkFixedSizeVirtualScroll_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkFixedSizeVirtualScroll)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkFixedSizeVirtualScroll,
selectors: [["cdk-virtual-scroll-viewport", "itemSize", ""]],
inputs: {
itemSize: "itemSize",
minBufferPx: "minBufferPx",
maxBufferPx: "maxBufferPx"
},
features: [\u0275\u0275ProvidersFeature([{
provide: VIRTUAL_SCROLL_STRATEGY,
useFactory: _fixedSizeVirtualScrollStrategyFactory,
deps: [forwardRef(() => _CdkFixedSizeVirtualScroll)]
}]), \u0275\u0275NgOnChangesFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkFixedSizeVirtualScroll, [{
type: Directive,
args: [{
selector: "cdk-virtual-scroll-viewport[itemSize]",
providers: [{
provide: VIRTUAL_SCROLL_STRATEGY,
useFactory: _fixedSizeVirtualScrollStrategyFactory,
deps: [forwardRef(() => CdkFixedSizeVirtualScroll)]
}]
}]
}], null, {
itemSize: [{
type: Input
}],
minBufferPx: [{
type: Input
}],
maxBufferPx: [{
type: Input
}]
});
})();
var DEFAULT_SCROLL_TIME = 20;
var ScrollDispatcher = class _ScrollDispatcher {
_ngZone = inject2(NgZone);
_platform = inject2(Platform);
_renderer = inject2(RendererFactory2).createRenderer(null, null);
_cleanupGlobalListener;
constructor() {
}
/** Subject for notifying that a registered scrollable reference element has been scrolled. */
_scrolled = new Subject();
/** Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards. */
_scrolledCount = 0;
/**
* Map of all the scrollable references that are registered with the service and their
* scroll event subscriptions.
*/
scrollContainers = /* @__PURE__ */ new Map();
/**
* Registers a scrollable instance with the service and listens for its scrolled events. When the
* scrollable is scrolled, the service emits the event to its scrolled observable.
* @param scrollable Scrollable instance to be registered.
*/
register(scrollable) {
if (!this.scrollContainers.has(scrollable)) {
this.scrollContainers.set(scrollable, scrollable.elementScrolled().subscribe(() => this._scrolled.next(scrollable)));
}
}
/**
* De-registers a Scrollable reference and unsubscribes from its scroll event observable.
* @param scrollable Scrollable instance to be deregistered.
*/
deregister(scrollable) {
const scrollableReference = this.scrollContainers.get(scrollable);
if (scrollableReference) {
scrollableReference.unsubscribe();
this.scrollContainers.delete(scrollable);
}
}
/**
* Returns an observable that emits an event whenever any of the registered Scrollable
* references (or window, document, or body) fire a scrolled event. Can provide a time in ms
* to override the default "throttle" time.
*
* **Note:** in order to avoid hitting change detection for every scroll event,
* all of the events emitted from this stream will be run outside the Angular zone.
* If you need to update any data bindings as a result of a scroll event, you have
* to run the callback using `NgZone.run`.
*/
scrolled(auditTimeInMs = DEFAULT_SCROLL_TIME) {
if (!this._platform.isBrowser) {
return of();
}
return new Observable((observer) => {
if (!this._cleanupGlobalListener) {
this._cleanupGlobalListener = this._ngZone.runOutsideAngular(() => this._renderer.listen("document", "scroll", () => this._scrolled.next()));
}
const subscription = auditTimeInMs > 0 ? this._scrolled.pipe(auditTime(auditTimeInMs)).subscribe(observer) : this._scrolled.subscribe(observer);
this._scrolledCount++;
return () => {
subscription.unsubscribe();
this._scrolledCount--;
if (!this._scrolledCount) {
this._cleanupGlobalListener?.();
this._cleanupGlobalListener = void 0;
}
};
});
}
ngOnDestroy() {
this._cleanupGlobalListener?.();
this._cleanupGlobalListener = void 0;
this.scrollContainers.forEach((_, container) => this.deregister(container));
this._scrolled.complete();
}
/**
* Returns an observable that emits whenever any of the
* scrollable ancestors of an element are scrolled.
* @param elementOrElementRef Element whose ancestors to listen for.
* @param auditTimeInMs Time to throttle the scroll events.
*/
ancestorScrolled(elementOrElementRef, auditTimeInMs) {
const ancestors = this.getAncestorScrollContainers(elementOrElementRef);
return this.scrolled(auditTimeInMs).pipe(filter((target) => !target || ancestors.indexOf(target) > -1));
}
/** Returns all registered Scrollables that contain the provided element. */
getAncestorScrollContainers(elementOrElementRef) {
const scrollingContainers = [];
this.scrollContainers.forEach((_subscription, scrollable) => {
if (this._scrollableContainsElement(scrollable, elementOrElementRef)) {
scrollingContainers.push(scrollable);
}
});
return scrollingContainers;
}
/** Returns true if the element is contained within the provided Scrollable. */
_scrollableContainsElement(scrollable, elementOrElementRef) {
let element = coerceElement(elementOrElementRef);
let scrollableElement = scrollable.getElementRef().nativeElement;
do {
if (element == scrollableElement) {
return true;
}
} while (element = element.parentElement);
return false;
}
static \u0275fac = function ScrollDispatcher_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ScrollDispatcher)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _ScrollDispatcher,
factory: _ScrollDispatcher.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ScrollDispatcher, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var CdkScrollable = class _CdkScrollable {
elementRef = inject2(ElementRef);
scrollDispatcher = inject2(ScrollDispatcher);
ngZone = inject2(NgZone);
dir = inject2(Directionality, {
optional: true
});
_scrollElement = this.elementRef.nativeElement;
_destroyed = new Subject();
_renderer = inject2(Renderer2);
_cleanupScroll;
_elementScrolled = new Subject();
constructor() {
}
ngOnInit() {
this._cleanupScroll = this.ngZone.runOutsideAngular(() => this._renderer.listen(this._scrollElement, "scroll", (event) => this._elementScrolled.next(event)));
this.scrollDispatcher.register(this);
}
ngOnDestroy() {
this._cleanupScroll?.();
this._elementScrolled.complete();
this.scrollDispatcher.deregister(this);
this._destroyed.next();
this._destroyed.complete();
}
/** Returns observable that emits when a scroll event is fired on the host element. */
elementScrolled() {
return this._elementScrolled;
}
/** Gets the ElementRef for the viewport. */
getElementRef() {
return this.elementRef;
}
/**
* Scrolls to the specified offsets. This is a normalized version of the browser's native scrollTo
* method, since browsers are not consistent about what scrollLeft means in RTL. For this method
* left and right always refer to the left and right side of the scrolling container irrespective
* of the layout direction. start and end refer to left and right in an LTR context and vice-versa
* in an RTL context.
* @param options specified the offsets to scroll to.
*/
scrollTo(options) {
const el = this.elementRef.nativeElement;
const isRtl = this.dir && this.dir.value == "rtl";
if (options.left == null) {
options.left = isRtl ? options.end : options.start;
}
if (options.right == null) {
options.right = isRtl ? options.start : options.end;
}
if (options.bottom != null) {
options.top = el.scrollHeight - el.clientHeight - options.bottom;
}
if (isRtl && getRtlScrollAxisType() != RtlScrollAxisType.NORMAL) {
if (options.left != null) {
options.right = el.scrollWidth - el.clientWidth - options.left;
}
if (getRtlScrollAxisType() == RtlScrollAxisType.INVERTED) {
options.left = options.right;
} else if (getRtlScrollAxisType() == RtlScrollAxisType.NEGATED) {
options.left = options.right ? -options.right : options.right;
}
} else {
if (options.right != null) {
options.left = el.scrollWidth - el.clientWidth - options.right;
}
}
this._applyScrollToOptions(options);
}
_applyScrollToOptions(options) {
const el = this.elementRef.nativeElement;
if (supportsScrollBehavior()) {
el.scrollTo(options);
} else {
if (options.top != null) {
el.scrollTop = options.top;
}
if (options.left != null) {
el.scrollLeft = options.left;
}
}
}
/**
* Measures the scroll offset relative to the specified edge of the viewport. This method can be
* used instead of directly checking scrollLeft or scrollTop, since browsers are not consistent
* about what scrollLeft means in RTL. The values returned by this method are normalized such that
* left and right always refer to the left and right side of the scrolling container irrespective
* of the layout direction. start and end refer to left and right in an LTR context and vice-versa
* in an RTL context.
* @param from The edge to measure from.
*/
measureScrollOffset(from2) {
const LEFT = "left";
const RIGHT = "right";
const el = this.elementRef.nativeElement;
if (from2 == "top") {
return el.scrollTop;
}
if (from2 == "bottom") {
return el.scrollHeight - el.clientHeight - el.scrollTop;
}
const isRtl = this.dir && this.dir.value == "rtl";
if (from2 == "start") {
from2 = isRtl ? RIGHT : LEFT;
} else if (from2 == "end") {
from2 = isRtl ? LEFT : RIGHT;
}
if (isRtl && getRtlScrollAxisType() == RtlScrollAxisType.INVERTED) {
if (from2 == LEFT) {
return el.scrollWidth - el.clientWidth - el.scrollLeft;
} else {
return el.scrollLeft;
}
} else if (isRtl && getRtlScrollAxisType() == RtlScrollAxisType.NEGATED) {
if (from2 == LEFT) {
return el.scrollLeft + el.scrollWidth - el.clientWidth;
} else {
return -el.scrollLeft;
}
} else {
if (from2 == LEFT) {
return el.scrollLeft;
} else {
return el.scrollWidth - el.clientWidth - el.scrollLeft;
}
}
}
static \u0275fac = function CdkScrollable_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkScrollable)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkScrollable,
selectors: [["", "cdk-scrollable", ""], ["", "cdkScrollable", ""]]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkScrollable, [{
type: Directive,
args: [{
selector: "[cdk-scrollable], [cdkScrollable]"
}]
}], () => [], null);
})();
var DEFAULT_RESIZE_TIME = 20;
var ViewportRuler = class _ViewportRuler {
_platform = inject2(Platform);
_listeners;
/** Cached viewport dimensions. */
_viewportSize;
/** Stream of viewport change events. */
_change = new Subject();
/** Used to reference correct document/window */
_document = inject2(DOCUMENT);
constructor() {
const ngZone = inject2(NgZone);
const renderer = inject2(RendererFactory2).createRenderer(null, null);
ngZone.runOutsideAngular(() => {
if (this._platform.isBrowser) {
const changeListener = (event) => this._change.next(event);
this._listeners = [renderer.listen("window", "resize", changeListener), renderer.listen("window", "orientationchange", changeListener)];
}
this.change().subscribe(() => this._viewportSize = null);
});
}
ngOnDestroy() {
this._listeners?.forEach((cleanup) => cleanup());
this._change.complete();
}
/** Returns the viewport's width and height. */
getViewportSize() {
if (!this._viewportSize) {
this._updateViewportSize();
}
const output = {
width: this._viewportSize.width,
height: this._viewportSize.height
};
if (!this._platform.isBrowser) {
this._viewportSize = null;
}
return output;
}
/** Gets a DOMRect for the viewport's bounds. */
getViewportRect() {
const scrollPosition = this.getViewportScrollPosition();
const {
width,
height
} = this.getViewportSize();
return {
top: scrollPosition.top,
left: scrollPosition.left,
bottom: scrollPosition.top + height,
right: scrollPosition.left + width,
height,
width
};
}
/** Gets the (top, left) scroll position of the viewport. */
getViewportScrollPosition() {
if (!this._platform.isBrowser) {
return {
top: 0,
left: 0
};
}
const document2 = this._document;
const window2 = this._getWindow();
const documentElement = document2.documentElement;
const documentRect = documentElement.getBoundingClientRect();
const top = -documentRect.top || document2.body.scrollTop || window2.scrollY || documentElement.scrollTop || 0;
const left = -documentRect.left || document2.body.scrollLeft || window2.scrollX || documentElement.scrollLeft || 0;
return {
top,
left
};
}
/**
* Returns a stream that emits whenever the size of the viewport changes.
* This stream emits outside of the Angular zone.
* @param throttleTime Time in milliseconds to throttle the stream.
*/
change(throttleTime = DEFAULT_RESIZE_TIME) {
return throttleTime > 0 ? this._change.pipe(auditTime(throttleTime)) : this._change;
}
/** Use defaultView of injected document if available or fallback to global window reference */
_getWindow() {
return this._document.defaultView || window;
}
/** Updates the cached viewport size. */
_updateViewportSize() {
const window2 = this._getWindow();
this._viewportSize = this._platform.isBrowser ? {
width: window2.innerWidth,
height: window2.innerHeight
} : {
width: 0,
height: 0
};
}
static \u0275fac = function ViewportRuler_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ViewportRuler)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _ViewportRuler,
factory: _ViewportRuler.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ViewportRuler, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var VIRTUAL_SCROLLABLE = new InjectionToken("VIRTUAL_SCROLLABLE");
var CdkVirtualScrollable = class _CdkVirtualScrollable extends CdkScrollable {
constructor() {
super();
}
/**
* Measure the viewport size for the provided orientation.
*
* @param orientation The orientation to measure the size from.
*/
measureViewportSize(orientation) {
const viewportEl = this.elementRef.nativeElement;
return orientation === "horizontal" ? viewportEl.clientWidth : viewportEl.clientHeight;
}
static \u0275fac = function CdkVirtualScrollable_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkVirtualScrollable)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkVirtualScrollable,
features: [\u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkVirtualScrollable, [{
type: Directive
}], () => [], null);
})();
function rangesEqual(r1, r2) {
return r1.start == r2.start && r1.end == r2.end;
}
var SCROLL_SCHEDULER = typeof requestAnimationFrame !== "undefined" ? animationFrameScheduler : asapScheduler;
var CdkVirtualScrollViewport = class _CdkVirtualScrollViewport extends CdkVirtualScrollable {
elementRef = inject2(ElementRef);
_changeDetectorRef = inject2(ChangeDetectorRef);
_scrollStrategy = inject2(VIRTUAL_SCROLL_STRATEGY, {
optional: true
});
scrollable = inject2(VIRTUAL_SCROLLABLE, {
optional: true
});
_platform = inject2(Platform);
/** Emits when the viewport is detached from a CdkVirtualForOf. */
_detachedSubject = new Subject();
/** Emits when the rendered range changes. */
_renderedRangeSubject = new Subject();
/** The direction the viewport scrolls. */
get orientation() {
return this._orientation;
}
set orientation(orientation) {
if (this._orientation !== orientation) {
this._orientation = orientation;
this._calculateSpacerSize();
}
}
_orientation = "vertical";
/**
* Whether rendered items should persist in the DOM after scrolling out of view. By default, items
* will be removed.
*/
appendOnly = false;
// Note: we don't use the typical EventEmitter here because we need to subscribe to the scroll
// strategy lazily (i.e. only if the user is actually listening to the events). We do this because
// depending on how the strategy calculates the scrolled index, it may come at a cost to
// performance.
/** Emits when the index of the first element visible in the viewport changes. */
scrolledIndexChange = new Observable((observer) => this._scrollStrategy.scrolledIndexChange.subscribe((index) => Promise.resolve().then(() => this.ngZone.run(() => observer.next(index)))));
/** The element that wraps the rendered content. */
_contentWrapper;
/** A stream that emits whenever the rendered range changes. */
renderedRangeStream = this._renderedRangeSubject;
/**
* The total size of all content (in pixels), including content that is not currently rendered.
*/
_totalContentSize = 0;
/** A string representing the `style.width` property value to be used for the spacer element. */
_totalContentWidth = signal("", ...ngDevMode ? [{
debugName: "_totalContentWidth"
}] : []);
/** A string representing the `style.height` property value to be used for the spacer element. */
_totalContentHeight = signal("", ...ngDevMode ? [{
debugName: "_totalContentHeight"
}] : []);
/**
* The CSS transform applied to the rendered subset of items so that they appear within the bounds
* of the visible viewport.
*/
_renderedContentTransform;
/** The currently rendered range of indices. */
_renderedRange = {
start: 0,
end: 0
};
/** The length of the data bound to this viewport (in number of items). */
_dataLength = 0;
/** The size of the viewport (in pixels). */
_viewportSize = 0;
/** the currently attached CdkVirtualScrollRepeater. */
_forOf;
/** The last rendered content offset that was set. */
_renderedContentOffset = 0;
/**
* Whether the last rendered content offset was to the end of the content (and therefore needs to
* be rewritten as an offset to the start of the content).
*/
_renderedContentOffsetNeedsRewrite = false;
_changeDetectionNeeded = signal(false, ...ngDevMode ? [{
debugName: "_changeDetectionNeeded"
}] : []);
/** A list of functions to run after the next change detection cycle. */
_runAfterChangeDetection = [];
/** Subscription to changes in the viewport size. */
_viewportChanges = Subscription.EMPTY;
_injector = inject2(Injector);
_isDestroyed = false;
constructor() {
super();
const viewportRuler = inject2(ViewportRuler);
if (!this._scrollStrategy && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw Error('Error: cdk-virtual-scroll-viewport requires the "itemSize" property to be set.');
}
this._viewportChanges = viewportRuler.change().subscribe(() => {
this.checkViewportSize();
});
if (!this.scrollable) {
this.elementRef.nativeElement.classList.add("cdk-virtual-scrollable");
this.scrollable = this;
}
const ref = effect(() => {
if (this._changeDetectionNeeded()) {
this._doChangeDetection();
}
}, ...ngDevMode ? [{
debugName: "ref",
injector: inject2(ApplicationRef).injector
}] : [
// Using ApplicationRef injector is important here because we want this to be a root
// effect that runs before change detection of any application views (since we're depending on markForCheck marking parents dirty)
{
injector: inject2(ApplicationRef).injector
}
]);
inject2(DestroyRef).onDestroy(() => void ref.destroy());
}
ngOnInit() {
if (!this._platform.isBrowser) {
return;
}
if (this.scrollable === this) {
super.ngOnInit();
}
this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => {
this._measureViewportSize();
this._scrollStrategy.attach(this);
this.scrollable.elementScrolled().pipe(
// Start off with a fake scroll event so we properly detect our initial position.
startWith(null),
// Collect multiple events into one until the next animation frame. This way if
// there are multiple scroll events in the same frame we only need to recheck
// our layout once.
auditTime(0, SCROLL_SCHEDULER),
// Usually `elementScrolled` is completed when the scrollable is destroyed, but
// that may not be the case if a `CdkVirtualScrollableElement` is used so we have
// to unsubscribe here just in case.
takeUntil(this._destroyed)
).subscribe(() => this._scrollStrategy.onContentScrolled());
this._markChangeDetectionNeeded();
}));
}
ngOnDestroy() {
this.detach();
this._scrollStrategy.detach();
this._renderedRangeSubject.complete();
this._detachedSubject.complete();
this._viewportChanges.unsubscribe();
this._isDestroyed = true;
super.ngOnDestroy();
}
/** Attaches a `CdkVirtualScrollRepeater` to this viewport. */
attach(forOf) {
if (this._forOf && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw Error("CdkVirtualScrollViewport is already attached.");
}
this.ngZone.runOutsideAngular(() => {
this._forOf = forOf;
this._forOf.dataStream.pipe(takeUntil(this._detachedSubject)).subscribe((data) => {
const newLength = data.length;
if (newLength !== this._dataLength) {
this._dataLength = newLength;
this._scrollStrategy.onDataLengthChanged();
}
this._doChangeDetection();
});
});
}
/** Detaches the current `CdkVirtualForOf`. */
detach() {
this._forOf = null;
this._detachedSubject.next();
}
/** Gets the length of the data bound to this viewport (in number of items). */
getDataLength() {
return this._dataLength;
}
/** Gets the size of the viewport (in pixels). */
getViewportSize() {
return this._viewportSize;
}
// TODO(mmalerba): This is technically out of sync with what's really rendered until a render
// cycle happens. I'm being careful to only call it after the render cycle is complete and before
// setting it to something else, but its error prone and should probably be split into
// `pendingRange` and `renderedRange`, the latter reflecting whats actually in the DOM.
/** Get the current rendered range of items. */
getRenderedRange() {
return this._renderedRange;
}
measureBoundingClientRectWithScrollOffset(from2) {
return this.getElementRef().nativeElement.getBoundingClientRect()[from2];
}
/**
* Sets the total size of all content (in pixels), including content that is not currently
* rendered.
*/
setTotalContentSize(size) {
if (this._totalContentSize !== size) {
this._totalContentSize = size;
this._calculateSpacerSize();
this._markChangeDetectionNeeded();
}
}
/** Sets the currently rendered range of indices. */
setRenderedRange(range) {
if (!rangesEqual(this._renderedRange, range)) {
if (this.appendOnly) {
range = {
start: 0,
end: Math.max(this._renderedRange.end, range.end)
};
}
this._renderedRangeSubject.next(this._renderedRange = range);
this._markChangeDetectionNeeded(() => this._scrollStrategy.onContentRendered());
}
}
/**
* Gets the offset from the start of the viewport to the start of the rendered data (in pixels).
*/
getOffsetToRenderedContentStart() {
return this._renderedContentOffsetNeedsRewrite ? null : this._renderedContentOffset;
}
/**
* Sets the offset from the start of the viewport to either the start or end of the rendered data
* (in pixels).
*/
setRenderedContentOffset(offset, to = "to-start") {
offset = this.appendOnly && to === "to-start" ? 0 : offset;
const isRtl = this.dir && this.dir.value == "rtl";
const isHorizontal = this.orientation == "horizontal";
const axis = isHorizontal ? "X" : "Y";
const axisDirection = isHorizontal && isRtl ? -1 : 1;
let transform = `translate${axis}(${Number(axisDirection * offset)}px)`;
this._renderedContentOffset = offset;
if (to === "to-end") {
transform += ` translate${axis}(-100%)`;
this._renderedContentOffsetNeedsRewrite = true;
}
if (this._renderedContentTransform != transform) {
this._renderedContentTransform = transform;
this._markChangeDetectionNeeded(() => {
if (this._renderedContentOffsetNeedsRewrite) {
this._renderedContentOffset -= this.measureRenderedContentSize();
this._renderedContentOffsetNeedsRewrite = false;
this.setRenderedContentOffset(this._renderedContentOffset);
} else {
this._scrollStrategy.onRenderedOffsetChanged();
}
});
}
}
/**
* Scrolls to the given offset from the start of the viewport. Please note that this is not always
* the same as setting `scrollTop` or `scrollLeft`. In a horizontal viewport with right-to-left
* direction, this would be the equivalent of setting a fictional `scrollRight` property.
* @param offset The offset to scroll to.
* @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.
*/
scrollToOffset(offset, behavior = "auto") {
const options = {
behavior
};
if (this.orientation === "horizontal") {
options.start = offset;
} else {
options.top = offset;
}
this.scrollable.scrollTo(options);
}
/**
* Scrolls to the offset for the given index.
* @param index The index of the element to scroll to.
* @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.
*/
scrollToIndex(index, behavior = "auto") {
this._scrollStrategy.scrollToIndex(index, behavior);
}
/**
* Gets the current scroll offset from the start of the scrollable (in pixels).
* @param from The edge to measure the offset from. Defaults to 'top' in vertical mode and 'start'
* in horizontal mode.
*/
measureScrollOffset(from2) {
let measureScrollOffset;
if (this.scrollable == this) {
measureScrollOffset = (_from) => super.measureScrollOffset(_from);
} else {
measureScrollOffset = (_from) => this.scrollable.measureScrollOffset(_from);
}
return Math.max(0, measureScrollOffset(from2 ?? (this.orientation === "horizontal" ? "start" : "top")) - this.measureViewportOffset());
}
/**
* Measures the offset of the viewport from the scrolling container
* @param from The edge to measure from.
*/
measureViewportOffset(from2) {
let fromRect;
const LEFT = "left";
const RIGHT = "right";
const isRtl = this.dir?.value == "rtl";
if (from2 == "start") {
fromRect = isRtl ? RIGHT : LEFT;
} else if (from2 == "end") {
fromRect = isRtl ? LEFT : RIGHT;
} else if (from2) {
fromRect = from2;
} else {
fromRect = this.orientation === "horizontal" ? "left" : "top";
}
const scrollerClientRect = this.scrollable.measureBoundingClientRectWithScrollOffset(fromRect);
const viewportClientRect = this.elementRef.nativeElement.getBoundingClientRect()[fromRect];
return viewportClientRect - scrollerClientRect;
}
/** Measure the combined size of all of the rendered items. */
measureRenderedContentSize() {
const contentEl = this._contentWrapper.nativeElement;
return this.orientation === "horizontal" ? contentEl.offsetWidth : contentEl.offsetHeight;
}
/**
* Measure the total combined size of the given range. Throws if the range includes items that are
* not rendered.
*/
measureRangeSize(range) {
if (!this._forOf) {
return 0;
}
return this._forOf.measureRangeSize(range, this.orientation);
}
/** Update the viewport dimensions and re-render. */
checkViewportSize() {
this._measureViewportSize();
this._scrollStrategy.onDataLengthChanged();
}
/** Measure the viewport size. */
_measureViewportSize() {
this._viewportSize = this.scrollable.measureViewportSize(this.orientation);
}
/** Queue up change detection to run. */
_markChangeDetectionNeeded(runAfter) {
if (runAfter) {
this._runAfterChangeDetection.push(runAfter);
}
if (untracked2(this._changeDetectionNeeded)) {
return;
}
this.ngZone.runOutsideAngular(() => {
Promise.resolve().then(() => {
this.ngZone.run(() => {
this._changeDetectionNeeded.set(true);
});
});
});
}
/** Run change detection. */
_doChangeDetection() {
if (this._isDestroyed) {
return;
}
this.ngZone.run(() => {
this._changeDetectorRef.markForCheck();
this._contentWrapper.nativeElement.style.transform = this._renderedContentTransform;
afterNextRender(() => {
this._changeDetectionNeeded.set(false);
const runAfterChangeDetection = this._runAfterChangeDetection;
this._runAfterChangeDetection = [];
for (const fn of runAfterChangeDetection) {
fn();
}
}, {
injector: this._injector
});
});
}
/** Calculates the `style.width` and `style.height` for the spacer element. */
_calculateSpacerSize() {
this._totalContentHeight.set(this.orientation === "horizontal" ? "" : `${this._totalContentSize}px`);
this._totalContentWidth.set(this.orientation === "horizontal" ? `${this._totalContentSize}px` : "");
}
static \u0275fac = function CdkVirtualScrollViewport_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkVirtualScrollViewport)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: _CdkVirtualScrollViewport,
selectors: [["cdk-virtual-scroll-viewport"]],
viewQuery: function CdkVirtualScrollViewport_Query(rf, ctx) {
if (rf & 1) {
\u0275\u0275viewQuery(_c07, 7);
}
if (rf & 2) {
let _t;
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._contentWrapper = _t.first);
}
},
hostAttrs: [1, "cdk-virtual-scroll-viewport"],
hostVars: 4,
hostBindings: function CdkVirtualScrollViewport_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275classProp("cdk-virtual-scroll-orientation-horizontal", ctx.orientation === "horizontal")("cdk-virtual-scroll-orientation-vertical", ctx.orientation !== "horizontal");
}
},
inputs: {
orientation: "orientation",
appendOnly: [2, "appendOnly", "appendOnly", booleanAttribute]
},
outputs: {
scrolledIndexChange: "scrolledIndexChange"
},
features: [\u0275\u0275ProvidersFeature([{
provide: CdkScrollable,
useFactory: (virtualScrollable, viewport) => virtualScrollable || viewport,
deps: [[new Optional(), new Inject(VIRTUAL_SCROLLABLE)], _CdkVirtualScrollViewport]
}]), \u0275\u0275InheritDefinitionFeature],
ngContentSelectors: _c15,
decls: 4,
vars: 4,
consts: [["contentWrapper", ""], [1, "cdk-virtual-scroll-content-wrapper"], [1, "cdk-virtual-scroll-spacer"]],
template: function CdkVirtualScrollViewport_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275projectionDef();
\u0275\u0275domElementStart(0, "div", 1, 0);
\u0275\u0275projection(2);
\u0275\u0275domElementEnd();
\u0275\u0275domElement(3, "div", 2);
}
if (rf & 2) {
\u0275\u0275advance(3);
\u0275\u0275styleProp("width", ctx._totalContentWidth())("height", ctx._totalContentHeight());
}
},
styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}\n"],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkVirtualScrollViewport, [{
type: Component,
args: [{
selector: "cdk-virtual-scroll-viewport",
host: {
"class": "cdk-virtual-scroll-viewport",
"[class.cdk-virtual-scroll-orientation-horizontal]": 'orientation === "horizontal"',
"[class.cdk-virtual-scroll-orientation-vertical]": 'orientation !== "horizontal"'
},
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [{
provide: CdkScrollable,
useFactory: (virtualScrollable, viewport) => virtualScrollable || viewport,
deps: [[new Optional(), new Inject(VIRTUAL_SCROLLABLE)], CdkVirtualScrollViewport]
}],
template: '<!--\n Wrap the rendered content in an element that will be used to offset it based on the scroll\n position.\n-->\n<div #contentWrapper class="cdk-virtual-scroll-content-wrapper">\n <ng-content></ng-content>\n</div>\n<!--\n Spacer used to force the scrolling container to the correct size for the *total* number of items\n so that the scrollbar captures the size of the entire data set.\n-->\n<div class="cdk-virtual-scroll-spacer"\n [style.width]="_totalContentWidth()" [style.height]="_totalContentHeight()"></div>\n',
styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}\n"]
}]
}], () => [], {
orientation: [{
type: Input
}],
appendOnly: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
scrolledIndexChange: [{
type: Output
}],
_contentWrapper: [{
type: ViewChild,
args: ["contentWrapper", {
static: true
}]
}]
});
})();
function getOffset(orientation, direction, node) {
const el = node;
if (!el.getBoundingClientRect) {
return 0;
}
const rect = el.getBoundingClientRect();
if (orientation === "horizontal") {
return direction === "start" ? rect.left : rect.right;
}
return direction === "start" ? rect.top : rect.bottom;
}
var CdkVirtualForOf = class _CdkVirtualForOf {
_viewContainerRef = inject2(ViewContainerRef);
_template = inject2(TemplateRef);
_differs = inject2(IterableDiffers);
_viewRepeater = inject2(_VIEW_REPEATER_STRATEGY);
_viewport = inject2(CdkVirtualScrollViewport, {
skipSelf: true
});
/** Emits when the rendered view of the data changes. */
viewChange = new Subject();
/** Subject that emits when a new DataSource instance is given. */
_dataSourceChanges = new Subject();
/** The DataSource to display. */
get cdkVirtualForOf() {
return this._cdkVirtualForOf;
}
set cdkVirtualForOf(value) {
this._cdkVirtualForOf = value;
if (isDataSource(value)) {
this._dataSourceChanges.next(value);
} else {
this._dataSourceChanges.next(new ArrayDataSource(isObservable(value) ? value : Array.from(value || [])));
}
}
_cdkVirtualForOf;
/**
* The `TrackByFunction` to use for tracking changes. The `TrackByFunction` takes the index and
* the item and produces a value to be used as the item's identity when tracking changes.
*/
get cdkVirtualForTrackBy() {
return this._cdkVirtualForTrackBy;
}
set cdkVirtualForTrackBy(fn) {
this._needsUpdate = true;
this._cdkVirtualForTrackBy = fn ? (index, item) => fn(index + (this._renderedRange ? this._renderedRange.start : 0), item) : void 0;
}
_cdkVirtualForTrackBy;
/** The template used to stamp out new elements. */
set cdkVirtualForTemplate(value) {
if (value) {
this._needsUpdate = true;
this._template = value;
}
}
/**
* The size of the cache used to store templates that are not being used for re-use later.
* Setting the cache size to `0` will disable caching. Defaults to 20 templates.
*/
get cdkVirtualForTemplateCacheSize() {
return this._viewRepeater.viewCacheSize;
}
set cdkVirtualForTemplateCacheSize(size) {
this._viewRepeater.viewCacheSize = coerceNumberProperty(size);
}
/** Emits whenever the data in the current DataSource changes. */
dataStream = this._dataSourceChanges.pipe(
// Start off with null `DataSource`.
startWith(null),
// Bundle up the previous and current data sources so we can work with both.
pairwise(),
// Use `_changeDataSource` to disconnect from the previous data source and connect to the
// new one, passing back a stream of data changes which we run through `switchMap` to give
// us a data stream that emits the latest data from whatever the current `DataSource` is.
switchMap(([prev, cur]) => this._changeDataSource(prev, cur)),
// Replay the last emitted data when someone subscribes.
shareReplay(1)
);
/** The differ used to calculate changes to the data. */
_differ = null;
/** The most recent data emitted from the DataSource. */
_data;
/** The currently rendered items. */
_renderedItems;
/** The currently rendered range of indices. */
_renderedRange;
/** Whether the rendered data should be updated during the next ngDoCheck cycle. */
_needsUpdate = false;
_destroyed = new Subject();
constructor() {
const ngZone = inject2(NgZone);
this.dataStream.subscribe((data) => {
this._data = data;
this._onRenderedDataChange();
});
this._viewport.renderedRangeStream.pipe(takeUntil(this._destroyed)).subscribe((range) => {
this._renderedRange = range;
if (this.viewChange.observers.length) {
ngZone.run(() => this.viewChange.next(this._renderedRange));
}
this._onRenderedDataChange();
});
this._viewport.attach(this);
}
/**
* Measures the combined size (width for horizontal orientation, height for vertical) of all items
* in the specified range. Throws an error if the range includes items that are not currently
* rendered.
*/
measureRangeSize(range, orientation) {
if (range.start >= range.end) {
return 0;
}
if ((range.start < this._renderedRange.start || range.end > this._renderedRange.end) && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw Error(`Error: attempted to measure an item that isn't rendered.`);
}
const renderedStartIndex = range.start - this._renderedRange.start;
const rangeLen = range.end - range.start;
let firstNode;
let lastNode;
for (let i = 0; i < rangeLen; i++) {
const view = this._viewContainerRef.get(i + renderedStartIndex);
if (view && view.rootNodes.length) {
firstNode = lastNode = view.rootNodes[0];
break;
}
}
for (let i = rangeLen - 1; i > -1; i--) {
const view = this._viewContainerRef.get(i + renderedStartIndex);
if (view && view.rootNodes.length) {
lastNode = view.rootNodes[view.rootNodes.length - 1];
break;
}
}
return firstNode && lastNode ? getOffset(orientation, "end", lastNode) - getOffset(orientation, "start", firstNode) : 0;
}
ngDoCheck() {
if (this._differ && this._needsUpdate) {
const changes = this._differ.diff(this._renderedItems);
if (!changes) {
this._updateContext();
} else {
this._applyChanges(changes);
}
this._needsUpdate = false;
}
}
ngOnDestroy() {
this._viewport.detach();
this._dataSourceChanges.next(void 0);
this._dataSourceChanges.complete();
this.viewChange.complete();
this._destroyed.next();
this._destroyed.complete();
this._viewRepeater.detach();
}
/** React to scroll state changes in the viewport. */
_onRenderedDataChange() {
if (!this._renderedRange) {
return;
}
this._renderedItems = this._data.slice(this._renderedRange.start, this._renderedRange.end);
if (!this._differ) {
this._differ = this._differs.find(this._renderedItems).create((index, item) => {
return this.cdkVirtualForTrackBy ? this.cdkVirtualForTrackBy(index, item) : item;
});
}
this._needsUpdate = true;
}
/** Swap out one `DataSource` for another. */
_changeDataSource(oldDs, newDs) {
if (oldDs) {
oldDs.disconnect(this);
}
this._needsUpdate = true;
return newDs ? newDs.connect(this) : of();
}
/** Update the `CdkVirtualForOfContext` for all views. */
_updateContext() {
const count = this._data.length;
let i = this._viewContainerRef.length;
while (i--) {
const view = this._viewContainerRef.get(i);
view.context.index = this._renderedRange.start + i;
view.context.count = count;
this._updateComputedContextProperties(view.context);
view.detectChanges();
}
}
/** Apply changes to the DOM. */
_applyChanges(changes) {
this._viewRepeater.applyChanges(changes, this._viewContainerRef, (record, _adjustedPreviousIndex, currentIndex) => this._getEmbeddedViewArgs(record, currentIndex), (record) => record.item);
changes.forEachIdentityChange((record) => {
const view = this._viewContainerRef.get(record.currentIndex);
view.context.$implicit = record.item;
});
const count = this._data.length;
let i = this._viewContainerRef.length;
while (i--) {
const view = this._viewContainerRef.get(i);
view.context.index = this._renderedRange.start + i;
view.context.count = count;
this._updateComputedContextProperties(view.context);
}
}
/** Update the computed properties on the `CdkVirtualForOfContext`. */
_updateComputedContextProperties(context2) {
context2.first = context2.index === 0;
context2.last = context2.index === context2.count - 1;
context2.even = context2.index % 2 === 0;
context2.odd = !context2.even;
}
_getEmbeddedViewArgs(record, index) {
return {
templateRef: this._template,
context: {
$implicit: record.item,
// It's guaranteed that the iterable is not "undefined" or "null" because we only
// generate views for elements if the "cdkVirtualForOf" iterable has elements.
cdkVirtualForOf: this._cdkVirtualForOf,
index: -1,
count: -1,
first: false,
last: false,
odd: false,
even: false
},
index
};
}
static ngTemplateContextGuard(directive, context2) {
return true;
}
static \u0275fac = function CdkVirtualForOf_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkVirtualForOf)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkVirtualForOf,
selectors: [["", "cdkVirtualFor", "", "cdkVirtualForOf", ""]],
inputs: {
cdkVirtualForOf: "cdkVirtualForOf",
cdkVirtualForTrackBy: "cdkVirtualForTrackBy",
cdkVirtualForTemplate: "cdkVirtualForTemplate",
cdkVirtualForTemplateCacheSize: "cdkVirtualForTemplateCacheSize"
},
features: [\u0275\u0275ProvidersFeature([{
provide: _VIEW_REPEATER_STRATEGY,
useClass: _RecycleViewRepeaterStrategy
}])]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkVirtualForOf, [{
type: Directive,
args: [{
selector: "[cdkVirtualFor][cdkVirtualForOf]",
providers: [{
provide: _VIEW_REPEATER_STRATEGY,
useClass: _RecycleViewRepeaterStrategy
}]
}]
}], () => [], {
cdkVirtualForOf: [{
type: Input
}],
cdkVirtualForTrackBy: [{
type: Input
}],
cdkVirtualForTemplate: [{
type: Input
}],
cdkVirtualForTemplateCacheSize: [{
type: Input
}]
});
})();
var CdkVirtualScrollableElement = class _CdkVirtualScrollableElement extends CdkVirtualScrollable {
constructor() {
super();
}
measureBoundingClientRectWithScrollOffset(from2) {
return this.getElementRef().nativeElement.getBoundingClientRect()[from2] - this.measureScrollOffset(from2);
}
static \u0275fac = function CdkVirtualScrollableElement_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkVirtualScrollableElement)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkVirtualScrollableElement,
selectors: [["", "cdkVirtualScrollingElement", ""]],
hostAttrs: [1, "cdk-virtual-scrollable"],
features: [\u0275\u0275ProvidersFeature([{
provide: VIRTUAL_SCROLLABLE,
useExisting: _CdkVirtualScrollableElement
}]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkVirtualScrollableElement, [{
type: Directive,
args: [{
selector: "[cdkVirtualScrollingElement]",
providers: [{
provide: VIRTUAL_SCROLLABLE,
useExisting: CdkVirtualScrollableElement
}],
host: {
"class": "cdk-virtual-scrollable"
}
}]
}], () => [], null);
})();
var CdkVirtualScrollableWindow = class _CdkVirtualScrollableWindow extends CdkVirtualScrollable {
constructor() {
super();
const document2 = inject2(DOCUMENT);
this.elementRef = new ElementRef(document2.documentElement);
this._scrollElement = document2;
}
measureBoundingClientRectWithScrollOffset(from2) {
return this.getElementRef().nativeElement.getBoundingClientRect()[from2];
}
static \u0275fac = function CdkVirtualScrollableWindow_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkVirtualScrollableWindow)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkVirtualScrollableWindow,
selectors: [["cdk-virtual-scroll-viewport", "scrollWindow", ""]],
features: [\u0275\u0275ProvidersFeature([{
provide: VIRTUAL_SCROLLABLE,
useExisting: _CdkVirtualScrollableWindow
}]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkVirtualScrollableWindow, [{
type: Directive,
args: [{
selector: "cdk-virtual-scroll-viewport[scrollWindow]",
providers: [{
provide: VIRTUAL_SCROLLABLE,
useExisting: CdkVirtualScrollableWindow
}]
}]
}], () => [], null);
})();
var CdkScrollableModule = class _CdkScrollableModule {
static \u0275fac = function CdkScrollableModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkScrollableModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _CdkScrollableModule,
imports: [CdkScrollable],
exports: [CdkScrollable]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkScrollableModule, [{
type: NgModule,
args: [{
exports: [CdkScrollable],
imports: [CdkScrollable]
}]
}], null, null);
})();
var ScrollingModule = class _ScrollingModule {
static \u0275fac = function ScrollingModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ScrollingModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _ScrollingModule,
imports: [BidiModule, CdkScrollableModule, CdkVirtualScrollViewport, CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollableWindow, CdkVirtualScrollableElement],
exports: [BidiModule, CdkScrollableModule, CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport, CdkVirtualScrollableWindow, CdkVirtualScrollableElement]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
imports: [BidiModule, CdkScrollableModule, BidiModule, CdkScrollableModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ScrollingModule, [{
type: NgModule,
args: [{
imports: [BidiModule, CdkScrollableModule, CdkVirtualScrollViewport, CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollableWindow, CdkVirtualScrollableElement],
exports: [BidiModule, CdkScrollableModule, CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport, CdkVirtualScrollableWindow, CdkVirtualScrollableElement]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/portal.mjs
function throwNullPortalError() {
throw Error("Must provide a portal to attach");
}
function throwPortalAlreadyAttachedError() {
throw Error("Host already has a portal attached");
}
function throwPortalOutletAlreadyDisposedError() {
throw Error("This PortalOutlet has already been disposed");
}
function throwUnknownPortalTypeError() {
throw Error("Attempting to attach an unknown Portal type. BasePortalOutlet accepts either a ComponentPortal or a TemplatePortal.");
}
function throwNullPortalOutletError() {
throw Error("Attempting to attach a portal to a null PortalOutlet");
}
function throwNoPortalAttachedError() {
throw Error("Attempting to detach a portal that is not attached to a host");
}
var Portal = class {
_attachedHost;
/** Attach this portal to a host. */
attach(host) {
if (typeof ngDevMode === "undefined" || ngDevMode) {
if (host == null) {
throwNullPortalOutletError();
}
if (host.hasAttached()) {
throwPortalAlreadyAttachedError();
}
}
this._attachedHost = host;
return host.attach(this);
}
/** Detach this portal from its host */
detach() {
let host = this._attachedHost;
if (host != null) {
this._attachedHost = null;
host.detach();
} else if (typeof ngDevMode === "undefined" || ngDevMode) {
throwNoPortalAttachedError();
}
}
/** Whether this portal is attached to a host. */
get isAttached() {
return this._attachedHost != null;
}
/**
* Sets the PortalOutlet reference without performing `attach()`. This is used directly by
* the PortalOutlet when it is performing an `attach()` or `detach()`.
*/
setAttachedHost(host) {
this._attachedHost = host;
}
};
var ComponentPortal = class extends Portal {
/** The type of the component that will be instantiated for attachment. */
component;
/**
* Where the attached component should live in Angular's *logical* component tree.
* This is different from where the component *renders*, which is determined by the PortalOutlet.
* The origin is necessary when the host is outside of the Angular application context.
*/
viewContainerRef;
/** Injector used for the instantiation of the component. */
injector;
/**
* List of DOM nodes that should be projected through `<ng-content>` of the attached component.
*/
projectableNodes;
constructor(component, viewContainerRef, injector, projectableNodes) {
super();
this.component = component;
this.viewContainerRef = viewContainerRef;
this.injector = injector;
this.projectableNodes = projectableNodes;
}
};
var TemplatePortal = class extends Portal {
templateRef;
viewContainerRef;
context;
injector;
constructor(templateRef, viewContainerRef, context2, injector) {
super();
this.templateRef = templateRef;
this.viewContainerRef = viewContainerRef;
this.context = context2;
this.injector = injector;
}
get origin() {
return this.templateRef.elementRef;
}
/**
* Attach the portal to the provided `PortalOutlet`.
* When a context is provided it will override the `context` property of the `TemplatePortal`
* instance.
*/
attach(host, context2 = this.context) {
this.context = context2;
return super.attach(host);
}
detach() {
this.context = void 0;
return super.detach();
}
};
var DomPortal = class extends Portal {
/** DOM node hosting the portal's content. */
element;
constructor(element) {
super();
this.element = element instanceof ElementRef ? element.nativeElement : element;
}
};
var BasePortalOutlet = class {
/** The portal currently attached to the host. */
_attachedPortal;
/** A function that will permanently dispose this host. */
_disposeFn;
/** Whether this host has already been permanently disposed. */
_isDisposed = false;
/** Whether this host has an attached portal. */
hasAttached() {
return !!this._attachedPortal;
}
/** Attaches a portal. */
attach(portal) {
if (typeof ngDevMode === "undefined" || ngDevMode) {
if (!portal) {
throwNullPortalError();
}
if (this.hasAttached()) {
throwPortalAlreadyAttachedError();
}
if (this._isDisposed) {
throwPortalOutletAlreadyDisposedError();
}
}
if (portal instanceof ComponentPortal) {
this._attachedPortal = portal;
return this.attachComponentPortal(portal);
} else if (portal instanceof TemplatePortal) {
this._attachedPortal = portal;
return this.attachTemplatePortal(portal);
} else if (this.attachDomPortal && portal instanceof DomPortal) {
this._attachedPortal = portal;
return this.attachDomPortal(portal);
}
if (typeof ngDevMode === "undefined" || ngDevMode) {
throwUnknownPortalTypeError();
}
}
// @breaking-change 10.0.0 `attachDomPortal` to become a required abstract method.
attachDomPortal = null;
/** Detaches a previously attached portal. */
detach() {
if (this._attachedPortal) {
this._attachedPortal.setAttachedHost(null);
this._attachedPortal = null;
}
this._invokeDisposeFn();
}
/** Permanently dispose of this portal host. */
dispose() {
if (this.hasAttached()) {
this.detach();
}
this._invokeDisposeFn();
this._isDisposed = true;
}
/** @docs-private */
setDisposeFn(fn) {
this._disposeFn = fn;
}
_invokeDisposeFn() {
if (this._disposeFn) {
this._disposeFn();
this._disposeFn = null;
}
}
};
var DomPortalOutlet = class extends BasePortalOutlet {
outletElement;
_appRef;
_defaultInjector;
/**
* @param outletElement Element into which the content is projected.
* @param _appRef Reference to the application. Only used in component portals when there
* is no `ViewContainerRef` available.
* @param _defaultInjector Injector to use as a fallback when the portal being attached doesn't
* have one. Only used for component portals.
*/
constructor(outletElement, _appRef, _defaultInjector) {
super();
this.outletElement = outletElement;
this._appRef = _appRef;
this._defaultInjector = _defaultInjector;
}
/**
* Attach the given ComponentPortal to DOM element.
* @param portal Portal to be attached
* @returns Reference to the created component.
*/
attachComponentPortal(portal) {
let componentRef;
if (portal.viewContainerRef) {
const injector = portal.injector || portal.viewContainerRef.injector;
const ngModuleRef = injector.get(NgModuleRef$1, null, {
optional: true
}) || void 0;
componentRef = portal.viewContainerRef.createComponent(portal.component, {
index: portal.viewContainerRef.length,
injector,
ngModuleRef,
projectableNodes: portal.projectableNodes || void 0
});
this.setDisposeFn(() => componentRef.destroy());
} else {
if ((typeof ngDevMode === "undefined" || ngDevMode) && !this._appRef) {
throw Error("Cannot attach component portal to outlet without an ApplicationRef.");
}
const appRef = this._appRef;
const elementInjector = portal.injector || this._defaultInjector || Injector.NULL;
const environmentInjector = elementInjector.get(EnvironmentInjector, appRef.injector);
componentRef = createComponent(portal.component, {
elementInjector,
environmentInjector,
projectableNodes: portal.projectableNodes || void 0
});
appRef.attachView(componentRef.hostView);
this.setDisposeFn(() => {
if (appRef.viewCount > 0) {
appRef.detachView(componentRef.hostView);
}
componentRef.destroy();
});
}
this.outletElement.appendChild(this._getComponentRootNode(componentRef));
this._attachedPortal = portal;
return componentRef;
}
/**
* Attaches a template portal to the DOM as an embedded view.
* @param portal Portal to be attached.
* @returns Reference to the created embedded view.
*/
attachTemplatePortal(portal) {
let viewContainer = portal.viewContainerRef;
let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context, {
injector: portal.injector
});
viewRef.rootNodes.forEach((rootNode) => this.outletElement.appendChild(rootNode));
viewRef.detectChanges();
this.setDisposeFn(() => {
let index = viewContainer.indexOf(viewRef);
if (index !== -1) {
viewContainer.remove(index);
}
});
this._attachedPortal = portal;
return viewRef;
}
/**
* Attaches a DOM portal by transferring its content into the outlet.
* @param portal Portal to be attached.
* @deprecated To be turned into a method.
* @breaking-change 10.0.0
*/
attachDomPortal = (portal) => {
const element = portal.element;
if (!element.parentNode && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw Error("DOM portal content must be attached to a parent node.");
}
const anchorNode = this.outletElement.ownerDocument.createComment("dom-portal");
element.parentNode.insertBefore(anchorNode, element);
this.outletElement.appendChild(element);
this._attachedPortal = portal;
super.setDisposeFn(() => {
if (anchorNode.parentNode) {
anchorNode.parentNode.replaceChild(element, anchorNode);
}
});
};
/**
* Clears out a portal from the DOM.
*/
dispose() {
super.dispose();
this.outletElement.remove();
}
/** Gets the root HTMLElement for an instantiated component. */
_getComponentRootNode(componentRef) {
return componentRef.hostView.rootNodes[0];
}
};
var CdkPortal = class _CdkPortal extends TemplatePortal {
constructor() {
const templateRef = inject2(TemplateRef);
const viewContainerRef = inject2(ViewContainerRef);
super(templateRef, viewContainerRef);
}
static \u0275fac = function CdkPortal_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkPortal)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkPortal,
selectors: [["", "cdkPortal", ""]],
exportAs: ["cdkPortal"],
features: [\u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkPortal, [{
type: Directive,
args: [{
selector: "[cdkPortal]",
exportAs: "cdkPortal"
}]
}], () => [], null);
})();
var TemplatePortalDirective = class _TemplatePortalDirective extends CdkPortal {
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275TemplatePortalDirective_BaseFactory;
return function TemplatePortalDirective_Factory(__ngFactoryType__) {
return (\u0275TemplatePortalDirective_BaseFactory || (\u0275TemplatePortalDirective_BaseFactory = \u0275\u0275getInheritedFactory(_TemplatePortalDirective)))(__ngFactoryType__ || _TemplatePortalDirective);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _TemplatePortalDirective,
selectors: [["", "cdk-portal", ""], ["", "portal", ""]],
exportAs: ["cdkPortal"],
features: [\u0275\u0275ProvidersFeature([{
provide: CdkPortal,
useExisting: _TemplatePortalDirective
}]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TemplatePortalDirective, [{
type: Directive,
args: [{
selector: "[cdk-portal], [portal]",
exportAs: "cdkPortal",
providers: [{
provide: CdkPortal,
useExisting: TemplatePortalDirective
}]
}]
}], null, null);
})();
var CdkPortalOutlet = class _CdkPortalOutlet extends BasePortalOutlet {
_moduleRef = inject2(NgModuleRef$1, {
optional: true
});
_document = inject2(DOCUMENT);
_viewContainerRef = inject2(ViewContainerRef);
/** Whether the portal component is initialized. */
_isInitialized = false;
/** Reference to the currently-attached component/view ref. */
_attachedRef;
constructor() {
super();
}
/** Portal associated with the Portal outlet. */
get portal() {
return this._attachedPortal;
}
set portal(portal) {
if (this.hasAttached() && !portal && !this._isInitialized) {
return;
}
if (this.hasAttached()) {
super.detach();
}
if (portal) {
super.attach(portal);
}
this._attachedPortal = portal || null;
}
/** Emits when a portal is attached to the outlet. */
attached = new EventEmitter();
/** Component or view reference that is attached to the portal. */
get attachedRef() {
return this._attachedRef;
}
ngOnInit() {
this._isInitialized = true;
}
ngOnDestroy() {
super.dispose();
this._attachedRef = this._attachedPortal = null;
}
/**
* Attach the given ComponentPortal to this PortalOutlet.
*
* @param portal Portal to be attached to the portal outlet.
* @returns Reference to the created component.
*/
attachComponentPortal(portal) {
portal.setAttachedHost(this);
const viewContainerRef = portal.viewContainerRef != null ? portal.viewContainerRef : this._viewContainerRef;
const ref = viewContainerRef.createComponent(portal.component, {
index: viewContainerRef.length,
injector: portal.injector || viewContainerRef.injector,
projectableNodes: portal.projectableNodes || void 0,
ngModuleRef: this._moduleRef || void 0
});
if (viewContainerRef !== this._viewContainerRef) {
this._getRootNode().appendChild(ref.hostView.rootNodes[0]);
}
super.setDisposeFn(() => ref.destroy());
this._attachedPortal = portal;
this._attachedRef = ref;
this.attached.emit(ref);
return ref;
}
/**
* Attach the given TemplatePortal to this PortalHost as an embedded View.
* @param portal Portal to be attached.
* @returns Reference to the created embedded view.
*/
attachTemplatePortal(portal) {
portal.setAttachedHost(this);
const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context, {
injector: portal.injector
});
super.setDisposeFn(() => this._viewContainerRef.clear());
this._attachedPortal = portal;
this._attachedRef = viewRef;
this.attached.emit(viewRef);
return viewRef;
}
/**
* Attaches the given DomPortal to this PortalHost by moving all of the portal content into it.
* @param portal Portal to be attached.
* @deprecated To be turned into a method.
* @breaking-change 10.0.0
*/
attachDomPortal = (portal) => {
const element = portal.element;
if (!element.parentNode && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw Error("DOM portal content must be attached to a parent node.");
}
const anchorNode = this._document.createComment("dom-portal");
portal.setAttachedHost(this);
element.parentNode.insertBefore(anchorNode, element);
this._getRootNode().appendChild(element);
this._attachedPortal = portal;
super.setDisposeFn(() => {
if (anchorNode.parentNode) {
anchorNode.parentNode.replaceChild(element, anchorNode);
}
});
};
/** Gets the root node of the portal outlet. */
_getRootNode() {
const nativeElement = this._viewContainerRef.element.nativeElement;
return nativeElement.nodeType === nativeElement.ELEMENT_NODE ? nativeElement : nativeElement.parentNode;
}
static \u0275fac = function CdkPortalOutlet_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkPortalOutlet)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkPortalOutlet,
selectors: [["", "cdkPortalOutlet", ""]],
inputs: {
portal: [0, "cdkPortalOutlet", "portal"]
},
outputs: {
attached: "attached"
},
exportAs: ["cdkPortalOutlet"],
features: [\u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkPortalOutlet, [{
type: Directive,
args: [{
selector: "[cdkPortalOutlet]",
exportAs: "cdkPortalOutlet"
}]
}], () => [], {
portal: [{
type: Input,
args: ["cdkPortalOutlet"]
}],
attached: [{
type: Output
}]
});
})();
var PortalHostDirective = class _PortalHostDirective extends CdkPortalOutlet {
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275PortalHostDirective_BaseFactory;
return function PortalHostDirective_Factory(__ngFactoryType__) {
return (\u0275PortalHostDirective_BaseFactory || (\u0275PortalHostDirective_BaseFactory = \u0275\u0275getInheritedFactory(_PortalHostDirective)))(__ngFactoryType__ || _PortalHostDirective);
};
})();
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _PortalHostDirective,
selectors: [["", "cdkPortalHost", ""], ["", "portalHost", ""]],
inputs: {
portal: [0, "cdkPortalHost", "portal"]
},
exportAs: ["cdkPortalHost"],
features: [\u0275\u0275ProvidersFeature([{
provide: CdkPortalOutlet,
useExisting: _PortalHostDirective
}]), \u0275\u0275InheritDefinitionFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PortalHostDirective, [{
type: Directive,
args: [{
selector: "[cdkPortalHost], [portalHost]",
exportAs: "cdkPortalHost",
inputs: [{
name: "portal",
alias: "cdkPortalHost"
}],
providers: [{
provide: CdkPortalOutlet,
useExisting: PortalHostDirective
}]
}]
}], null, null);
})();
var PortalModule = class _PortalModule {
static \u0275fac = function PortalModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _PortalModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _PortalModule,
imports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],
exports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PortalModule, [{
type: NgModule,
args: [{
imports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],
exports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/overlay-module.mjs
var scrollBehaviorSupported2 = supportsScrollBehavior();
function createBlockScrollStrategy(injector) {
return new BlockScrollStrategy(injector.get(ViewportRuler), injector.get(DOCUMENT));
}
var BlockScrollStrategy = class {
_viewportRuler;
_previousHTMLStyles = {
top: "",
left: ""
};
_previousScrollPosition;
_isEnabled = false;
_document;
constructor(_viewportRuler, document2) {
this._viewportRuler = _viewportRuler;
this._document = document2;
}
/** Attaches this scroll strategy to an overlay. */
attach() {
}
/** Blocks page-level scroll while the attached overlay is open. */
enable() {
if (this._canBeEnabled()) {
const root = this._document.documentElement;
this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition();
this._previousHTMLStyles.left = root.style.left || "";
this._previousHTMLStyles.top = root.style.top || "";
root.style.left = coerceCssPixelValue(-this._previousScrollPosition.left);
root.style.top = coerceCssPixelValue(-this._previousScrollPosition.top);
root.classList.add("cdk-global-scrollblock");
this._isEnabled = true;
}
}
/** Unblocks page-level scroll while the attached overlay is open. */
disable() {
if (this._isEnabled) {
const html = this._document.documentElement;
const body = this._document.body;
const htmlStyle = html.style;
const bodyStyle = body.style;
const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || "";
const previousBodyScrollBehavior = bodyStyle.scrollBehavior || "";
this._isEnabled = false;
htmlStyle.left = this._previousHTMLStyles.left;
htmlStyle.top = this._previousHTMLStyles.top;
html.classList.remove("cdk-global-scrollblock");
if (scrollBehaviorSupported2) {
htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = "auto";
}
window.scroll(this._previousScrollPosition.left, this._previousScrollPosition.top);
if (scrollBehaviorSupported2) {
htmlStyle.scrollBehavior = previousHtmlScrollBehavior;
bodyStyle.scrollBehavior = previousBodyScrollBehavior;
}
}
}
_canBeEnabled() {
const html = this._document.documentElement;
if (html.classList.contains("cdk-global-scrollblock") || this._isEnabled) {
return false;
}
const rootElement = this._document.documentElement;
const viewport = this._viewportRuler.getViewportSize();
return rootElement.scrollHeight > viewport.height || rootElement.scrollWidth > viewport.width;
}
};
function getMatScrollStrategyAlreadyAttachedError() {
return Error(`Scroll strategy has already been attached.`);
}
function createCloseScrollStrategy(injector, config2) {
return new CloseScrollStrategy(injector.get(ScrollDispatcher), injector.get(NgZone), injector.get(ViewportRuler), config2);
}
var CloseScrollStrategy = class {
_scrollDispatcher;
_ngZone;
_viewportRuler;
_config;
_scrollSubscription = null;
_overlayRef;
_initialScrollPosition;
constructor(_scrollDispatcher, _ngZone, _viewportRuler, _config) {
this._scrollDispatcher = _scrollDispatcher;
this._ngZone = _ngZone;
this._viewportRuler = _viewportRuler;
this._config = _config;
}
/** Attaches this scroll strategy to an overlay. */
attach(overlayRef) {
if (this._overlayRef && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw getMatScrollStrategyAlreadyAttachedError();
}
this._overlayRef = overlayRef;
}
/** Enables the closing of the attached overlay on scroll. */
enable() {
if (this._scrollSubscription) {
return;
}
const stream = this._scrollDispatcher.scrolled(0).pipe(filter((scrollable) => {
return !scrollable || !this._overlayRef.overlayElement.contains(scrollable.getElementRef().nativeElement);
}));
if (this._config && this._config.threshold && this._config.threshold > 1) {
this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;
this._scrollSubscription = stream.subscribe(() => {
const scrollPosition = this._viewportRuler.getViewportScrollPosition().top;
if (Math.abs(scrollPosition - this._initialScrollPosition) > this._config.threshold) {
this._detach();
} else {
this._overlayRef.updatePosition();
}
});
} else {
this._scrollSubscription = stream.subscribe(this._detach);
}
}
/** Disables the closing the attached overlay on scroll. */
disable() {
if (this._scrollSubscription) {
this._scrollSubscription.unsubscribe();
this._scrollSubscription = null;
}
}
detach() {
this.disable();
this._overlayRef = null;
}
/** Detaches the overlay ref and disables the scroll strategy. */
_detach = () => {
this.disable();
if (this._overlayRef.hasAttached()) {
this._ngZone.run(() => this._overlayRef.detach());
}
};
};
var NoopScrollStrategy = class {
/** Does nothing, as this scroll strategy is a no-op. */
enable() {
}
/** Does nothing, as this scroll strategy is a no-op. */
disable() {
}
/** Does nothing, as this scroll strategy is a no-op. */
attach() {
}
};
function isElementScrolledOutsideView(element, scrollContainers) {
return scrollContainers.some((containerBounds) => {
const outsideAbove = element.bottom < containerBounds.top;
const outsideBelow = element.top > containerBounds.bottom;
const outsideLeft = element.right < containerBounds.left;
const outsideRight = element.left > containerBounds.right;
return outsideAbove || outsideBelow || outsideLeft || outsideRight;
});
}
function isElementClippedByScrolling(element, scrollContainers) {
return scrollContainers.some((scrollContainerRect) => {
const clippedAbove = element.top < scrollContainerRect.top;
const clippedBelow = element.bottom > scrollContainerRect.bottom;
const clippedLeft = element.left < scrollContainerRect.left;
const clippedRight = element.right > scrollContainerRect.right;
return clippedAbove || clippedBelow || clippedLeft || clippedRight;
});
}
function createRepositionScrollStrategy(injector, config2) {
return new RepositionScrollStrategy(injector.get(ScrollDispatcher), injector.get(ViewportRuler), injector.get(NgZone), config2);
}
var RepositionScrollStrategy = class {
_scrollDispatcher;
_viewportRuler;
_ngZone;
_config;
_scrollSubscription = null;
_overlayRef;
constructor(_scrollDispatcher, _viewportRuler, _ngZone, _config) {
this._scrollDispatcher = _scrollDispatcher;
this._viewportRuler = _viewportRuler;
this._ngZone = _ngZone;
this._config = _config;
}
/** Attaches this scroll strategy to an overlay. */
attach(overlayRef) {
if (this._overlayRef && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw getMatScrollStrategyAlreadyAttachedError();
}
this._overlayRef = overlayRef;
}
/** Enables repositioning of the attached overlay on scroll. */
enable() {
if (!this._scrollSubscription) {
const throttle = this._config ? this._config.scrollThrottle : 0;
this._scrollSubscription = this._scrollDispatcher.scrolled(throttle).subscribe(() => {
this._overlayRef.updatePosition();
if (this._config && this._config.autoClose) {
const overlayRect = this._overlayRef.overlayElement.getBoundingClientRect();
const {
width,
height
} = this._viewportRuler.getViewportSize();
const parentRects = [{
width,
height,
bottom: height,
right: width,
top: 0,
left: 0
}];
if (isElementScrolledOutsideView(overlayRect, parentRects)) {
this.disable();
this._ngZone.run(() => this._overlayRef.detach());
}
}
});
}
}
/** Disables repositioning of the attached overlay on scroll. */
disable() {
if (this._scrollSubscription) {
this._scrollSubscription.unsubscribe();
this._scrollSubscription = null;
}
}
detach() {
this.disable();
this._overlayRef = null;
}
};
var ScrollStrategyOptions = class _ScrollStrategyOptions {
_injector = inject2(Injector);
constructor() {
}
/** Do nothing on scroll. */
noop = () => new NoopScrollStrategy();
/**
* Close the overlay as soon as the user scrolls.
* @param config Configuration to be used inside the scroll strategy.
*/
close = (config2) => createCloseScrollStrategy(this._injector, config2);
/** Block scrolling. */
block = () => createBlockScrollStrategy(this._injector);
/**
* Update the overlay's position on scroll.
* @param config Configuration to be used inside the scroll strategy.
* Allows debouncing the reposition calls.
*/
reposition = (config2) => createRepositionScrollStrategy(this._injector, config2);
static \u0275fac = function ScrollStrategyOptions_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _ScrollStrategyOptions)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _ScrollStrategyOptions,
factory: _ScrollStrategyOptions.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ScrollStrategyOptions, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var OverlayConfig = class {
/** Strategy with which to position the overlay. */
positionStrategy;
/** Strategy to be used when handling scroll events while the overlay is open. */
scrollStrategy = new NoopScrollStrategy();
/** Custom class to add to the overlay pane. */
panelClass = "";
/** Whether the overlay has a backdrop. */
hasBackdrop = false;
/** Custom class to add to the backdrop */
backdropClass = "cdk-overlay-dark-backdrop";
/** Whether to disable any built-in animations. */
disableAnimations;
/** The width of the overlay panel. If a number is provided, pixel units are assumed. */
width;
/** The height of the overlay panel. If a number is provided, pixel units are assumed. */
height;
/** The min-width of the overlay panel. If a number is provided, pixel units are assumed. */
minWidth;
/** The min-height of the overlay panel. If a number is provided, pixel units are assumed. */
minHeight;
/** The max-width of the overlay panel. If a number is provided, pixel units are assumed. */
maxWidth;
/** The max-height of the overlay panel. If a number is provided, pixel units are assumed. */
maxHeight;
/**
* Direction of the text in the overlay panel. If a `Directionality` instance
* is passed in, the overlay will handle changes to its value automatically.
*/
direction;
/**
* Whether the overlay should be disposed of when the user goes backwards/forwards in history.
* Note that this usually doesn't include clicking on links (unless the user is using
* the `HashLocationStrategy`).
*/
disposeOnNavigation = false;
constructor(config2) {
if (config2) {
const configKeys = Object.keys(config2);
for (const key of configKeys) {
if (config2[key] !== void 0) {
this[key] = config2[key];
}
}
}
}
};
var ConnectedOverlayPositionChange = class {
connectionPair;
scrollableViewProperties;
constructor(connectionPair, scrollableViewProperties) {
this.connectionPair = connectionPair;
this.scrollableViewProperties = scrollableViewProperties;
}
};
function validateVerticalPosition(property, value) {
if (value !== "top" && value !== "bottom" && value !== "center") {
throw Error(`ConnectedPosition: Invalid ${property} "${value}". Expected "top", "bottom" or "center".`);
}
}
function validateHorizontalPosition(property, value) {
if (value !== "start" && value !== "end" && value !== "center") {
throw Error(`ConnectedPosition: Invalid ${property} "${value}". Expected "start", "end" or "center".`);
}
}
var BaseOverlayDispatcher = class _BaseOverlayDispatcher {
/** Currently attached overlays in the order they were attached. */
_attachedOverlays = [];
_document = inject2(DOCUMENT);
_isAttached;
constructor() {
}
ngOnDestroy() {
this.detach();
}
/** Add a new overlay to the list of attached overlay refs. */
add(overlayRef) {
this.remove(overlayRef);
this._attachedOverlays.push(overlayRef);
}
/** Remove an overlay from the list of attached overlay refs. */
remove(overlayRef) {
const index = this._attachedOverlays.indexOf(overlayRef);
if (index > -1) {
this._attachedOverlays.splice(index, 1);
}
if (this._attachedOverlays.length === 0) {
this.detach();
}
}
static \u0275fac = function BaseOverlayDispatcher_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _BaseOverlayDispatcher)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _BaseOverlayDispatcher,
factory: _BaseOverlayDispatcher.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BaseOverlayDispatcher, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var OverlayKeyboardDispatcher = class _OverlayKeyboardDispatcher extends BaseOverlayDispatcher {
_ngZone = inject2(NgZone);
_renderer = inject2(RendererFactory2).createRenderer(null, null);
_cleanupKeydown;
/** Add a new overlay to the list of attached overlay refs. */
add(overlayRef) {
super.add(overlayRef);
if (!this._isAttached) {
this._ngZone.runOutsideAngular(() => {
this._cleanupKeydown = this._renderer.listen("body", "keydown", this._keydownListener);
});
this._isAttached = true;
}
}
/** Detaches the global keyboard event listener. */
detach() {
if (this._isAttached) {
this._cleanupKeydown?.();
this._isAttached = false;
}
}
/** Keyboard event listener that will be attached to the body. */
_keydownListener = (event) => {
const overlays = this._attachedOverlays;
for (let i = overlays.length - 1; i > -1; i--) {
if (overlays[i]._keydownEvents.observers.length > 0) {
this._ngZone.run(() => overlays[i]._keydownEvents.next(event));
break;
}
}
};
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275OverlayKeyboardDispatcher_BaseFactory;
return function OverlayKeyboardDispatcher_Factory(__ngFactoryType__) {
return (\u0275OverlayKeyboardDispatcher_BaseFactory || (\u0275OverlayKeyboardDispatcher_BaseFactory = \u0275\u0275getInheritedFactory(_OverlayKeyboardDispatcher)))(__ngFactoryType__ || _OverlayKeyboardDispatcher);
};
})();
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _OverlayKeyboardDispatcher,
factory: _OverlayKeyboardDispatcher.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(OverlayKeyboardDispatcher, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], null, null);
})();
var OverlayOutsideClickDispatcher = class _OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
_platform = inject2(Platform);
_ngZone = inject2(NgZone);
_renderer = inject2(RendererFactory2).createRenderer(null, null);
_cursorOriginalValue;
_cursorStyleIsSet = false;
_pointerDownEventTarget;
_cleanups;
/** Add a new overlay to the list of attached overlay refs. */
add(overlayRef) {
super.add(overlayRef);
if (!this._isAttached) {
const body = this._document.body;
const eventOptions = {
capture: true
};
const renderer = this._renderer;
this._cleanups = this._ngZone.runOutsideAngular(() => [renderer.listen(body, "pointerdown", this._pointerDownListener, eventOptions), renderer.listen(body, "click", this._clickListener, eventOptions), renderer.listen(body, "auxclick", this._clickListener, eventOptions), renderer.listen(body, "contextmenu", this._clickListener, eventOptions)]);
if (this._platform.IOS && !this._cursorStyleIsSet) {
this._cursorOriginalValue = body.style.cursor;
body.style.cursor = "pointer";
this._cursorStyleIsSet = true;
}
this._isAttached = true;
}
}
/** Detaches the global keyboard event listener. */
detach() {
if (this._isAttached) {
this._cleanups?.forEach((cleanup) => cleanup());
this._cleanups = void 0;
if (this._platform.IOS && this._cursorStyleIsSet) {
this._document.body.style.cursor = this._cursorOriginalValue;
this._cursorStyleIsSet = false;
}
this._isAttached = false;
}
}
/** Store pointerdown event target to track origin of click. */
_pointerDownListener = (event) => {
this._pointerDownEventTarget = _getEventTarget(event);
};
/** Click event listener that will be attached to the body propagate phase. */
_clickListener = (event) => {
const target = _getEventTarget(event);
const origin = event.type === "click" && this._pointerDownEventTarget ? this._pointerDownEventTarget : target;
this._pointerDownEventTarget = null;
const overlays = this._attachedOverlays.slice();
for (let i = overlays.length - 1; i > -1; i--) {
const overlayRef = overlays[i];
if (overlayRef._outsidePointerEvents.observers.length < 1 || !overlayRef.hasAttached()) {
continue;
}
if (containsPierceShadowDom(overlayRef.overlayElement, target) || containsPierceShadowDom(overlayRef.overlayElement, origin)) {
break;
}
const outsidePointerEvents = overlayRef._outsidePointerEvents;
if (this._ngZone) {
this._ngZone.run(() => outsidePointerEvents.next(event));
} else {
outsidePointerEvents.next(event);
}
}
};
static \u0275fac = /* @__PURE__ */ (() => {
let \u0275OverlayOutsideClickDispatcher_BaseFactory;
return function OverlayOutsideClickDispatcher_Factory(__ngFactoryType__) {
return (\u0275OverlayOutsideClickDispatcher_BaseFactory || (\u0275OverlayOutsideClickDispatcher_BaseFactory = \u0275\u0275getInheritedFactory(_OverlayOutsideClickDispatcher)))(__ngFactoryType__ || _OverlayOutsideClickDispatcher);
};
})();
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _OverlayOutsideClickDispatcher,
factory: _OverlayOutsideClickDispatcher.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(OverlayOutsideClickDispatcher, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], null, null);
})();
function containsPierceShadowDom(parent, child) {
const supportsShadowRoot = typeof ShadowRoot !== "undefined" && ShadowRoot;
let current = child;
while (current) {
if (current === parent) {
return true;
}
current = supportsShadowRoot && current instanceof ShadowRoot ? current.host : current.parentNode;
}
return false;
}
var _CdkOverlayStyleLoader = class __CdkOverlayStyleLoader {
static \u0275fac = function _CdkOverlayStyleLoader_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || __CdkOverlayStyleLoader)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: __CdkOverlayStyleLoader,
selectors: [["ng-component"]],
hostAttrs: ["cdk-overlay-style-loader", ""],
decls: 0,
vars: 0,
template: function _CdkOverlayStyleLoader_Template(rf, ctx) {
},
styles: [".cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}\n"],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(_CdkOverlayStyleLoader, [{
type: Component,
args: [{
template: "",
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
"cdk-overlay-style-loader": ""
},
styles: [".cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}\n"]
}]
}], null, null);
})();
var OverlayContainer = class _OverlayContainer {
_platform = inject2(Platform);
_containerElement;
_document = inject2(DOCUMENT);
_styleLoader = inject2(_CdkPrivateStyleLoader);
constructor() {
}
ngOnDestroy() {
this._containerElement?.remove();
}
/**
* This method returns the overlay container element. It will lazily
* create the element the first time it is called to facilitate using
* the container in non-browser environments.
* @returns the container element
*/
getContainerElement() {
this._loadStyles();
if (!this._containerElement) {
this._createContainer();
}
return this._containerElement;
}
/**
* Create the overlay container element, which is simply a div
* with the 'cdk-overlay-container' class on the document body.
*/
_createContainer() {
const containerClass = "cdk-overlay-container";
if (this._platform.isBrowser || _isTestEnvironment()) {
const oppositePlatformContainers = this._document.querySelectorAll(`.${containerClass}[platform="server"], .${containerClass}[platform="test"]`);
for (let i = 0; i < oppositePlatformContainers.length; i++) {
oppositePlatformContainers[i].remove();
}
}
const container = this._document.createElement("div");
container.classList.add(containerClass);
if (_isTestEnvironment()) {
container.setAttribute("platform", "test");
} else if (!this._platform.isBrowser) {
container.setAttribute("platform", "server");
}
this._document.body.appendChild(container);
this._containerElement = container;
}
/** Loads the structural styles necessary for the overlay to work. */
_loadStyles() {
this._styleLoader.load(_CdkOverlayStyleLoader);
}
static \u0275fac = function OverlayContainer_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _OverlayContainer)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _OverlayContainer,
factory: _OverlayContainer.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(OverlayContainer, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var BackdropRef = class {
_renderer;
_ngZone;
element;
_cleanupClick;
_cleanupTransitionEnd;
_fallbackTimeout;
constructor(document2, _renderer, _ngZone, onClick) {
this._renderer = _renderer;
this._ngZone = _ngZone;
this.element = document2.createElement("div");
this.element.classList.add("cdk-overlay-backdrop");
this._cleanupClick = _renderer.listen(this.element, "click", onClick);
}
detach() {
this._ngZone.runOutsideAngular(() => {
const element = this.element;
clearTimeout(this._fallbackTimeout);
this._cleanupTransitionEnd?.();
this._cleanupTransitionEnd = this._renderer.listen(element, "transitionend", this.dispose);
this._fallbackTimeout = setTimeout(this.dispose, 500);
element.style.pointerEvents = "none";
element.classList.remove("cdk-overlay-backdrop-showing");
});
}
dispose = () => {
clearTimeout(this._fallbackTimeout);
this._cleanupClick?.();
this._cleanupTransitionEnd?.();
this._cleanupClick = this._cleanupTransitionEnd = this._fallbackTimeout = void 0;
this.element.remove();
};
};
var OverlayRef = class {
_portalOutlet;
_host;
_pane;
_config;
_ngZone;
_keyboardDispatcher;
_document;
_location;
_outsideClickDispatcher;
_animationsDisabled;
_injector;
_renderer;
_backdropClick = new Subject();
_attachments = new Subject();
_detachments = new Subject();
_positionStrategy;
_scrollStrategy;
_locationChanges = Subscription.EMPTY;
_backdropRef = null;
_detachContentMutationObserver;
_detachContentAfterRenderRef;
/**
* Reference to the parent of the `_host` at the time it was detached. Used to restore
* the `_host` to its original position in the DOM when it gets re-attached.
*/
_previousHostParent;
/** Stream of keydown events dispatched to this overlay. */
_keydownEvents = new Subject();
/** Stream of mouse outside events dispatched to this overlay. */
_outsidePointerEvents = new Subject();
/** Reference to the currently-running `afterNextRender` call. */
_afterNextRenderRef;
constructor(_portalOutlet, _host, _pane, _config, _ngZone, _keyboardDispatcher, _document2, _location, _outsideClickDispatcher, _animationsDisabled2 = false, _injector, _renderer) {
this._portalOutlet = _portalOutlet;
this._host = _host;
this._pane = _pane;
this._config = _config;
this._ngZone = _ngZone;
this._keyboardDispatcher = _keyboardDispatcher;
this._document = _document2;
this._location = _location;
this._outsideClickDispatcher = _outsideClickDispatcher;
this._animationsDisabled = _animationsDisabled2;
this._injector = _injector;
this._renderer = _renderer;
if (_config.scrollStrategy) {
this._scrollStrategy = _config.scrollStrategy;
this._scrollStrategy.attach(this);
}
this._positionStrategy = _config.positionStrategy;
}
/** The overlay's HTML element */
get overlayElement() {
return this._pane;
}
/** The overlay's backdrop HTML element. */
get backdropElement() {
return this._backdropRef?.element || null;
}
/**
* Wrapper around the panel element. Can be used for advanced
* positioning where a wrapper with specific styling is
* required around the overlay pane.
*/
get hostElement() {
return this._host;
}
/**
* Attaches content, given via a Portal, to the overlay.
* If the overlay is configured to have a backdrop, it will be created.
*
* @param portal Portal instance to which to attach the overlay.
* @returns The portal attachment result.
*/
attach(portal) {
if (!this._host.parentElement && this._previousHostParent) {
this._previousHostParent.appendChild(this._host);
}
const attachResult = this._portalOutlet.attach(portal);
if (this._positionStrategy) {
this._positionStrategy.attach(this);
}
this._updateStackingOrder();
this._updateElementSize();
this._updateElementDirection();
if (this._scrollStrategy) {
this._scrollStrategy.enable();
}
this._afterNextRenderRef?.destroy();
this._afterNextRenderRef = afterNextRender(() => {
if (this.hasAttached()) {
this.updatePosition();
}
}, {
injector: this._injector
});
this._togglePointerEvents(true);
if (this._config.hasBackdrop) {
this._attachBackdrop();
}
if (this._config.panelClass) {
this._toggleClasses(this._pane, this._config.panelClass, true);
}
this._attachments.next();
this._completeDetachContent();
this._keyboardDispatcher.add(this);
if (this._config.disposeOnNavigation) {
this._locationChanges = this._location.subscribe(() => this.dispose());
}
this._outsideClickDispatcher.add(this);
if (typeof attachResult?.onDestroy === "function") {
attachResult.onDestroy(() => {
if (this.hasAttached()) {
this._ngZone.runOutsideAngular(() => Promise.resolve().then(() => this.detach()));
}
});
}
return attachResult;
}
/**
* Detaches an overlay from a portal.
* @returns The portal detachment result.
*/
detach() {
if (!this.hasAttached()) {
return;
}
this.detachBackdrop();
this._togglePointerEvents(false);
if (this._positionStrategy && this._positionStrategy.detach) {
this._positionStrategy.detach();
}
if (this._scrollStrategy) {
this._scrollStrategy.disable();
}
const detachmentResult = this._portalOutlet.detach();
this._detachments.next();
this._completeDetachContent();
this._keyboardDispatcher.remove(this);
this._detachContentWhenEmpty();
this._locationChanges.unsubscribe();
this._outsideClickDispatcher.remove(this);
return detachmentResult;
}
/** Cleans up the overlay from the DOM. */
dispose() {
const isAttached = this.hasAttached();
if (this._positionStrategy) {
this._positionStrategy.dispose();
}
this._disposeScrollStrategy();
this._backdropRef?.dispose();
this._locationChanges.unsubscribe();
this._keyboardDispatcher.remove(this);
this._portalOutlet.dispose();
this._attachments.complete();
this._backdropClick.complete();
this._keydownEvents.complete();
this._outsidePointerEvents.complete();
this._outsideClickDispatcher.remove(this);
this._host?.remove();
this._afterNextRenderRef?.destroy();
this._previousHostParent = this._pane = this._host = this._backdropRef = null;
if (isAttached) {
this._detachments.next();
}
this._detachments.complete();
this._completeDetachContent();
}
/** Whether the overlay has attached content. */
hasAttached() {
return this._portalOutlet.hasAttached();
}
/** Gets an observable that emits when the backdrop has been clicked. */
backdropClick() {
return this._backdropClick;
}
/** Gets an observable that emits when the overlay has been attached. */
attachments() {
return this._attachments;
}
/** Gets an observable that emits when the overlay has been detached. */
detachments() {
return this._detachments;
}
/** Gets an observable of keydown events targeted to this overlay. */
keydownEvents() {
return this._keydownEvents;
}
/** Gets an observable of pointer events targeted outside this overlay. */
outsidePointerEvents() {
return this._outsidePointerEvents;
}
/** Gets the current overlay configuration, which is immutable. */
getConfig() {
return this._config;
}
/** Updates the position of the overlay based on the position strategy. */
updatePosition() {
if (this._positionStrategy) {
this._positionStrategy.apply();
}
}
/** Switches to a new position strategy and updates the overlay position. */
updatePositionStrategy(strategy) {
if (strategy === this._positionStrategy) {
return;
}
if (this._positionStrategy) {
this._positionStrategy.dispose();
}
this._positionStrategy = strategy;
if (this.hasAttached()) {
strategy.attach(this);
this.updatePosition();
}
}
/** Update the size properties of the overlay. */
updateSize(sizeConfig) {
this._config = __spreadValues(__spreadValues({}, this._config), sizeConfig);
this._updateElementSize();
}
/** Sets the LTR/RTL direction for the overlay. */
setDirection(dir) {
this._config = __spreadProps(__spreadValues({}, this._config), {
direction: dir
});
this._updateElementDirection();
}
/** Add a CSS class or an array of classes to the overlay pane. */
addPanelClass(classes) {
if (this._pane) {
this._toggleClasses(this._pane, classes, true);
}
}
/** Remove a CSS class or an array of classes from the overlay pane. */
removePanelClass(classes) {
if (this._pane) {
this._toggleClasses(this._pane, classes, false);
}
}
/**
* Returns the layout direction of the overlay panel.
*/
getDirection() {
const direction = this._config.direction;
if (!direction) {
return "ltr";
}
return typeof direction === "string" ? direction : direction.value;
}
/** Switches to a new scroll strategy. */
updateScrollStrategy(strategy) {
if (strategy === this._scrollStrategy) {
return;
}
this._disposeScrollStrategy();
this._scrollStrategy = strategy;
if (this.hasAttached()) {
strategy.attach(this);
strategy.enable();
}
}
/** Updates the text direction of the overlay panel. */
_updateElementDirection() {
this._host.setAttribute("dir", this.getDirection());
}
/** Updates the size of the overlay element based on the overlay config. */
_updateElementSize() {
if (!this._pane) {
return;
}
const style = this._pane.style;
style.width = coerceCssPixelValue(this._config.width);
style.height = coerceCssPixelValue(this._config.height);
style.minWidth = coerceCssPixelValue(this._config.minWidth);
style.minHeight = coerceCssPixelValue(this._config.minHeight);
style.maxWidth = coerceCssPixelValue(this._config.maxWidth);
style.maxHeight = coerceCssPixelValue(this._config.maxHeight);
}
/** Toggles the pointer events for the overlay pane element. */
_togglePointerEvents(enablePointer) {
this._pane.style.pointerEvents = enablePointer ? "" : "none";
}
/** Attaches a backdrop for this overlay. */
_attachBackdrop() {
const showingClass = "cdk-overlay-backdrop-showing";
this._backdropRef?.dispose();
this._backdropRef = new BackdropRef(this._document, this._renderer, this._ngZone, (event) => {
this._backdropClick.next(event);
});
if (this._animationsDisabled) {
this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation");
}
if (this._config.backdropClass) {
this._toggleClasses(this._backdropRef.element, this._config.backdropClass, true);
}
this._host.parentElement.insertBefore(this._backdropRef.element, this._host);
if (!this._animationsDisabled && typeof requestAnimationFrame !== "undefined") {
this._ngZone.runOutsideAngular(() => {
requestAnimationFrame(() => this._backdropRef?.element.classList.add(showingClass));
});
} else {
this._backdropRef.element.classList.add(showingClass);
}
}
/**
* Updates the stacking order of the element, moving it to the top if necessary.
* This is required in cases where one overlay was detached, while another one,
* that should be behind it, was destroyed. The next time both of them are opened,
* the stacking will be wrong, because the detached element's pane will still be
* in its original DOM position.
*/
_updateStackingOrder() {
if (this._host.nextSibling) {
this._host.parentNode.appendChild(this._host);
}
}
/** Detaches the backdrop (if any) associated with the overlay. */
detachBackdrop() {
if (this._animationsDisabled) {
this._backdropRef?.dispose();
this._backdropRef = null;
} else {
this._backdropRef?.detach();
}
}
/** Toggles a single CSS class or an array of classes on an element. */
_toggleClasses(element, cssClasses, isAdd) {
const classes = coerceArray(cssClasses || []).filter((c) => !!c);
if (classes.length) {
isAdd ? element.classList.add(...classes) : element.classList.remove(...classes);
}
}
/** Detaches the overlay once the content finishes animating and is removed from the DOM. */
_detachContentWhenEmpty() {
let rethrow = false;
try {
this._detachContentAfterRenderRef = afterNextRender(() => {
rethrow = true;
this._detachContent();
}, {
injector: this._injector
});
} catch (e) {
if (rethrow) {
throw e;
}
this._detachContent();
}
if (globalThis.MutationObserver && this._pane) {
this._detachContentMutationObserver ||= new globalThis.MutationObserver(() => {
this._detachContent();
});
this._detachContentMutationObserver.observe(this._pane, {
childList: true
});
}
}
_detachContent() {
if (!this._pane || !this._host || this._pane.children.length === 0) {
if (this._pane && this._config.panelClass) {
this._toggleClasses(this._pane, this._config.panelClass, false);
}
if (this._host && this._host.parentElement) {
this._previousHostParent = this._host.parentElement;
this._host.remove();
}
this._completeDetachContent();
}
}
_completeDetachContent() {
this._detachContentAfterRenderRef?.destroy();
this._detachContentAfterRenderRef = void 0;
this._detachContentMutationObserver?.disconnect();
}
/** Disposes of a scroll strategy. */
_disposeScrollStrategy() {
const scrollStrategy = this._scrollStrategy;
scrollStrategy?.disable();
scrollStrategy?.detach?.();
}
};
var boundingBoxClass = "cdk-overlay-connected-position-bounding-box";
var cssUnitPattern = /([A-Za-z%]+)$/;
function createFlexibleConnectedPositionStrategy(injector, origin) {
return new FlexibleConnectedPositionStrategy(origin, injector.get(ViewportRuler), injector.get(DOCUMENT), injector.get(Platform), injector.get(OverlayContainer));
}
var FlexibleConnectedPositionStrategy = class {
_viewportRuler;
_document;
_platform;
_overlayContainer;
/** The overlay to which this strategy is attached. */
_overlayRef;
/** Whether we're performing the very first positioning of the overlay. */
_isInitialRender;
/** Last size used for the bounding box. Used to avoid resizing the overlay after open. */
_lastBoundingBoxSize = {
width: 0,
height: 0
};
/** Whether the overlay was pushed in a previous positioning. */
_isPushed = false;
/** Whether the overlay can be pushed on-screen on the initial open. */
_canPush = true;
/** Whether the overlay can grow via flexible width/height after the initial open. */
_growAfterOpen = false;
/** Whether the overlay's width and height can be constrained to fit within the viewport. */
_hasFlexibleDimensions = true;
/** Whether the overlay position is locked. */
_positionLocked = false;
/** Cached origin dimensions */
_originRect;
/** Cached overlay dimensions */
_overlayRect;
/** Cached viewport dimensions */
_viewportRect;
/** Cached container dimensions */
_containerRect;
/** Amount of space that must be maintained between the overlay and the edge of the viewport. */
_viewportMargin = 0;
/** The Scrollable containers used to check scrollable view properties on position change. */
_scrollables = [];
/** Ordered list of preferred positions, from most to least desirable. */
_preferredPositions = [];
/** The origin element against which the overlay will be positioned. */
_origin;
/** The overlay pane element. */
_pane;
/** Whether the strategy has been disposed of already. */
_isDisposed;
/**
* Parent element for the overlay panel used to constrain the overlay panel's size to fit
* within the viewport.
*/
_boundingBox;
/** The last position to have been calculated as the best fit position. */
_lastPosition;
/** The last calculated scroll visibility. Only tracked */
_lastScrollVisibility;
/** Subject that emits whenever the position changes. */
_positionChanges = new Subject();
/** Subscription to viewport size changes. */
_resizeSubscription = Subscription.EMPTY;
/** Default offset for the overlay along the x axis. */
_offsetX = 0;
/** Default offset for the overlay along the y axis. */
_offsetY = 0;
/** Selector to be used when finding the elements on which to set the transform origin. */
_transformOriginSelector;
/** Keeps track of the CSS classes that the position strategy has applied on the overlay panel. */
_appliedPanelClasses = [];
/** Amount by which the overlay was pushed in each axis during the last time it was positioned. */
_previousPushAmount;
/** Observable sequence of position changes. */
positionChanges = this._positionChanges;
/** Ordered list of preferred positions, from most to least desirable. */
get positions() {
return this._preferredPositions;
}
constructor(connectedTo, _viewportRuler, _document2, _platform, _overlayContainer) {
this._viewportRuler = _viewportRuler;
this._document = _document2;
this._platform = _platform;
this._overlayContainer = _overlayContainer;
this.setOrigin(connectedTo);
}
/** Attaches this position strategy to an overlay. */
attach(overlayRef) {
if (this._overlayRef && overlayRef !== this._overlayRef && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw Error("This position strategy is already attached to an overlay");
}
this._validatePositions();
overlayRef.hostElement.classList.add(boundingBoxClass);
this._overlayRef = overlayRef;
this._boundingBox = overlayRef.hostElement;
this._pane = overlayRef.overlayElement;
this._isDisposed = false;
this._isInitialRender = true;
this._lastPosition = null;
this._resizeSubscription.unsubscribe();
this._resizeSubscription = this._viewportRuler.change().subscribe(() => {
this._isInitialRender = true;
this.apply();
});
}
/**
* Updates the position of the overlay element, using whichever preferred position relative
* to the origin best fits on-screen.
*
* The selection of a position goes as follows:
* - If any positions fit completely within the viewport as-is,
* choose the first position that does so.
* - If flexible dimensions are enabled and at least one satisfies the given minimum width/height,
* choose the position with the greatest available size modified by the positions' weight.
* - If pushing is enabled, take the position that went off-screen the least and push it
* on-screen.
* - If none of the previous criteria were met, use the position that goes off-screen the least.
* @docs-private
*/
apply() {
if (this._isDisposed || !this._platform.isBrowser) {
return;
}
if (!this._isInitialRender && this._positionLocked && this._lastPosition) {
this.reapplyLastPosition();
return;
}
this._clearPanelClasses();
this._resetOverlayElementStyles();
this._resetBoundingBoxStyles();
this._viewportRect = this._getNarrowedViewportRect();
this._originRect = this._getOriginRect();
this._overlayRect = this._pane.getBoundingClientRect();
this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();
const originRect = this._originRect;
const overlayRect = this._overlayRect;
const viewportRect = this._viewportRect;
const containerRect = this._containerRect;
const flexibleFits = [];
let fallback;
for (let pos of this._preferredPositions) {
let originPoint = this._getOriginPoint(originRect, containerRect, pos);
let overlayPoint = this._getOverlayPoint(originPoint, overlayRect, pos);
let overlayFit = this._getOverlayFit(overlayPoint, overlayRect, viewportRect, pos);
if (overlayFit.isCompletelyWithinViewport) {
this._isPushed = false;
this._applyPosition(pos, originPoint);
return;
}
if (this._canFitWithFlexibleDimensions(overlayFit, overlayPoint, viewportRect)) {
flexibleFits.push({
position: pos,
origin: originPoint,
overlayRect,
boundingBoxRect: this._calculateBoundingBoxRect(originPoint, pos)
});
continue;
}
if (!fallback || fallback.overlayFit.visibleArea < overlayFit.visibleArea) {
fallback = {
overlayFit,
overlayPoint,
originPoint,
position: pos,
overlayRect
};
}
}
if (flexibleFits.length) {
let bestFit = null;
let bestScore = -1;
for (const fit of flexibleFits) {
const score = fit.boundingBoxRect.width * fit.boundingBoxRect.height * (fit.position.weight || 1);
if (score > bestScore) {
bestScore = score;
bestFit = fit;
}
}
this._isPushed = false;
this._applyPosition(bestFit.position, bestFit.origin);
return;
}
if (this._canPush) {
this._isPushed = true;
this._applyPosition(fallback.position, fallback.originPoint);
return;
}
this._applyPosition(fallback.position, fallback.originPoint);
}
detach() {
this._clearPanelClasses();
this._lastPosition = null;
this._previousPushAmount = null;
this._resizeSubscription.unsubscribe();
}
/** Cleanup after the element gets destroyed. */
dispose() {
if (this._isDisposed) {
return;
}
if (this._boundingBox) {
extendStyles(this._boundingBox.style, {
top: "",
left: "",
right: "",
bottom: "",
height: "",
width: "",
alignItems: "",
justifyContent: ""
});
}
if (this._pane) {
this._resetOverlayElementStyles();
}
if (this._overlayRef) {
this._overlayRef.hostElement.classList.remove(boundingBoxClass);
}
this.detach();
this._positionChanges.complete();
this._overlayRef = this._boundingBox = null;
this._isDisposed = true;
}
/**
* This re-aligns the overlay element with the trigger in its last calculated position,
* even if a position higher in the "preferred positions" list would now fit. This
* allows one to re-align the panel without changing the orientation of the panel.
*/
reapplyLastPosition() {
if (this._isDisposed || !this._platform.isBrowser) {
return;
}
const lastPosition = this._lastPosition;
if (lastPosition) {
this._originRect = this._getOriginRect();
this._overlayRect = this._pane.getBoundingClientRect();
this._viewportRect = this._getNarrowedViewportRect();
this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();
const originPoint = this._getOriginPoint(this._originRect, this._containerRect, lastPosition);
this._applyPosition(lastPosition, originPoint);
} else {
this.apply();
}
}
/**
* Sets the list of Scrollable containers that host the origin element so that
* on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
* Scrollable must be an ancestor element of the strategy's origin element.
*/
withScrollableContainers(scrollables) {
this._scrollables = scrollables;
return this;
}
/**
* Adds new preferred positions.
* @param positions List of positions options for this overlay.
*/
withPositions(positions) {
this._preferredPositions = positions;
if (positions.indexOf(this._lastPosition) === -1) {
this._lastPosition = null;
}
this._validatePositions();
return this;
}
/**
* Sets a minimum distance the overlay may be positioned to the edge of the viewport.
* @param margin Required margin between the overlay and the viewport edge in pixels.
*/
withViewportMargin(margin) {
this._viewportMargin = margin;
return this;
}
/** Sets whether the overlay's width and height can be constrained to fit within the viewport. */
withFlexibleDimensions(flexibleDimensions = true) {
this._hasFlexibleDimensions = flexibleDimensions;
return this;
}
/** Sets whether the overlay can grow after the initial open via flexible width/height. */
withGrowAfterOpen(growAfterOpen = true) {
this._growAfterOpen = growAfterOpen;
return this;
}
/** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */
withPush(canPush = true) {
this._canPush = canPush;
return this;
}
/**
* Sets whether the overlay's position should be locked in after it is positioned
* initially. When an overlay is locked in, it won't attempt to reposition itself
* when the position is re-applied (e.g. when the user scrolls away).
* @param isLocked Whether the overlay should locked in.
*/
withLockedPosition(isLocked = true) {
this._positionLocked = isLocked;
return this;
}
/**
* Sets the origin, relative to which to position the overlay.
* Using an element origin is useful for building components that need to be positioned
* relatively to a trigger (e.g. dropdown menus or tooltips), whereas using a point can be
* used for cases like contextual menus which open relative to the user's pointer.
* @param origin Reference to the new origin.
*/
setOrigin(origin) {
this._origin = origin;
return this;
}
/**
* Sets the default offset for the overlay's connection point on the x-axis.
* @param offset New offset in the X axis.
*/
withDefaultOffsetX(offset) {
this._offsetX = offset;
return this;
}
/**
* Sets the default offset for the overlay's connection point on the y-axis.
* @param offset New offset in the Y axis.
*/
withDefaultOffsetY(offset) {
this._offsetY = offset;
return this;
}
/**
* Configures that the position strategy should set a `transform-origin` on some elements
* inside the overlay, depending on the current position that is being applied. This is
* useful for the cases where the origin of an animation can change depending on the
* alignment of the overlay.
* @param selector CSS selector that will be used to find the target
* elements onto which to set the transform origin.
*/
withTransformOriginOn(selector) {
this._transformOriginSelector = selector;
return this;
}
/**
* Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
*/
_getOriginPoint(originRect, containerRect, pos) {
let x;
if (pos.originX == "center") {
x = originRect.left + originRect.width / 2;
} else {
const startX = this._isRtl() ? originRect.right : originRect.left;
const endX = this._isRtl() ? originRect.left : originRect.right;
x = pos.originX == "start" ? startX : endX;
}
if (containerRect.left < 0) {
x -= containerRect.left;
}
let y;
if (pos.originY == "center") {
y = originRect.top + originRect.height / 2;
} else {
y = pos.originY == "top" ? originRect.top : originRect.bottom;
}
if (containerRect.top < 0) {
y -= containerRect.top;
}
return {
x,
y
};
}
/**
* Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
* origin point to which the overlay should be connected.
*/
_getOverlayPoint(originPoint, overlayRect, pos) {
let overlayStartX;
if (pos.overlayX == "center") {
overlayStartX = -overlayRect.width / 2;
} else if (pos.overlayX === "start") {
overlayStartX = this._isRtl() ? -overlayRect.width : 0;
} else {
overlayStartX = this._isRtl() ? 0 : -overlayRect.width;
}
let overlayStartY;
if (pos.overlayY == "center") {
overlayStartY = -overlayRect.height / 2;
} else {
overlayStartY = pos.overlayY == "top" ? 0 : -overlayRect.height;
}
return {
x: originPoint.x + overlayStartX,
y: originPoint.y + overlayStartY
};
}
/** Gets how well an overlay at the given point will fit within the viewport. */
_getOverlayFit(point, rawOverlayRect, viewport, position) {
const overlay = getRoundedBoundingClientRect(rawOverlayRect);
let {
x,
y
} = point;
let offsetX = this._getOffset(position, "x");
let offsetY = this._getOffset(position, "y");
if (offsetX) {
x += offsetX;
}
if (offsetY) {
y += offsetY;
}
let leftOverflow = 0 - x;
let rightOverflow = x + overlay.width - viewport.width;
let topOverflow = 0 - y;
let bottomOverflow = y + overlay.height - viewport.height;
let visibleWidth = this._subtractOverflows(overlay.width, leftOverflow, rightOverflow);
let visibleHeight = this._subtractOverflows(overlay.height, topOverflow, bottomOverflow);
let visibleArea = visibleWidth * visibleHeight;
return {
visibleArea,
isCompletelyWithinViewport: overlay.width * overlay.height === visibleArea,
fitsInViewportVertically: visibleHeight === overlay.height,
fitsInViewportHorizontally: visibleWidth == overlay.width
};
}
/**
* Whether the overlay can fit within the viewport when it may resize either its width or height.
* @param fit How well the overlay fits in the viewport at some position.
* @param point The (x, y) coordinates of the overlay at some position.
* @param viewport The geometry of the viewport.
*/
_canFitWithFlexibleDimensions(fit, point, viewport) {
if (this._hasFlexibleDimensions) {
const availableHeight = viewport.bottom - point.y;
const availableWidth = viewport.right - point.x;
const minHeight = getPixelValue(this._overlayRef.getConfig().minHeight);
const minWidth = getPixelValue(this._overlayRef.getConfig().minWidth);
const verticalFit = fit.fitsInViewportVertically || minHeight != null && minHeight <= availableHeight;
const horizontalFit = fit.fitsInViewportHorizontally || minWidth != null && minWidth <= availableWidth;
return verticalFit && horizontalFit;
}
return false;
}
/**
* Gets the point at which the overlay can be "pushed" on-screen. If the overlay is larger than
* the viewport, the top-left corner will be pushed on-screen (with overflow occurring on the
* right and bottom).
*
* @param start Starting point from which the overlay is pushed.
* @param rawOverlayRect Dimensions of the overlay.
* @param scrollPosition Current viewport scroll position.
* @returns The point at which to position the overlay after pushing. This is effectively a new
* originPoint.
*/
_pushOverlayOnScreen(start, rawOverlayRect, scrollPosition) {
if (this._previousPushAmount && this._positionLocked) {
return {
x: start.x + this._previousPushAmount.x,
y: start.y + this._previousPushAmount.y
};
}
const overlay = getRoundedBoundingClientRect(rawOverlayRect);
const viewport = this._viewportRect;
const overflowRight = Math.max(start.x + overlay.width - viewport.width, 0);
const overflowBottom = Math.max(start.y + overlay.height - viewport.height, 0);
const overflowTop = Math.max(viewport.top - scrollPosition.top - start.y, 0);
const overflowLeft = Math.max(viewport.left - scrollPosition.left - start.x, 0);
let pushX = 0;
let pushY = 0;
if (overlay.width <= viewport.width) {
pushX = overflowLeft || -overflowRight;
} else {
pushX = start.x < this._viewportMargin ? viewport.left - scrollPosition.left - start.x : 0;
}
if (overlay.height <= viewport.height) {
pushY = overflowTop || -overflowBottom;
} else {
pushY = start.y < this._viewportMargin ? viewport.top - scrollPosition.top - start.y : 0;
}
this._previousPushAmount = {
x: pushX,
y: pushY
};
return {
x: start.x + pushX,
y: start.y + pushY
};
}
/**
* Applies a computed position to the overlay and emits a position change.
* @param position The position preference
* @param originPoint The point on the origin element where the overlay is connected.
*/
_applyPosition(position, originPoint) {
this._setTransformOrigin(position);
this._setOverlayElementStyles(originPoint, position);
this._setBoundingBoxStyles(originPoint, position);
if (position.panelClass) {
this._addPanelClasses(position.panelClass);
}
if (this._positionChanges.observers.length) {
const scrollVisibility = this._getScrollVisibility();
if (position !== this._lastPosition || !this._lastScrollVisibility || !compareScrollVisibility(this._lastScrollVisibility, scrollVisibility)) {
const changeEvent = new ConnectedOverlayPositionChange(position, scrollVisibility);
this._positionChanges.next(changeEvent);
}
this._lastScrollVisibility = scrollVisibility;
}
this._lastPosition = position;
this._isInitialRender = false;
}
/** Sets the transform origin based on the configured selector and the passed-in position. */
_setTransformOrigin(position) {
if (!this._transformOriginSelector) {
return;
}
const elements = this._boundingBox.querySelectorAll(this._transformOriginSelector);
let xOrigin;
let yOrigin = position.overlayY;
if (position.overlayX === "center") {
xOrigin = "center";
} else if (this._isRtl()) {
xOrigin = position.overlayX === "start" ? "right" : "left";
} else {
xOrigin = position.overlayX === "start" ? "left" : "right";
}
for (let i = 0; i < elements.length; i++) {
elements[i].style.transformOrigin = `${xOrigin} ${yOrigin}`;
}
}
/**
* Gets the position and size of the overlay's sizing container.
*
* This method does no measuring and applies no styles so that we can cheaply compute the
* bounds for all positions and choose the best fit based on these results.
*/
_calculateBoundingBoxRect(origin, position) {
const viewport = this._viewportRect;
const isRtl = this._isRtl();
let height, top, bottom;
if (position.overlayY === "top") {
top = origin.y;
height = viewport.height - top + this._viewportMargin;
} else if (position.overlayY === "bottom") {
bottom = viewport.height - origin.y + this._viewportMargin * 2;
height = viewport.height - bottom + this._viewportMargin;
} else {
const smallestDistanceToViewportEdge = Math.min(viewport.bottom - origin.y + viewport.top, origin.y);
const previousHeight = this._lastBoundingBoxSize.height;
height = smallestDistanceToViewportEdge * 2;
top = origin.y - smallestDistanceToViewportEdge;
if (height > previousHeight && !this._isInitialRender && !this._growAfterOpen) {
top = origin.y - previousHeight / 2;
}
}
const isBoundedByRightViewportEdge = position.overlayX === "start" && !isRtl || position.overlayX === "end" && isRtl;
const isBoundedByLeftViewportEdge = position.overlayX === "end" && !isRtl || position.overlayX === "start" && isRtl;
let width, left, right;
if (isBoundedByLeftViewportEdge) {
right = viewport.width - origin.x + this._viewportMargin * 2;
width = origin.x - this._viewportMargin;
} else if (isBoundedByRightViewportEdge) {
left = origin.x;
width = viewport.right - origin.x;
} else {
const smallestDistanceToViewportEdge = Math.min(viewport.right - origin.x + viewport.left, origin.x);
const previousWidth = this._lastBoundingBoxSize.width;
width = smallestDistanceToViewportEdge * 2;
left = origin.x - smallestDistanceToViewportEdge;
if (width > previousWidth && !this._isInitialRender && !this._growAfterOpen) {
left = origin.x - previousWidth / 2;
}
}
return {
top,
left,
bottom,
right,
width,
height
};
}
/**
* Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
* origin's connection point and stretches to the bounds of the viewport.
*
* @param origin The point on the origin element where the overlay is connected.
* @param position The position preference
*/
_setBoundingBoxStyles(origin, position) {
const boundingBoxRect = this._calculateBoundingBoxRect(origin, position);
if (!this._isInitialRender && !this._growAfterOpen) {
boundingBoxRect.height = Math.min(boundingBoxRect.height, this._lastBoundingBoxSize.height);
boundingBoxRect.width = Math.min(boundingBoxRect.width, this._lastBoundingBoxSize.width);
}
const styles = {};
if (this._hasExactPosition()) {
styles.top = styles.left = "0";
styles.bottom = styles.right = styles.maxHeight = styles.maxWidth = "";
styles.width = styles.height = "100%";
} else {
const maxHeight = this._overlayRef.getConfig().maxHeight;
const maxWidth = this._overlayRef.getConfig().maxWidth;
styles.height = coerceCssPixelValue(boundingBoxRect.height);
styles.top = coerceCssPixelValue(boundingBoxRect.top);
styles.bottom = coerceCssPixelValue(boundingBoxRect.bottom);
styles.width = coerceCssPixelValue(boundingBoxRect.width);
styles.left = coerceCssPixelValue(boundingBoxRect.left);
styles.right = coerceCssPixelValue(boundingBoxRect.right);
if (position.overlayX === "center") {
styles.alignItems = "center";
} else {
styles.alignItems = position.overlayX === "end" ? "flex-end" : "flex-start";
}
if (position.overlayY === "center") {
styles.justifyContent = "center";
} else {
styles.justifyContent = position.overlayY === "bottom" ? "flex-end" : "flex-start";
}
if (maxHeight) {
styles.maxHeight = coerceCssPixelValue(maxHeight);
}
if (maxWidth) {
styles.maxWidth = coerceCssPixelValue(maxWidth);
}
}
this._lastBoundingBoxSize = boundingBoxRect;
extendStyles(this._boundingBox.style, styles);
}
/** Resets the styles for the bounding box so that a new positioning can be computed. */
_resetBoundingBoxStyles() {
extendStyles(this._boundingBox.style, {
top: "0",
left: "0",
right: "0",
bottom: "0",
height: "",
width: "",
alignItems: "",
justifyContent: ""
});
}
/** Resets the styles for the overlay pane so that a new positioning can be computed. */
_resetOverlayElementStyles() {
extendStyles(this._pane.style, {
top: "",
left: "",
bottom: "",
right: "",
position: "",
transform: ""
});
}
/** Sets positioning styles to the overlay element. */
_setOverlayElementStyles(originPoint, position) {
const styles = {};
const hasExactPosition = this._hasExactPosition();
const hasFlexibleDimensions = this._hasFlexibleDimensions;
const config2 = this._overlayRef.getConfig();
if (hasExactPosition) {
const scrollPosition = this._viewportRuler.getViewportScrollPosition();
extendStyles(styles, this._getExactOverlayY(position, originPoint, scrollPosition));
extendStyles(styles, this._getExactOverlayX(position, originPoint, scrollPosition));
} else {
styles.position = "static";
}
let transformString = "";
let offsetX = this._getOffset(position, "x");
let offsetY = this._getOffset(position, "y");
if (offsetX) {
transformString += `translateX(${offsetX}px) `;
}
if (offsetY) {
transformString += `translateY(${offsetY}px)`;
}
styles.transform = transformString.trim();
if (config2.maxHeight) {
if (hasExactPosition) {
styles.maxHeight = coerceCssPixelValue(config2.maxHeight);
} else if (hasFlexibleDimensions) {
styles.maxHeight = "";
}
}
if (config2.maxWidth) {
if (hasExactPosition) {
styles.maxWidth = coerceCssPixelValue(config2.maxWidth);
} else if (hasFlexibleDimensions) {
styles.maxWidth = "";
}
}
extendStyles(this._pane.style, styles);
}
/** Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing. */
_getExactOverlayY(position, originPoint, scrollPosition) {
let styles = {
top: "",
bottom: ""
};
let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
if (this._isPushed) {
overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
}
if (position.overlayY === "bottom") {
const documentHeight = this._document.documentElement.clientHeight;
styles.bottom = `${documentHeight - (overlayPoint.y + this._overlayRect.height)}px`;
} else {
styles.top = coerceCssPixelValue(overlayPoint.y);
}
return styles;
}
/** Gets the exact left/right for the overlay when not using flexible sizing or when pushing. */
_getExactOverlayX(position, originPoint, scrollPosition) {
let styles = {
left: "",
right: ""
};
let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
if (this._isPushed) {
overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
}
let horizontalStyleProperty;
if (this._isRtl()) {
horizontalStyleProperty = position.overlayX === "end" ? "left" : "right";
} else {
horizontalStyleProperty = position.overlayX === "end" ? "right" : "left";
}
if (horizontalStyleProperty === "right") {
const documentWidth = this._document.documentElement.clientWidth;
styles.right = `${documentWidth - (overlayPoint.x + this._overlayRect.width)}px`;
} else {
styles.left = coerceCssPixelValue(overlayPoint.x);
}
return styles;
}
/**
* Gets the view properties of the trigger and overlay, including whether they are clipped
* or completely outside the view of any of the strategy's scrollables.
*/
_getScrollVisibility() {
const originBounds = this._getOriginRect();
const overlayBounds = this._pane.getBoundingClientRect();
const scrollContainerBounds = this._scrollables.map((scrollable) => {
return scrollable.getElementRef().nativeElement.getBoundingClientRect();
});
return {
isOriginClipped: isElementClippedByScrolling(originBounds, scrollContainerBounds),
isOriginOutsideView: isElementScrolledOutsideView(originBounds, scrollContainerBounds),
isOverlayClipped: isElementClippedByScrolling(overlayBounds, scrollContainerBounds),
isOverlayOutsideView: isElementScrolledOutsideView(overlayBounds, scrollContainerBounds)
};
}
/** Subtracts the amount that an element is overflowing on an axis from its length. */
_subtractOverflows(length, ...overflows) {
return overflows.reduce((currentValue, currentOverflow) => {
return currentValue - Math.max(currentOverflow, 0);
}, length);
}
/** Narrows the given viewport rect by the current _viewportMargin. */
_getNarrowedViewportRect() {
const width = this._document.documentElement.clientWidth;
const height = this._document.documentElement.clientHeight;
const scrollPosition = this._viewportRuler.getViewportScrollPosition();
return {
top: scrollPosition.top + this._viewportMargin,
left: scrollPosition.left + this._viewportMargin,
right: scrollPosition.left + width - this._viewportMargin,
bottom: scrollPosition.top + height - this._viewportMargin,
width: width - 2 * this._viewportMargin,
height: height - 2 * this._viewportMargin
};
}
/** Whether the we're dealing with an RTL context */
_isRtl() {
return this._overlayRef.getDirection() === "rtl";
}
/** Determines whether the overlay uses exact or flexible positioning. */
_hasExactPosition() {
return !this._hasFlexibleDimensions || this._isPushed;
}
/** Retrieves the offset of a position along the x or y axis. */
_getOffset(position, axis) {
if (axis === "x") {
return position.offsetX == null ? this._offsetX : position.offsetX;
}
return position.offsetY == null ? this._offsetY : position.offsetY;
}
/** Validates that the current position match the expected values. */
_validatePositions() {
if (typeof ngDevMode === "undefined" || ngDevMode) {
if (!this._preferredPositions.length) {
throw Error("FlexibleConnectedPositionStrategy: At least one position is required.");
}
this._preferredPositions.forEach((pair) => {
validateHorizontalPosition("originX", pair.originX);
validateVerticalPosition("originY", pair.originY);
validateHorizontalPosition("overlayX", pair.overlayX);
validateVerticalPosition("overlayY", pair.overlayY);
});
}
}
/** Adds a single CSS class or an array of classes on the overlay panel. */
_addPanelClasses(cssClasses) {
if (this._pane) {
coerceArray(cssClasses).forEach((cssClass) => {
if (cssClass !== "" && this._appliedPanelClasses.indexOf(cssClass) === -1) {
this._appliedPanelClasses.push(cssClass);
this._pane.classList.add(cssClass);
}
});
}
}
/** Clears the classes that the position strategy has applied from the overlay panel. */
_clearPanelClasses() {
if (this._pane) {
this._appliedPanelClasses.forEach((cssClass) => {
this._pane.classList.remove(cssClass);
});
this._appliedPanelClasses = [];
}
}
/** Returns the DOMRect of the current origin. */
_getOriginRect() {
const origin = this._origin;
if (origin instanceof ElementRef) {
return origin.nativeElement.getBoundingClientRect();
}
if (origin instanceof Element) {
return origin.getBoundingClientRect();
}
const width = origin.width || 0;
const height = origin.height || 0;
return {
top: origin.y,
bottom: origin.y + height,
left: origin.x,
right: origin.x + width,
height,
width
};
}
};
function extendStyles(destination, source) {
for (let key in source) {
if (source.hasOwnProperty(key)) {
destination[key] = source[key];
}
}
return destination;
}
function getPixelValue(input2) {
if (typeof input2 !== "number" && input2 != null) {
const [value, units] = input2.split(cssUnitPattern);
return !units || units === "px" ? parseFloat(value) : null;
}
return input2 || null;
}
function getRoundedBoundingClientRect(clientRect) {
return {
top: Math.floor(clientRect.top),
right: Math.floor(clientRect.right),
bottom: Math.floor(clientRect.bottom),
left: Math.floor(clientRect.left),
width: Math.floor(clientRect.width),
height: Math.floor(clientRect.height)
};
}
function compareScrollVisibility(a, b) {
if (a === b) {
return true;
}
return a.isOriginClipped === b.isOriginClipped && a.isOriginOutsideView === b.isOriginOutsideView && a.isOverlayClipped === b.isOverlayClipped && a.isOverlayOutsideView === b.isOverlayOutsideView;
}
var wrapperClass = "cdk-global-overlay-wrapper";
function createGlobalPositionStrategy(_injector) {
return new GlobalPositionStrategy();
}
var GlobalPositionStrategy = class {
/** The overlay to which this strategy is attached. */
_overlayRef;
_cssPosition = "static";
_topOffset = "";
_bottomOffset = "";
_alignItems = "";
_xPosition = "";
_xOffset = "";
_width = "";
_height = "";
_isDisposed = false;
attach(overlayRef) {
const config2 = overlayRef.getConfig();
this._overlayRef = overlayRef;
if (this._width && !config2.width) {
overlayRef.updateSize({
width: this._width
});
}
if (this._height && !config2.height) {
overlayRef.updateSize({
height: this._height
});
}
overlayRef.hostElement.classList.add(wrapperClass);
this._isDisposed = false;
}
/**
* Sets the top position of the overlay. Clears any previously set vertical position.
* @param value New top offset.
*/
top(value = "") {
this._bottomOffset = "";
this._topOffset = value;
this._alignItems = "flex-start";
return this;
}
/**
* Sets the left position of the overlay. Clears any previously set horizontal position.
* @param value New left offset.
*/
left(value = "") {
this._xOffset = value;
this._xPosition = "left";
return this;
}
/**
* Sets the bottom position of the overlay. Clears any previously set vertical position.
* @param value New bottom offset.
*/
bottom(value = "") {
this._topOffset = "";
this._bottomOffset = value;
this._alignItems = "flex-end";
return this;
}
/**
* Sets the right position of the overlay. Clears any previously set horizontal position.
* @param value New right offset.
*/
right(value = "") {
this._xOffset = value;
this._xPosition = "right";
return this;
}
/**
* Sets the overlay to the start of the viewport, depending on the overlay direction.
* This will be to the left in LTR layouts and to the right in RTL.
* @param offset Offset from the edge of the screen.
*/
start(value = "") {
this._xOffset = value;
this._xPosition = "start";
return this;
}
/**
* Sets the overlay to the end of the viewport, depending on the overlay direction.
* This will be to the right in LTR layouts and to the left in RTL.
* @param offset Offset from the edge of the screen.
*/
end(value = "") {
this._xOffset = value;
this._xPosition = "end";
return this;
}
/**
* Sets the overlay width and clears any previously set width.
* @param value New width for the overlay
* @deprecated Pass the `width` through the `OverlayConfig`.
* @breaking-change 8.0.0
*/
width(value = "") {
if (this._overlayRef) {
this._overlayRef.updateSize({
width: value
});
} else {
this._width = value;
}
return this;
}
/**
* Sets the overlay height and clears any previously set height.
* @param value New height for the overlay
* @deprecated Pass the `height` through the `OverlayConfig`.
* @breaking-change 8.0.0
*/
height(value = "") {
if (this._overlayRef) {
this._overlayRef.updateSize({
height: value
});
} else {
this._height = value;
}
return this;
}
/**
* Centers the overlay horizontally with an optional offset.
* Clears any previously set horizontal position.
*
* @param offset Overlay offset from the horizontal center.
*/
centerHorizontally(offset = "") {
this.left(offset);
this._xPosition = "center";
return this;
}
/**
* Centers the overlay vertically with an optional offset.
* Clears any previously set vertical position.
*
* @param offset Overlay offset from the vertical center.
*/
centerVertically(offset = "") {
this.top(offset);
this._alignItems = "center";
return this;
}
/**
* Apply the position to the element.
* @docs-private
*/
apply() {
if (!this._overlayRef || !this._overlayRef.hasAttached()) {
return;
}
const styles = this._overlayRef.overlayElement.style;
const parentStyles = this._overlayRef.hostElement.style;
const config2 = this._overlayRef.getConfig();
const {
width,
height,
maxWidth,
maxHeight
} = config2;
const shouldBeFlushHorizontally = (width === "100%" || width === "100vw") && (!maxWidth || maxWidth === "100%" || maxWidth === "100vw");
const shouldBeFlushVertically = (height === "100%" || height === "100vh") && (!maxHeight || maxHeight === "100%" || maxHeight === "100vh");
const xPosition = this._xPosition;
const xOffset = this._xOffset;
const isRtl = this._overlayRef.getConfig().direction === "rtl";
let marginLeft = "";
let marginRight = "";
let justifyContent = "";
if (shouldBeFlushHorizontally) {
justifyContent = "flex-start";
} else if (xPosition === "center") {
justifyContent = "center";
if (isRtl) {
marginRight = xOffset;
} else {
marginLeft = xOffset;
}
} else if (isRtl) {
if (xPosition === "left" || xPosition === "end") {
justifyContent = "flex-end";
marginLeft = xOffset;
} else if (xPosition === "right" || xPosition === "start") {
justifyContent = "flex-start";
marginRight = xOffset;
}
} else if (xPosition === "left" || xPosition === "start") {
justifyContent = "flex-start";
marginLeft = xOffset;
} else if (xPosition === "right" || xPosition === "end") {
justifyContent = "flex-end";
marginRight = xOffset;
}
styles.position = this._cssPosition;
styles.marginLeft = shouldBeFlushHorizontally ? "0" : marginLeft;
styles.marginTop = shouldBeFlushVertically ? "0" : this._topOffset;
styles.marginBottom = this._bottomOffset;
styles.marginRight = shouldBeFlushHorizontally ? "0" : marginRight;
parentStyles.justifyContent = justifyContent;
parentStyles.alignItems = shouldBeFlushVertically ? "flex-start" : this._alignItems;
}
/**
* Cleans up the DOM changes from the position strategy.
* @docs-private
*/
dispose() {
if (this._isDisposed || !this._overlayRef) {
return;
}
const styles = this._overlayRef.overlayElement.style;
const parent = this._overlayRef.hostElement;
const parentStyles = parent.style;
parent.classList.remove(wrapperClass);
parentStyles.justifyContent = parentStyles.alignItems = styles.marginTop = styles.marginBottom = styles.marginLeft = styles.marginRight = styles.position = "";
this._overlayRef = null;
this._isDisposed = true;
}
};
var OverlayPositionBuilder = class _OverlayPositionBuilder {
_injector = inject2(Injector);
constructor() {
}
/**
* Creates a global position strategy.
*/
global() {
return createGlobalPositionStrategy();
}
/**
* Creates a flexible position strategy.
* @param origin Origin relative to which to position the overlay.
*/
flexibleConnectedTo(origin) {
return createFlexibleConnectedPositionStrategy(this._injector, origin);
}
static \u0275fac = function OverlayPositionBuilder_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _OverlayPositionBuilder)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _OverlayPositionBuilder,
factory: _OverlayPositionBuilder.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(OverlayPositionBuilder, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
function createOverlayRef(injector, config2) {
injector.get(_CdkPrivateStyleLoader).load(_CdkOverlayStyleLoader);
const overlayContainer = injector.get(OverlayContainer);
const doc = injector.get(DOCUMENT);
const idGenerator = injector.get(_IdGenerator);
const appRef = injector.get(ApplicationRef);
const directionality = injector.get(Directionality);
const host = doc.createElement("div");
const pane = doc.createElement("div");
pane.id = idGenerator.getId("cdk-overlay-");
pane.classList.add("cdk-overlay-pane");
host.appendChild(pane);
overlayContainer.getContainerElement().appendChild(host);
const portalOutlet = new DomPortalOutlet(pane, appRef, injector);
const overlayConfig = new OverlayConfig(config2);
const renderer = injector.get(Renderer2, null, {
optional: true
}) || injector.get(RendererFactory2).createRenderer(null, null);
overlayConfig.direction = overlayConfig.direction || directionality.value;
return new OverlayRef(portalOutlet, host, pane, overlayConfig, injector.get(NgZone), injector.get(OverlayKeyboardDispatcher), doc, injector.get(Location), injector.get(OverlayOutsideClickDispatcher), config2?.disableAnimations ?? injector.get(ANIMATION_MODULE_TYPE, null, {
optional: true
}) === "NoopAnimations", injector.get(EnvironmentInjector), renderer);
}
var Overlay = class _Overlay {
scrollStrategies = inject2(ScrollStrategyOptions);
_positionBuilder = inject2(OverlayPositionBuilder);
_injector = inject2(Injector);
constructor() {
}
/**
* Creates an overlay.
* @param config Configuration applied to the overlay.
* @returns Reference to the created overlay.
*/
create(config2) {
return createOverlayRef(this._injector, config2);
}
/**
* Gets a position builder that can be used, via fluent API,
* to construct and configure a position strategy.
* @returns An overlay position builder.
*/
position() {
return this._positionBuilder;
}
static \u0275fac = function Overlay_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _Overlay)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _Overlay,
factory: _Overlay.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Overlay, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var defaultPositionList = [{
originX: "start",
originY: "bottom",
overlayX: "start",
overlayY: "top"
}, {
originX: "start",
originY: "top",
overlayX: "start",
overlayY: "bottom"
}, {
originX: "end",
originY: "top",
overlayX: "end",
overlayY: "bottom"
}, {
originX: "end",
originY: "bottom",
overlayX: "end",
overlayY: "top"
}];
var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new InjectionToken("cdk-connected-overlay-scroll-strategy", {
providedIn: "root",
factory: () => {
const injector = inject2(Injector);
return () => createRepositionScrollStrategy(injector);
}
});
var CdkOverlayOrigin = class _CdkOverlayOrigin {
elementRef = inject2(ElementRef);
constructor() {
}
static \u0275fac = function CdkOverlayOrigin_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkOverlayOrigin)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkOverlayOrigin,
selectors: [["", "cdk-overlay-origin", ""], ["", "overlay-origin", ""], ["", "cdkOverlayOrigin", ""]],
exportAs: ["cdkOverlayOrigin"]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkOverlayOrigin, [{
type: Directive,
args: [{
selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]",
exportAs: "cdkOverlayOrigin"
}]
}], () => [], null);
})();
var CdkConnectedOverlay = class _CdkConnectedOverlay {
_dir = inject2(Directionality, {
optional: true
});
_injector = inject2(Injector);
_overlayRef;
_templatePortal;
_backdropSubscription = Subscription.EMPTY;
_attachSubscription = Subscription.EMPTY;
_detachSubscription = Subscription.EMPTY;
_positionSubscription = Subscription.EMPTY;
_offsetX;
_offsetY;
_position;
_scrollStrategyFactory = inject2(CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY);
_disposeOnNavigation = false;
_ngZone = inject2(NgZone);
/** Origin for the connected overlay. */
origin;
/** Registered connected position pairs. */
positions;
/**
* This input overrides the positions input if specified. It lets users pass
* in arbitrary positioning strategies.
*/
positionStrategy;
/** The offset in pixels for the overlay connection point on the x-axis */
get offsetX() {
return this._offsetX;
}
set offsetX(offsetX) {
this._offsetX = offsetX;
if (this._position) {
this._updatePositionStrategy(this._position);
}
}
/** The offset in pixels for the overlay connection point on the y-axis */
get offsetY() {
return this._offsetY;
}
set offsetY(offsetY) {
this._offsetY = offsetY;
if (this._position) {
this._updatePositionStrategy(this._position);
}
}
/** The width of the overlay panel. */
width;
/** The height of the overlay panel. */
height;
/** The min width of the overlay panel. */
minWidth;
/** The min height of the overlay panel. */
minHeight;
/** The custom class to be set on the backdrop element. */
backdropClass;
/** The custom class to add to the overlay pane element. */
panelClass;
/** Margin between the overlay and the viewport edges. */
viewportMargin = 0;
/** Strategy to be used when handling scroll events while the overlay is open. */
scrollStrategy;
/** Whether the overlay is open. */
open = false;
/** Whether the overlay can be closed by user interaction. */
disableClose = false;
/** CSS selector which to set the transform origin. */
transformOriginSelector;
/** Whether or not the overlay should attach a backdrop. */
hasBackdrop = false;
/** Whether or not the overlay should be locked when scrolling. */
lockPosition = false;
/** Whether the overlay's width and height can be constrained to fit within the viewport. */
flexibleDimensions = false;
/** Whether the overlay can grow after the initial open when flexible positioning is turned on. */
growAfterOpen = false;
/** Whether the overlay can be pushed on-screen if none of the provided positions fit. */
push = false;
/** Whether the overlay should be disposed of when the user goes backwards/forwards in history. */
get disposeOnNavigation() {
return this._disposeOnNavigation;
}
set disposeOnNavigation(value) {
this._disposeOnNavigation = value;
}
/** Event emitted when the backdrop is clicked. */
backdropClick = new EventEmitter();
/** Event emitted when the position has changed. */
positionChange = new EventEmitter();
/** Event emitted when the overlay has been attached. */
attach = new EventEmitter();
/** Event emitted when the overlay has been detached. */
detach = new EventEmitter();
/** Emits when there are keyboard events that are targeted at the overlay. */
overlayKeydown = new EventEmitter();
/** Emits when there are mouse outside click events that are targeted at the overlay. */
overlayOutsideClick = new EventEmitter();
// TODO(jelbourn): inputs for size, scroll behavior, animation, etc.
constructor() {
const templateRef = inject2(TemplateRef);
const viewContainerRef = inject2(ViewContainerRef);
this._templatePortal = new TemplatePortal(templateRef, viewContainerRef);
this.scrollStrategy = this._scrollStrategyFactory();
}
/** The associated overlay reference. */
get overlayRef() {
return this._overlayRef;
}
/** The element's layout direction. */
get dir() {
return this._dir ? this._dir.value : "ltr";
}
ngOnDestroy() {
this._attachSubscription.unsubscribe();
this._detachSubscription.unsubscribe();
this._backdropSubscription.unsubscribe();
this._positionSubscription.unsubscribe();
this._overlayRef?.dispose();
}
ngOnChanges(changes) {
if (this._position) {
this._updatePositionStrategy(this._position);
this._overlayRef?.updateSize({
width: this.width,
minWidth: this.minWidth,
height: this.height,
minHeight: this.minHeight
});
if (changes["origin"] && this.open) {
this._position.apply();
}
}
if (changes["open"]) {
this.open ? this.attachOverlay() : this.detachOverlay();
}
}
/** Creates an overlay */
_createOverlay() {
if (!this.positions || !this.positions.length) {
this.positions = defaultPositionList;
}
const overlayRef = this._overlayRef = createOverlayRef(this._injector, this._buildConfig());
this._attachSubscription = overlayRef.attachments().subscribe(() => this.attach.emit());
this._detachSubscription = overlayRef.detachments().subscribe(() => this.detach.emit());
overlayRef.keydownEvents().subscribe((event) => {
this.overlayKeydown.next(event);
if (event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event)) {
event.preventDefault();
this.detachOverlay();
}
});
this._overlayRef.outsidePointerEvents().subscribe((event) => {
const origin = this._getOriginElement();
const target = _getEventTarget(event);
if (!origin || origin !== target && !origin.contains(target)) {
this.overlayOutsideClick.next(event);
}
});
}
/** Builds the overlay config based on the directive's inputs */
_buildConfig() {
const positionStrategy = this._position = this.positionStrategy || this._createPositionStrategy();
const overlayConfig = new OverlayConfig({
direction: this._dir || "ltr",
positionStrategy,
scrollStrategy: this.scrollStrategy,
hasBackdrop: this.hasBackdrop,
disposeOnNavigation: this.disposeOnNavigation
});
if (this.width || this.width === 0) {
overlayConfig.width = this.width;
}
if (this.height || this.height === 0) {
overlayConfig.height = this.height;
}
if (this.minWidth || this.minWidth === 0) {
overlayConfig.minWidth = this.minWidth;
}
if (this.minHeight || this.minHeight === 0) {
overlayConfig.minHeight = this.minHeight;
}
if (this.backdropClass) {
overlayConfig.backdropClass = this.backdropClass;
}
if (this.panelClass) {
overlayConfig.panelClass = this.panelClass;
}
return overlayConfig;
}
/** Updates the state of a position strategy, based on the values of the directive inputs. */
_updatePositionStrategy(positionStrategy) {
const positions = this.positions.map((currentPosition) => ({
originX: currentPosition.originX,
originY: currentPosition.originY,
overlayX: currentPosition.overlayX,
overlayY: currentPosition.overlayY,
offsetX: currentPosition.offsetX || this.offsetX,
offsetY: currentPosition.offsetY || this.offsetY,
panelClass: currentPosition.panelClass || void 0
}));
return positionStrategy.setOrigin(this._getOrigin()).withPositions(positions).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector);
}
/** Returns the position strategy of the overlay to be set on the overlay config */
_createPositionStrategy() {
const strategy = createFlexibleConnectedPositionStrategy(this._injector, this._getOrigin());
this._updatePositionStrategy(strategy);
return strategy;
}
_getOrigin() {
if (this.origin instanceof CdkOverlayOrigin) {
return this.origin.elementRef;
} else {
return this.origin;
}
}
_getOriginElement() {
if (this.origin instanceof CdkOverlayOrigin) {
return this.origin.elementRef.nativeElement;
}
if (this.origin instanceof ElementRef) {
return this.origin.nativeElement;
}
if (typeof Element !== "undefined" && this.origin instanceof Element) {
return this.origin;
}
return null;
}
/** Attaches the overlay. */
attachOverlay() {
if (!this._overlayRef) {
this._createOverlay();
} else {
this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop;
}
if (!this._overlayRef.hasAttached()) {
this._overlayRef.attach(this._templatePortal);
}
if (this.hasBackdrop) {
this._backdropSubscription = this._overlayRef.backdropClick().subscribe((event) => {
this.backdropClick.emit(event);
});
} else {
this._backdropSubscription.unsubscribe();
}
this._positionSubscription.unsubscribe();
if (this.positionChange.observers.length > 0) {
this._positionSubscription = this._position.positionChanges.pipe(takeWhile(() => this.positionChange.observers.length > 0)).subscribe((position) => {
this._ngZone.run(() => this.positionChange.emit(position));
if (this.positionChange.observers.length === 0) {
this._positionSubscription.unsubscribe();
}
});
}
this.open = true;
}
/** Detaches the overlay. */
detachOverlay() {
this._overlayRef?.detach();
this._backdropSubscription.unsubscribe();
this._positionSubscription.unsubscribe();
this.open = false;
}
static \u0275fac = function CdkConnectedOverlay_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _CdkConnectedOverlay)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _CdkConnectedOverlay,
selectors: [["", "cdk-connected-overlay", ""], ["", "connected-overlay", ""], ["", "cdkConnectedOverlay", ""]],
inputs: {
origin: [0, "cdkConnectedOverlayOrigin", "origin"],
positions: [0, "cdkConnectedOverlayPositions", "positions"],
positionStrategy: [0, "cdkConnectedOverlayPositionStrategy", "positionStrategy"],
offsetX: [0, "cdkConnectedOverlayOffsetX", "offsetX"],
offsetY: [0, "cdkConnectedOverlayOffsetY", "offsetY"],
width: [0, "cdkConnectedOverlayWidth", "width"],
height: [0, "cdkConnectedOverlayHeight", "height"],
minWidth: [0, "cdkConnectedOverlayMinWidth", "minWidth"],
minHeight: [0, "cdkConnectedOverlayMinHeight", "minHeight"],
backdropClass: [0, "cdkConnectedOverlayBackdropClass", "backdropClass"],
panelClass: [0, "cdkConnectedOverlayPanelClass", "panelClass"],
viewportMargin: [0, "cdkConnectedOverlayViewportMargin", "viewportMargin"],
scrollStrategy: [0, "cdkConnectedOverlayScrollStrategy", "scrollStrategy"],
open: [0, "cdkConnectedOverlayOpen", "open"],
disableClose: [0, "cdkConnectedOverlayDisableClose", "disableClose"],
transformOriginSelector: [0, "cdkConnectedOverlayTransformOriginOn", "transformOriginSelector"],
hasBackdrop: [2, "cdkConnectedOverlayHasBackdrop", "hasBackdrop", booleanAttribute],
lockPosition: [2, "cdkConnectedOverlayLockPosition", "lockPosition", booleanAttribute],
flexibleDimensions: [2, "cdkConnectedOverlayFlexibleDimensions", "flexibleDimensions", booleanAttribute],
growAfterOpen: [2, "cdkConnectedOverlayGrowAfterOpen", "growAfterOpen", booleanAttribute],
push: [2, "cdkConnectedOverlayPush", "push", booleanAttribute],
disposeOnNavigation: [2, "cdkConnectedOverlayDisposeOnNavigation", "disposeOnNavigation", booleanAttribute]
},
outputs: {
backdropClick: "backdropClick",
positionChange: "positionChange",
attach: "attach",
detach: "detach",
overlayKeydown: "overlayKeydown",
overlayOutsideClick: "overlayOutsideClick"
},
exportAs: ["cdkConnectedOverlay"],
features: [\u0275\u0275NgOnChangesFeature]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkConnectedOverlay, [{
type: Directive,
args: [{
selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]",
exportAs: "cdkConnectedOverlay"
}]
}], () => [], {
origin: [{
type: Input,
args: ["cdkConnectedOverlayOrigin"]
}],
positions: [{
type: Input,
args: ["cdkConnectedOverlayPositions"]
}],
positionStrategy: [{
type: Input,
args: ["cdkConnectedOverlayPositionStrategy"]
}],
offsetX: [{
type: Input,
args: ["cdkConnectedOverlayOffsetX"]
}],
offsetY: [{
type: Input,
args: ["cdkConnectedOverlayOffsetY"]
}],
width: [{
type: Input,
args: ["cdkConnectedOverlayWidth"]
}],
height: [{
type: Input,
args: ["cdkConnectedOverlayHeight"]
}],
minWidth: [{
type: Input,
args: ["cdkConnectedOverlayMinWidth"]
}],
minHeight: [{
type: Input,
args: ["cdkConnectedOverlayMinHeight"]
}],
backdropClass: [{
type: Input,
args: ["cdkConnectedOverlayBackdropClass"]
}],
panelClass: [{
type: Input,
args: ["cdkConnectedOverlayPanelClass"]
}],
viewportMargin: [{
type: Input,
args: ["cdkConnectedOverlayViewportMargin"]
}],
scrollStrategy: [{
type: Input,
args: ["cdkConnectedOverlayScrollStrategy"]
}],
open: [{
type: Input,
args: ["cdkConnectedOverlayOpen"]
}],
disableClose: [{
type: Input,
args: ["cdkConnectedOverlayDisableClose"]
}],
transformOriginSelector: [{
type: Input,
args: ["cdkConnectedOverlayTransformOriginOn"]
}],
hasBackdrop: [{
type: Input,
args: [{
alias: "cdkConnectedOverlayHasBackdrop",
transform: booleanAttribute
}]
}],
lockPosition: [{
type: Input,
args: [{
alias: "cdkConnectedOverlayLockPosition",
transform: booleanAttribute
}]
}],
flexibleDimensions: [{
type: Input,
args: [{
alias: "cdkConnectedOverlayFlexibleDimensions",
transform: booleanAttribute
}]
}],
growAfterOpen: [{
type: Input,
args: [{
alias: "cdkConnectedOverlayGrowAfterOpen",
transform: booleanAttribute
}]
}],
push: [{
type: Input,
args: [{
alias: "cdkConnectedOverlayPush",
transform: booleanAttribute
}]
}],
disposeOnNavigation: [{
type: Input,
args: [{
alias: "cdkConnectedOverlayDisposeOnNavigation",
transform: booleanAttribute
}]
}],
backdropClick: [{
type: Output
}],
positionChange: [{
type: Output
}],
attach: [{
type: Output
}],
detach: [{
type: Output
}],
overlayKeydown: [{
type: Output
}],
overlayOutsideClick: [{
type: Output
}]
});
})();
function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
const injector = inject2(Injector);
return () => createRepositionScrollStrategy(injector);
}
var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,
useFactory: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY
};
var OverlayModule = class _OverlayModule {
static \u0275fac = function OverlayModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _OverlayModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _OverlayModule,
imports: [BidiModule, PortalModule, ScrollingModule, CdkConnectedOverlay, CdkOverlayOrigin],
exports: [CdkConnectedOverlay, CdkOverlayOrigin, ScrollingModule]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
providers: [Overlay, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER],
imports: [BidiModule, PortalModule, ScrollingModule, ScrollingModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(OverlayModule, [{
type: NgModule,
args: [{
imports: [BidiModule, PortalModule, ScrollingModule, CdkConnectedOverlay, CdkOverlayOrigin],
exports: [CdkConnectedOverlay, CdkOverlayOrigin, ScrollingModule],
providers: [Overlay, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/overlay.mjs
var FullscreenOverlayContainer = class _FullscreenOverlayContainer extends OverlayContainer {
_renderer = inject2(RendererFactory2).createRenderer(null, null);
_fullScreenEventName;
_cleanupFullScreenListener;
constructor() {
super();
}
ngOnDestroy() {
super.ngOnDestroy();
this._cleanupFullScreenListener?.();
}
_createContainer() {
const eventName = this._getEventName();
super._createContainer();
this._adjustParentForFullscreenChange();
if (eventName) {
this._cleanupFullScreenListener?.();
this._cleanupFullScreenListener = this._renderer.listen("document", eventName, () => {
this._adjustParentForFullscreenChange();
});
}
}
_adjustParentForFullscreenChange() {
if (this._containerElement) {
const fullscreenElement = this.getFullscreenElement();
const parent = fullscreenElement || this._document.body;
parent.appendChild(this._containerElement);
}
}
_getEventName() {
if (!this._fullScreenEventName) {
const _document2 = this._document;
if (_document2.fullscreenEnabled) {
this._fullScreenEventName = "fullscreenchange";
} else if (_document2.webkitFullscreenEnabled) {
this._fullScreenEventName = "webkitfullscreenchange";
} else if (_document2.mozFullScreenEnabled) {
this._fullScreenEventName = "mozfullscreenchange";
} else if (_document2.msFullscreenEnabled) {
this._fullScreenEventName = "MSFullscreenChange";
}
}
return this._fullScreenEventName;
}
/**
* When the page is put into fullscreen mode, a specific element is specified.
* Only that element and its children are visible when in fullscreen mode.
*/
getFullscreenElement() {
const _document2 = this._document;
return _document2.fullscreenElement || _document2.webkitFullscreenElement || _document2.mozFullScreenElement || _document2.msFullscreenElement || null;
}
static \u0275fac = function FullscreenOverlayContainer_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _FullscreenOverlayContainer)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _FullscreenOverlayContainer,
factory: _FullscreenOverlayContainer.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FullscreenOverlayContainer, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
// node_modules/.pnpm/@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@20.2.1_rxjs_qx22inmt366ywyurkjqhycevyu/node_modules/@angular/cdk/fesm2022/selection-model.mjs
var SelectionModel = class {
_multiple;
_emitChanges;
compareWith;
/** Currently-selected values. */
_selection = /* @__PURE__ */ new Set();
/** Keeps track of the deselected options that haven't been emitted by the change event. */
_deselectedToEmit = [];
/** Keeps track of the selected options that haven't been emitted by the change event. */
_selectedToEmit = [];
/** Cache for the array value of the selected items. */
_selected;
/** Selected values. */
get selected() {
if (!this._selected) {
this._selected = Array.from(this._selection.values());
}
return this._selected;
}
/** Event emitted when the value has changed. */
changed = new Subject();
constructor(_multiple = false, initiallySelectedValues, _emitChanges = true, compareWith) {
this._multiple = _multiple;
this._emitChanges = _emitChanges;
this.compareWith = compareWith;
if (initiallySelectedValues && initiallySelectedValues.length) {
if (_multiple) {
initiallySelectedValues.forEach((value) => this._markSelected(value));
} else {
this._markSelected(initiallySelectedValues[0]);
}
this._selectedToEmit.length = 0;
}
}
/**
* Selects a value or an array of values.
* @param values The values to select
* @return Whether the selection changed as a result of this call
*/
select(...values) {
this._verifyValueAssignment(values);
values.forEach((value) => this._markSelected(value));
const changed = this._hasQueuedChanges();
this._emitChangeEvent();
return changed;
}
/**
* Deselects a value or an array of values.
* @param values The values to deselect
* @return Whether the selection changed as a result of this call
*/
deselect(...values) {
this._verifyValueAssignment(values);
values.forEach((value) => this._unmarkSelected(value));
const changed = this._hasQueuedChanges();
this._emitChangeEvent();
return changed;
}
/**
* Sets the selected values
* @param values The new selected values
* @return Whether the selection changed as a result of this call
*/
setSelection(...values) {
this._verifyValueAssignment(values);
const oldValues = this.selected;
const newSelectedSet = new Set(values.map((value) => this._getConcreteValue(value)));
values.forEach((value) => this._markSelected(value));
oldValues.filter((value) => !newSelectedSet.has(this._getConcreteValue(value, newSelectedSet))).forEach((value) => this._unmarkSelected(value));
const changed = this._hasQueuedChanges();
this._emitChangeEvent();
return changed;
}
/**
* Toggles a value between selected and deselected.
* @param value The value to toggle
* @return Whether the selection changed as a result of this call
*/
toggle(value) {
return this.isSelected(value) ? this.deselect(value) : this.select(value);
}
/**
* Clears all of the selected values.
* @param flushEvent Whether to flush the changes in an event.
* If false, the changes to the selection will be flushed along with the next event.
* @return Whether the selection changed as a result of this call
*/
clear(flushEvent = true) {
this._unmarkAll();
const changed = this._hasQueuedChanges();
if (flushEvent) {
this._emitChangeEvent();
}
return changed;
}
/**
* Determines whether a value is selected.
*/
isSelected(value) {
return this._selection.has(this._getConcreteValue(value));
}
/**
* Determines whether the model does not have a value.
*/
isEmpty() {
return this._selection.size === 0;
}
/**
* Determines whether the model has a value.
*/
hasValue() {
return !this.isEmpty();
}
/**
* Sorts the selected values based on a predicate function.
*/
sort(predicate) {
if (this._multiple && this.selected) {
this._selected.sort(predicate);
}
}
/**
* Gets whether multiple values can be selected.
*/
isMultipleSelection() {
return this._multiple;
}
/** Emits a change event and clears the records of selected and deselected values. */
_emitChangeEvent() {
this._selected = null;
if (this._selectedToEmit.length || this._deselectedToEmit.length) {
this.changed.next({
source: this,
added: this._selectedToEmit,
removed: this._deselectedToEmit
});
this._deselectedToEmit = [];
this._selectedToEmit = [];
}
}
/** Selects a value. */
_markSelected(value) {
value = this._getConcreteValue(value);
if (!this.isSelected(value)) {
if (!this._multiple) {
this._unmarkAll();
}
if (!this.isSelected(value)) {
this._selection.add(value);
}
if (this._emitChanges) {
this._selectedToEmit.push(value);
}
}
}
/** Deselects a value. */
_unmarkSelected(value) {
value = this._getConcreteValue(value);
if (this.isSelected(value)) {
this._selection.delete(value);
if (this._emitChanges) {
this._deselectedToEmit.push(value);
}
}
}
/** Clears out the selected values. */
_unmarkAll() {
if (!this.isEmpty()) {
this._selection.forEach((value) => this._unmarkSelected(value));
}
}
/**
* Verifies the value assignment and throws an error if the specified value array is
* including multiple values while the selection model is not supporting multiple values.
*/
_verifyValueAssignment(values) {
if (values.length > 1 && !this._multiple && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw getMultipleValuesInSingleSelectionError();
}
}
/** Whether there are queued up change to be emitted. */
_hasQueuedChanges() {
return !!(this._deselectedToEmit.length || this._selectedToEmit.length);
}
/** Returns a value that is comparable to inputValue by applying compareWith function, returns the same inputValue otherwise. */
_getConcreteValue(inputValue, selection) {
if (!this.compareWith) {
return inputValue;
} else {
selection = selection ?? this._selection;
for (let selectedValue of selection) {
if (this.compareWith(inputValue, selectedValue)) {
return selectedValue;
}
}
return inputValue;
}
}
};
function getMultipleValuesInSingleSelectionError() {
return Error("Cannot pass multiple values into SelectionModel with single-value mode.");
}
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/pseudo-checkbox-module.mjs
var MatPseudoCheckboxModule = class _MatPseudoCheckboxModule {
static \u0275fac = function MatPseudoCheckboxModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatPseudoCheckboxModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _MatPseudoCheckboxModule,
imports: [MatCommonModule, MatPseudoCheckbox],
exports: [MatPseudoCheckbox]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
imports: [MatCommonModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatPseudoCheckboxModule, [{
type: NgModule,
args: [{
imports: [MatCommonModule, MatPseudoCheckbox],
exports: [MatPseudoCheckbox]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/option-module.mjs
var MatOptionModule = class _MatOptionModule {
static \u0275fac = function MatOptionModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatOptionModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _MatOptionModule,
imports: [MatRippleModule, MatCommonModule, MatPseudoCheckboxModule, MatOption, MatOptgroup],
exports: [MatOption, MatOptgroup]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
imports: [MatRippleModule, MatCommonModule, MatPseudoCheckboxModule, MatOption]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatOptionModule, [{
type: NgModule,
args: [{
imports: [MatRippleModule, MatCommonModule, MatPseudoCheckboxModule, MatOption, MatOptgroup],
exports: [MatOption, MatOptgroup]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/select-module.mjs
var _c08 = ["trigger"];
var _c16 = ["panel"];
var _c24 = [[["mat-select-trigger"]], "*"];
var _c34 = ["mat-select-trigger", "*"];
function MatSelect_Conditional_4_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "span", 4);
\u0275\u0275text(1);
\u0275\u0275elementEnd();
}
if (rf & 2) {
const ctx_r1 = \u0275\u0275nextContext();
\u0275\u0275advance();
\u0275\u0275textInterpolate(ctx_r1.placeholder);
}
}
function MatSelect_Conditional_5_Conditional_1_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275projection(0);
}
}
function MatSelect_Conditional_5_Conditional_2_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "span", 11);
\u0275\u0275text(1);
\u0275\u0275elementEnd();
}
if (rf & 2) {
const ctx_r1 = \u0275\u0275nextContext(2);
\u0275\u0275advance();
\u0275\u0275textInterpolate(ctx_r1.triggerValue);
}
}
function MatSelect_Conditional_5_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "span", 5);
\u0275\u0275conditionalCreate(1, MatSelect_Conditional_5_Conditional_1_Template, 1, 0)(2, MatSelect_Conditional_5_Conditional_2_Template, 2, 1, "span", 11);
\u0275\u0275elementEnd();
}
if (rf & 2) {
const ctx_r1 = \u0275\u0275nextContext();
\u0275\u0275advance();
\u0275\u0275conditional(ctx_r1.customTrigger ? 1 : 2);
}
}
function MatSelect_ng_template_10_Template(rf, ctx) {
if (rf & 1) {
const _r3 = \u0275\u0275getCurrentView();
\u0275\u0275elementStart(0, "div", 12, 1);
\u0275\u0275listener("keydown", function MatSelect_ng_template_10_Template_div_keydown_0_listener($event) {
\u0275\u0275restoreView(_r3);
const ctx_r1 = \u0275\u0275nextContext();
return \u0275\u0275resetView(ctx_r1._handleKeydown($event));
});
\u0275\u0275projection(2, 1);
\u0275\u0275elementEnd();
}
if (rf & 2) {
const ctx_r1 = \u0275\u0275nextContext();
\u0275\u0275classMap(\u0275\u0275interpolate1("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ", ctx_r1._getPanelTheme()));
\u0275\u0275classProp("mat-select-panel-animations-enabled", !ctx_r1._animationsDisabled);
\u0275\u0275property("ngClass", ctx_r1.panelClass);
\u0275\u0275attribute("id", ctx_r1.id + "-panel")("aria-multiselectable", ctx_r1.multiple)("aria-label", ctx_r1.ariaLabel || null)("aria-labelledby", ctx_r1._getPanelAriaLabelledby());
}
}
function getMatSelectDynamicMultipleError() {
return Error("Cannot change `multiple` mode of select after initialization.");
}
function getMatSelectNonArrayValueError() {
return Error("Value must be an array in multiple-selection mode.");
}
function getMatSelectNonFunctionValueError() {
return Error("`compareWith` must be a function.");
}
var MAT_SELECT_SCROLL_STRATEGY = new InjectionToken("mat-select-scroll-strategy", {
providedIn: "root",
factory: () => {
const injector = inject2(Injector);
return () => createRepositionScrollStrategy(injector);
}
});
function MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY(_overlay) {
const injector = inject2(Injector);
return () => createRepositionScrollStrategy(injector);
}
var MAT_SELECT_CONFIG = new InjectionToken("MAT_SELECT_CONFIG");
var MAT_SELECT_SCROLL_STRATEGY_PROVIDER = {
provide: MAT_SELECT_SCROLL_STRATEGY,
deps: [],
useFactory: MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY
};
var MAT_SELECT_TRIGGER = new InjectionToken("MatSelectTrigger");
var MatSelectChange = class {
source;
value;
constructor(source, value) {
this.source = source;
this.value = value;
}
};
var MatSelect = class _MatSelect {
_viewportRuler = inject2(ViewportRuler);
_changeDetectorRef = inject2(ChangeDetectorRef);
_elementRef = inject2(ElementRef);
_dir = inject2(Directionality, {
optional: true
});
_idGenerator = inject2(_IdGenerator);
_renderer = inject2(Renderer2);
_parentFormField = inject2(MAT_FORM_FIELD, {
optional: true
});
ngControl = inject2(NgControl, {
self: true,
optional: true
});
_liveAnnouncer = inject2(LiveAnnouncer);
_defaultOptions = inject2(MAT_SELECT_CONFIG, {
optional: true
});
_animationsDisabled = _animationsDisabled();
_initialized = new Subject();
_cleanupDetach;
/** All of the defined select options. */
options;
// TODO(crisbeto): this is only necessary for the non-MDC select, but it's technically a
// public API so we have to keep it. It should be deprecated and removed eventually.
/** All of the defined groups of options. */
optionGroups;
/** User-supplied override of the trigger element. */
customTrigger;
/**
* This position config ensures that the top "start" corner of the overlay
* is aligned with with the top "start" of the origin by default (overlapping
* the trigger completely). If the panel cannot fit below the trigger, it
* will fall back to a position above the trigger.
*/
_positions = [{
originX: "start",
originY: "bottom",
overlayX: "start",
overlayY: "top"
}, {
originX: "end",
originY: "bottom",
overlayX: "end",
overlayY: "top"
}, {
originX: "start",
originY: "top",
overlayX: "start",
overlayY: "bottom",
panelClass: "mat-mdc-select-panel-above"
}, {
originX: "end",
originY: "top",
overlayX: "end",
overlayY: "bottom",
panelClass: "mat-mdc-select-panel-above"
}];
/** Scrolls a particular option into the view. */
_scrollOptionIntoView(index) {
const option = this.options.toArray()[index];
if (option) {
const panel = this.panel.nativeElement;
const labelCount = _countGroupLabelsBeforeOption(index, this.options, this.optionGroups);
const element = option._getHostElement();
if (index === 0 && labelCount === 1) {
panel.scrollTop = 0;
} else {
panel.scrollTop = _getOptionScrollPosition(element.offsetTop, element.offsetHeight, panel.scrollTop, panel.offsetHeight);
}
}
}
/** Called when the panel has been opened and the overlay has settled on its final position. */
_positioningSettled() {
this._scrollOptionIntoView(this._keyManager.activeItemIndex || 0);
}
/** Creates a change event object that should be emitted by the select. */
_getChangeEvent(value) {
return new MatSelectChange(this, value);
}
/** Factory function used to create a scroll strategy for this select. */
_scrollStrategyFactory = inject2(MAT_SELECT_SCROLL_STRATEGY);
/** Whether or not the overlay panel is open. */
_panelOpen = false;
/** Comparison function to specify which option is displayed. Defaults to object equality. */
_compareWith = (o1, o2) => o1 === o2;
/** Unique id for this input. */
_uid = this._idGenerator.getId("mat-select-");
/** Current `aria-labelledby` value for the select trigger. */
_triggerAriaLabelledBy = null;
/**
* Keeps track of the previous form control assigned to the select.
* Used to detect if it has changed.
*/
_previousControl;
/** Emits whenever the component is destroyed. */
_destroy = new Subject();
/** Tracks the error state of the select. */
_errorStateTracker;
/**
* Emits whenever the component state changes and should cause the parent
* form-field to update. Implemented as part of `MatFormFieldControl`.
* @docs-private
*/
stateChanges = new Subject();
/**
* Disable the automatic labeling to avoid issues like #27241.
* @docs-private
*/
disableAutomaticLabeling = true;
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
userAriaDescribedBy;
/** Deals with the selection logic. */
_selectionModel;
/** Manages keyboard events for options in the panel. */
_keyManager;
/** Ideal origin for the overlay panel. */
_preferredOverlayOrigin;
/** Width of the overlay panel. */
_overlayWidth;
/** `View -> model callback called when value changes` */
_onChange = () => {
};
/** `View -> model callback called when select has been touched` */
_onTouched = () => {
};
/** ID for the DOM node containing the select's value. */
_valueId = this._idGenerator.getId("mat-select-value-");
/** Strategy that will be used to handle scrolling while the select panel is open. */
_scrollStrategy;
_overlayPanelClass = this._defaultOptions?.overlayPanelClass || "";
/** Whether the select is focused. */
get focused() {
return this._focused || this._panelOpen;
}
_focused = false;
/** A name for this control that can be used by `mat-form-field`. */
controlType = "mat-select";
/** Trigger that opens the select. */
trigger;
/** Panel containing the select options. */
panel;
/** Overlay pane containing the options. */
_overlayDir;
/** Classes to be passed to the select panel. Supports the same syntax as `ngClass`. */
panelClass;
/** Whether the select is disabled. */
disabled = false;
/** Whether ripples in the select are disabled. */
get disableRipple() {
return this._disableRipple();
}
set disableRipple(value) {
this._disableRipple.set(value);
}
_disableRipple = signal(false, ...ngDevMode ? [{
debugName: "_disableRipple"
}] : []);
/** Tab index of the select. */
tabIndex = 0;
/** Whether checkmark indicator for single-selection options is hidden. */
get hideSingleSelectionIndicator() {
return this._hideSingleSelectionIndicator;
}
set hideSingleSelectionIndicator(value) {
this._hideSingleSelectionIndicator = value;
this._syncParentProperties();
}
_hideSingleSelectionIndicator = this._defaultOptions?.hideSingleSelectionIndicator ?? false;
/** Placeholder to be shown if no value has been selected. */
get placeholder() {
return this._placeholder;
}
set placeholder(value) {
this._placeholder = value;
this.stateChanges.next();
}
_placeholder;
/** Whether the component is required. */
get required() {
return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;
}
set required(value) {
this._required = value;
this.stateChanges.next();
}
_required;
/** Whether the user should be allowed to select multiple options. */
get multiple() {
return this._multiple;
}
set multiple(value) {
if (this._selectionModel && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw getMatSelectDynamicMultipleError();
}
this._multiple = value;
}
_multiple = false;
/** Whether to center the active option over the trigger. */
disableOptionCentering = this._defaultOptions?.disableOptionCentering ?? false;
/**
* Function to compare the option values with the selected values. The first argument
* is a value from an option. The second is a value from the selection. A boolean
* should be returned.
*/
get compareWith() {
return this._compareWith;
}
set compareWith(fn) {
if (typeof fn !== "function" && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw getMatSelectNonFunctionValueError();
}
this._compareWith = fn;
if (this._selectionModel) {
this._initializeSelection();
}
}
/** Value of the select control. */
get value() {
return this._value;
}
set value(newValue) {
const hasAssigned = this._assignValue(newValue);
if (hasAssigned) {
this._onChange(newValue);
}
}
_value;
/** Aria label of the select. */
ariaLabel = "";
/** Input that can be used to specify the `aria-labelledby` attribute. */
ariaLabelledby;
/** Object used to control when error messages are shown. */
get errorStateMatcher() {
return this._errorStateTracker.matcher;
}
set errorStateMatcher(value) {
this._errorStateTracker.matcher = value;
}
/** Time to wait in milliseconds after the last keystroke before moving focus to an item. */
typeaheadDebounceInterval;
/**
* Function used to sort the values in a select in multiple mode.
* Follows the same logic as `Array.prototype.sort`.
*/
sortComparator;
/** Unique id of the element. */
get id() {
return this._id;
}
set id(value) {
this._id = value || this._uid;
this.stateChanges.next();
}
_id;
/** Whether the select is in an error state. */
get errorState() {
return this._errorStateTracker.errorState;
}
set errorState(value) {
this._errorStateTracker.errorState = value;
}
/**
* Width of the panel. If set to `auto`, the panel will match the trigger width.
* If set to null or an empty string, the panel will grow to match the longest option's text.
*/
panelWidth = this._defaultOptions && typeof this._defaultOptions.panelWidth !== "undefined" ? this._defaultOptions.panelWidth : "auto";
/**
* By default selecting an option with a `null` or `undefined` value will reset the select's
* value. Enable this option if the reset behavior doesn't match your requirements and instead
* the nullable options should become selected. The value of this input can be controlled app-wide
* using the `MAT_SELECT_CONFIG` injection token.
*/
canSelectNullableOptions = this._defaultOptions?.canSelectNullableOptions ?? false;
/** Combined stream of all of the child options' change events. */
optionSelectionChanges = defer(() => {
const options = this.options;
if (options) {
return options.changes.pipe(startWith(options), switchMap(() => merge(...options.map((option) => option.onSelectionChange))));
}
return this._initialized.pipe(switchMap(() => this.optionSelectionChanges));
});
/** Event emitted when the select panel has been toggled. */
openedChange = new EventEmitter();
/** Event emitted when the select has been opened. */
_openedStream = this.openedChange.pipe(filter((o) => o), map(() => {
}));
/** Event emitted when the select has been closed. */
_closedStream = this.openedChange.pipe(filter((o) => !o), map(() => {
}));
/** Event emitted when the selected value has been changed by the user. */
selectionChange = new EventEmitter();
/**
* Event that emits whenever the raw value of the select changes. This is here primarily
* to facilitate the two-way binding for the `value` input.
* @docs-private
*/
valueChange = new EventEmitter();
constructor() {
const defaultErrorStateMatcher = inject2(ErrorStateMatcher);
const parentForm = inject2(NgForm, {
optional: true
});
const parentFormGroup = inject2(FormGroupDirective, {
optional: true
});
const tabIndex = inject2(new HostAttributeToken("tabindex"), {
optional: true
});
if (this.ngControl) {
this.ngControl.valueAccessor = this;
}
if (this._defaultOptions?.typeaheadDebounceInterval != null) {
this.typeaheadDebounceInterval = this._defaultOptions.typeaheadDebounceInterval;
}
this._errorStateTracker = new _ErrorStateTracker(defaultErrorStateMatcher, this.ngControl, parentFormGroup, parentForm, this.stateChanges);
this._scrollStrategy = this._scrollStrategyFactory();
this.tabIndex = tabIndex == null ? 0 : parseInt(tabIndex) || 0;
this.id = this.id;
}
ngOnInit() {
this._selectionModel = new SelectionModel(this.multiple);
this.stateChanges.next();
this._viewportRuler.change().pipe(takeUntil(this._destroy)).subscribe(() => {
if (this.panelOpen) {
this._overlayWidth = this._getOverlayWidth(this._preferredOverlayOrigin);
this._changeDetectorRef.detectChanges();
}
});
}
ngAfterContentInit() {
this._initialized.next();
this._initialized.complete();
this._initKeyManager();
this._selectionModel.changed.pipe(takeUntil(this._destroy)).subscribe((event) => {
event.added.forEach((option) => option.select());
event.removed.forEach((option) => option.deselect());
});
this.options.changes.pipe(startWith(null), takeUntil(this._destroy)).subscribe(() => {
this._resetOptions();
this._initializeSelection();
});
}
ngDoCheck() {
const newAriaLabelledby = this._getTriggerAriaLabelledby();
const ngControl = this.ngControl;
if (newAriaLabelledby !== this._triggerAriaLabelledBy) {
const element = this._elementRef.nativeElement;
this._triggerAriaLabelledBy = newAriaLabelledby;
if (newAriaLabelledby) {
element.setAttribute("aria-labelledby", newAriaLabelledby);
} else {
element.removeAttribute("aria-labelledby");
}
}
if (ngControl) {
if (this._previousControl !== ngControl.control) {
if (this._previousControl !== void 0 && ngControl.disabled !== null && ngControl.disabled !== this.disabled) {
this.disabled = ngControl.disabled;
}
this._previousControl = ngControl.control;
}
this.updateErrorState();
}
}
ngOnChanges(changes) {
if (changes["disabled"] || changes["userAriaDescribedBy"]) {
this.stateChanges.next();
}
if (changes["typeaheadDebounceInterval"] && this._keyManager) {
this._keyManager.withTypeAhead(this.typeaheadDebounceInterval);
}
}
ngOnDestroy() {
this._cleanupDetach?.();
this._keyManager?.destroy();
this._destroy.next();
this._destroy.complete();
this.stateChanges.complete();
this._clearFromModal();
}
/** Toggles the overlay panel open or closed. */
toggle() {
this.panelOpen ? this.close() : this.open();
}
/** Opens the overlay panel. */
open() {
if (!this._canOpen()) {
return;
}
if (this._parentFormField) {
this._preferredOverlayOrigin = this._parentFormField.getConnectedOverlayOrigin();
}
this._cleanupDetach?.();
this._overlayWidth = this._getOverlayWidth(this._preferredOverlayOrigin);
this._applyModalPanelOwnership();
this._panelOpen = true;
this._overlayDir.positionChange.pipe(take(1)).subscribe(() => {
this._changeDetectorRef.detectChanges();
this._positioningSettled();
});
this._overlayDir.attachOverlay();
this._keyManager.withHorizontalOrientation(null);
this._highlightCorrectOption();
this._changeDetectorRef.markForCheck();
this.stateChanges.next();
Promise.resolve().then(() => this.openedChange.emit(true));
}
/**
* Track which modal we have modified the `aria-owns` attribute of. When the combobox trigger is
* inside an aria-modal, we apply aria-owns to the parent modal with the `id` of the options
* panel. Track the modal we have changed so we can undo the changes on destroy.
*/
_trackedModal = null;
/**
* If the autocomplete trigger is inside of an `aria-modal` element, connect
* that modal to the options panel with `aria-owns`.
*
* For some browser + screen reader combinations, when navigation is inside
* of an `aria-modal` element, the screen reader treats everything outside
* of that modal as hidden or invisible.
*
* This causes a problem when the combobox trigger is _inside_ of a modal, because the
* options panel is rendered _outside_ of that modal, preventing screen reader navigation
* from reaching the panel.
*
* We can work around this issue by applying `aria-owns` to the modal with the `id` of
* the options panel. This effectively communicates to assistive technology that the
* options panel is part of the same interaction as the modal.
*
* At time of this writing, this issue is present in VoiceOver.
* See https://github.com/angular/components/issues/20694
*/
_applyModalPanelOwnership() {
const modal = this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');
if (!modal) {
return;
}
const panelId = `${this.id}-panel`;
if (this._trackedModal) {
removeAriaReferencedId(this._trackedModal, "aria-owns", panelId);
}
addAriaReferencedId(modal, "aria-owns", panelId);
this._trackedModal = modal;
}
/** Clears the reference to the listbox overlay element from the modal it was added to. */
_clearFromModal() {
if (!this._trackedModal) {
return;
}
const panelId = `${this.id}-panel`;
removeAriaReferencedId(this._trackedModal, "aria-owns", panelId);
this._trackedModal = null;
}
/** Closes the overlay panel and focuses the host element. */
close() {
if (this._panelOpen) {
this._panelOpen = false;
this._exitAndDetach();
this._keyManager.withHorizontalOrientation(this._isRtl() ? "rtl" : "ltr");
this._changeDetectorRef.markForCheck();
this._onTouched();
this.stateChanges.next();
Promise.resolve().then(() => this.openedChange.emit(false));
}
}
/** Triggers the exit animation and detaches the overlay at the end. */
_exitAndDetach() {
if (this._animationsDisabled || !this.panel) {
this._detachOverlay();
return;
}
this._cleanupDetach?.();
this._cleanupDetach = () => {
cleanupEvent();
clearTimeout(exitFallbackTimer);
this._cleanupDetach = void 0;
};
const panel = this.panel.nativeElement;
const cleanupEvent = this._renderer.listen(panel, "animationend", (event) => {
if (event.animationName === "_mat-select-exit") {
this._cleanupDetach?.();
this._detachOverlay();
}
});
const exitFallbackTimer = setTimeout(() => {
this._cleanupDetach?.();
this._detachOverlay();
}, 200);
panel.classList.add("mat-select-panel-exit");
}
/** Detaches the current overlay directive. */
_detachOverlay() {
this._overlayDir.detachOverlay();
this._changeDetectorRef.markForCheck();
}
/**
* Sets the select's value. Part of the ControlValueAccessor interface
* required to integrate with Angular's core forms API.
*
* @param value New value to be written to the model.
*/
writeValue(value) {
this._assignValue(value);
}
/**
* Saves a callback function to be invoked when the select's value
* changes from user input. Part of the ControlValueAccessor interface
* required to integrate with Angular's core forms API.
*
* @param fn Callback to be triggered when the value changes.
*/
registerOnChange(fn) {
this._onChange = fn;
}
/**
* Saves a callback function to be invoked when the select is blurred
* by the user. Part of the ControlValueAccessor interface required
* to integrate with Angular's core forms API.
*
* @param fn Callback to be triggered when the component has been touched.
*/
registerOnTouched(fn) {
this._onTouched = fn;
}
/**
* Disables the select. Part of the ControlValueAccessor interface required
* to integrate with Angular's core forms API.
*
* @param isDisabled Sets whether the component is disabled.
*/
setDisabledState(isDisabled) {
this.disabled = isDisabled;
this._changeDetectorRef.markForCheck();
this.stateChanges.next();
}
/** Whether or not the overlay panel is open. */
get panelOpen() {
return this._panelOpen;
}
/** The currently selected option. */
get selected() {
return this.multiple ? this._selectionModel?.selected || [] : this._selectionModel?.selected[0];
}
/** The value displayed in the trigger. */
get triggerValue() {
if (this.empty) {
return "";
}
if (this._multiple) {
const selectedOptions = this._selectionModel.selected.map((option) => option.viewValue);
if (this._isRtl()) {
selectedOptions.reverse();
}
return selectedOptions.join(", ");
}
return this._selectionModel.selected[0].viewValue;
}
/** Refreshes the error state of the select. */
updateErrorState() {
this._errorStateTracker.updateErrorState();
}
/** Whether the element is in RTL mode. */
_isRtl() {
return this._dir ? this._dir.value === "rtl" : false;
}
/** Handles all keydown events on the select. */
_handleKeydown(event) {
if (!this.disabled) {
this.panelOpen ? this._handleOpenKeydown(event) : this._handleClosedKeydown(event);
}
}
/** Handles keyboard events while the select is closed. */
_handleClosedKeydown(event) {
const keyCode = event.keyCode;
const isArrowKey = keyCode === DOWN_ARROW || keyCode === UP_ARROW || keyCode === LEFT_ARROW || keyCode === RIGHT_ARROW;
const isOpenKey = keyCode === ENTER || keyCode === SPACE;
const manager = this._keyManager;
if (!manager.isTyping() && isOpenKey && !hasModifierKey(event) || (this.multiple || event.altKey) && isArrowKey) {
event.preventDefault();
this.open();
} else if (!this.multiple) {
const previouslySelectedOption = this.selected;
manager.onKeydown(event);
const selectedOption = this.selected;
if (selectedOption && previouslySelectedOption !== selectedOption) {
this._liveAnnouncer.announce(selectedOption.viewValue, 1e4);
}
}
}
/** Handles keyboard events when the selected is open. */
_handleOpenKeydown(event) {
const manager = this._keyManager;
const keyCode = event.keyCode;
const isArrowKey = keyCode === DOWN_ARROW || keyCode === UP_ARROW;
const isTyping = manager.isTyping();
if (isArrowKey && event.altKey) {
event.preventDefault();
this.close();
} else if (!isTyping && (keyCode === ENTER || keyCode === SPACE) && manager.activeItem && !hasModifierKey(event)) {
event.preventDefault();
manager.activeItem._selectViaInteraction();
} else if (!isTyping && this._multiple && keyCode === A && event.ctrlKey) {
event.preventDefault();
const hasDeselectedOptions = this.options.some((opt) => !opt.disabled && !opt.selected);
this.options.forEach((option) => {
if (!option.disabled) {
hasDeselectedOptions ? option.select() : option.deselect();
}
});
} else {
const previouslyFocusedIndex = manager.activeItemIndex;
manager.onKeydown(event);
if (this._multiple && isArrowKey && event.shiftKey && manager.activeItem && manager.activeItemIndex !== previouslyFocusedIndex) {
manager.activeItem._selectViaInteraction();
}
}
}
/** Handles keyboard events coming from the overlay. */
_handleOverlayKeydown(event) {
if (event.keyCode === ESCAPE && !hasModifierKey(event)) {
event.preventDefault();
this.close();
}
}
_onFocus() {
if (!this.disabled) {
this._focused = true;
this.stateChanges.next();
}
}
/**
* Calls the touched callback only if the panel is closed. Otherwise, the trigger will
* "blur" to the panel when it opens, causing a false positive.
*/
_onBlur() {
this._focused = false;
this._keyManager?.cancelTypeahead();
if (!this.disabled && !this.panelOpen) {
this._onTouched();
this._changeDetectorRef.markForCheck();
this.stateChanges.next();
}
}
/** Returns the theme to be used on the panel. */
_getPanelTheme() {
return this._parentFormField ? `mat-${this._parentFormField.color}` : "";
}
/** Whether the select has a value. */
get empty() {
return !this._selectionModel || this._selectionModel.isEmpty();
}
_initializeSelection() {
Promise.resolve().then(() => {
if (this.ngControl) {
this._value = this.ngControl.value;
}
this._setSelectionByValue(this._value);
this.stateChanges.next();
});
}
/**
* Sets the selected option based on a value. If no option can be
* found with the designated value, the select trigger is cleared.
*/
_setSelectionByValue(value) {
this.options.forEach((option) => option.setInactiveStyles());
this._selectionModel.clear();
if (this.multiple && value) {
if (!Array.isArray(value) && (typeof ngDevMode === "undefined" || ngDevMode)) {
throw getMatSelectNonArrayValueError();
}
value.forEach((currentValue) => this._selectOptionByValue(currentValue));
this._sortValues();
} else {
const correspondingOption = this._selectOptionByValue(value);
if (correspondingOption) {
this._keyManager.updateActiveItem(correspondingOption);
} else if (!this.panelOpen) {
this._keyManager.updateActiveItem(-1);
}
}
this._changeDetectorRef.markForCheck();
}
/**
* Finds and selects and option based on its value.
* @returns Option that has the corresponding value.
*/
_selectOptionByValue(value) {
const correspondingOption = this.options.find((option) => {
if (this._selectionModel.isSelected(option)) {
return false;
}
try {
return (option.value != null || this.canSelectNullableOptions) && this._compareWith(option.value, value);
} catch (error) {
if (typeof ngDevMode === "undefined" || ngDevMode) {
console.warn(error);
}
return false;
}
});
if (correspondingOption) {
this._selectionModel.select(correspondingOption);
}
return correspondingOption;
}
/** Assigns a specific value to the select. Returns whether the value has changed. */
_assignValue(newValue) {
if (newValue !== this._value || this._multiple && Array.isArray(newValue)) {
if (this.options) {
this._setSelectionByValue(newValue);
}
this._value = newValue;
return true;
}
return false;
}
// `skipPredicate` determines if key manager should avoid putting a given option in the tab
// order. Allow disabled list items to receive focus via keyboard to align with WAI ARIA
// recommendation.
//
// Normally WAI ARIA's instructions are to exclude disabled items from the tab order, but it
// makes a few exceptions for compound widgets.
//
// From [Developing a Keyboard Interface](
// https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/):
// "For the following composite widget elements, keep them focusable when disabled: Options in a
// Listbox..."
//
// The user can focus disabled options using the keyboard, but the user cannot click disabled
// options.
_skipPredicate = (option) => {
if (this.panelOpen) {
return false;
}
return option.disabled;
};
/** Gets how wide the overlay panel should be. */
_getOverlayWidth(preferredOrigin) {
if (this.panelWidth === "auto") {
const refToMeasure = preferredOrigin instanceof CdkOverlayOrigin ? preferredOrigin.elementRef : preferredOrigin || this._elementRef;
return refToMeasure.nativeElement.getBoundingClientRect().width;
}
return this.panelWidth === null ? "" : this.panelWidth;
}
/** Syncs the parent state with the individual options. */
_syncParentProperties() {
if (this.options) {
for (const option of this.options) {
option._changeDetectorRef.markForCheck();
}
}
}
/** Sets up a key manager to listen to keyboard events on the overlay panel. */
_initKeyManager() {
this._keyManager = new ActiveDescendantKeyManager(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl() ? "rtl" : "ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate);
this._keyManager.tabOut.subscribe(() => {
if (this.panelOpen) {
if (!this.multiple && this._keyManager.activeItem) {
this._keyManager.activeItem._selectViaInteraction();
}
this.focus();
this.close();
}
});
this._keyManager.change.subscribe(() => {
if (this._panelOpen && this.panel) {
this._scrollOptionIntoView(this._keyManager.activeItemIndex || 0);
} else if (!this._panelOpen && !this.multiple && this._keyManager.activeItem) {
this._keyManager.activeItem._selectViaInteraction();
}
});
}
/** Drops current option subscriptions and IDs and resets from scratch. */
_resetOptions() {
const changedOrDestroyed = merge(this.options.changes, this._destroy);
this.optionSelectionChanges.pipe(takeUntil(changedOrDestroyed)).subscribe((event) => {
this._onSelect(event.source, event.isUserInput);
if (event.isUserInput && !this.multiple && this._panelOpen) {
this.close();
this.focus();
}
});
merge(...this.options.map((option) => option._stateChanges)).pipe(takeUntil(changedOrDestroyed)).subscribe(() => {
this._changeDetectorRef.detectChanges();
this.stateChanges.next();
});
}
/** Invoked when an option is clicked. */
_onSelect(option, isUserInput) {
const wasSelected = this._selectionModel.isSelected(option);
if (!this.canSelectNullableOptions && option.value == null && !this._multiple) {
option.deselect();
this._selectionModel.clear();
if (this.value != null) {
this._propagateChanges(option.value);
}
} else {
if (wasSelected !== option.selected) {
option.selected ? this._selectionModel.select(option) : this._selectionModel.deselect(option);
}
if (isUserInput) {
this._keyManager.setActiveItem(option);
}
if (this.multiple) {
this._sortValues();
if (isUserInput) {
this.focus();
}
}
}
if (wasSelected !== this._selectionModel.isSelected(option)) {
this._propagateChanges();
}
this.stateChanges.next();
}
/** Sorts the selected values in the selected based on their order in the panel. */
_sortValues() {
if (this.multiple) {
const options = this.options.toArray();
this._selectionModel.sort((a, b) => {
return this.sortComparator ? this.sortComparator(a, b, options) : options.indexOf(a) - options.indexOf(b);
});
this.stateChanges.next();
}
}
/** Emits change event to set the model value. */
_propagateChanges(fallbackValue) {
let valueToEmit;
if (this.multiple) {
valueToEmit = this.selected.map((option) => option.value);
} else {
valueToEmit = this.selected ? this.selected.value : fallbackValue;
}
this._value = valueToEmit;
this.valueChange.emit(valueToEmit);
this._onChange(valueToEmit);
this.selectionChange.emit(this._getChangeEvent(valueToEmit));
this._changeDetectorRef.markForCheck();
}
/**
* Highlights the selected item. If no option is selected, it will highlight
* the first *enabled* option.
*/
_highlightCorrectOption() {
if (this._keyManager) {
if (this.empty) {
let firstEnabledOptionIndex = -1;
for (let index = 0; index < this.options.length; index++) {
const option = this.options.get(index);
if (!option.disabled) {
firstEnabledOptionIndex = index;
break;
}
}
this._keyManager.setActiveItem(firstEnabledOptionIndex);
} else {
this._keyManager.setActiveItem(this._selectionModel.selected[0]);
}
}
}
/** Whether the panel is allowed to open. */
_canOpen() {
return !this._panelOpen && !this.disabled && this.options?.length > 0 && !!this._overlayDir;
}
/** Focuses the select element. */
focus(options) {
this._elementRef.nativeElement.focus(options);
}
/** Gets the aria-labelledby for the select panel. */
_getPanelAriaLabelledby() {
if (this.ariaLabel) {
return null;
}
const labelId = this._parentFormField?.getLabelId() || null;
const labelExpression = labelId ? labelId + " " : "";
return this.ariaLabelledby ? labelExpression + this.ariaLabelledby : labelId;
}
/** Determines the `aria-activedescendant` to be set on the host. */
_getAriaActiveDescendant() {
if (this.panelOpen && this._keyManager && this._keyManager.activeItem) {
return this._keyManager.activeItem.id;
}
return null;
}
/** Gets the aria-labelledby of the select component trigger. */
_getTriggerAriaLabelledby() {
if (this.ariaLabel) {
return null;
}
let value = this._parentFormField?.getLabelId() || "";
if (this.ariaLabelledby) {
value += " " + this.ariaLabelledby;
}
if (!value) {
value = this._valueId;
}
return value;
}
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get describedByIds() {
const element = this._elementRef.nativeElement;
const existingDescribedBy = element.getAttribute("aria-describedby");
return existingDescribedBy?.split(" ") || [];
}
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
setDescribedByIds(ids) {
if (ids.length) {
this._elementRef.nativeElement.setAttribute("aria-describedby", ids.join(" "));
} else {
this._elementRef.nativeElement.removeAttribute("aria-describedby");
}
}
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
onContainerClick() {
this.focus();
this.open();
}
/**
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
get shouldLabelFloat() {
return this.panelOpen || !this.empty || this.focused && !!this.placeholder;
}
static \u0275fac = function MatSelect_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatSelect)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: _MatSelect,
selectors: [["mat-select"]],
contentQueries: function MatSelect_ContentQueries(rf, ctx, dirIndex) {
if (rf & 1) {
\u0275\u0275contentQuery(dirIndex, MAT_SELECT_TRIGGER, 5);
\u0275\u0275contentQuery(dirIndex, MatOption, 5);
\u0275\u0275contentQuery(dirIndex, MAT_OPTGROUP, 5);
}
if (rf & 2) {
let _t;
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.customTrigger = _t.first);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.options = _t);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.optionGroups = _t);
}
},
viewQuery: function MatSelect_Query(rf, ctx) {
if (rf & 1) {
\u0275\u0275viewQuery(_c08, 5);
\u0275\u0275viewQuery(_c16, 5);
\u0275\u0275viewQuery(CdkConnectedOverlay, 5);
}
if (rf & 2) {
let _t;
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.trigger = _t.first);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.panel = _t.first);
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._overlayDir = _t.first);
}
},
hostAttrs: ["role", "combobox", "aria-haspopup", "listbox", 1, "mat-mdc-select"],
hostVars: 19,
hostBindings: function MatSelect_HostBindings(rf, ctx) {
if (rf & 1) {
\u0275\u0275listener("keydown", function MatSelect_keydown_HostBindingHandler($event) {
return ctx._handleKeydown($event);
})("focus", function MatSelect_focus_HostBindingHandler() {
return ctx._onFocus();
})("blur", function MatSelect_blur_HostBindingHandler() {
return ctx._onBlur();
});
}
if (rf & 2) {
\u0275\u0275attribute("id", ctx.id)("tabindex", ctx.disabled ? -1 : ctx.tabIndex)("aria-controls", ctx.panelOpen ? ctx.id + "-panel" : null)("aria-expanded", ctx.panelOpen)("aria-label", ctx.ariaLabel || null)("aria-required", ctx.required.toString())("aria-disabled", ctx.disabled.toString())("aria-invalid", ctx.errorState)("aria-activedescendant", ctx._getAriaActiveDescendant());
\u0275\u0275classProp("mat-mdc-select-disabled", ctx.disabled)("mat-mdc-select-invalid", ctx.errorState)("mat-mdc-select-required", ctx.required)("mat-mdc-select-empty", ctx.empty)("mat-mdc-select-multiple", ctx.multiple);
}
},
inputs: {
userAriaDescribedBy: [0, "aria-describedby", "userAriaDescribedBy"],
panelClass: "panelClass",
disabled: [2, "disabled", "disabled", booleanAttribute],
disableRipple: [2, "disableRipple", "disableRipple", booleanAttribute],
tabIndex: [2, "tabIndex", "tabIndex", (value) => value == null ? 0 : numberAttribute(value)],
hideSingleSelectionIndicator: [2, "hideSingleSelectionIndicator", "hideSingleSelectionIndicator", booleanAttribute],
placeholder: "placeholder",
required: [2, "required", "required", booleanAttribute],
multiple: [2, "multiple", "multiple", booleanAttribute],
disableOptionCentering: [2, "disableOptionCentering", "disableOptionCentering", booleanAttribute],
compareWith: "compareWith",
value: "value",
ariaLabel: [0, "aria-label", "ariaLabel"],
ariaLabelledby: [0, "aria-labelledby", "ariaLabelledby"],
errorStateMatcher: "errorStateMatcher",
typeaheadDebounceInterval: [2, "typeaheadDebounceInterval", "typeaheadDebounceInterval", numberAttribute],
sortComparator: "sortComparator",
id: "id",
panelWidth: "panelWidth",
canSelectNullableOptions: [2, "canSelectNullableOptions", "canSelectNullableOptions", booleanAttribute]
},
outputs: {
openedChange: "openedChange",
_openedStream: "opened",
_closedStream: "closed",
selectionChange: "selectionChange",
valueChange: "valueChange"
},
exportAs: ["matSelect"],
features: [\u0275\u0275ProvidersFeature([{
provide: MatFormFieldControl,
useExisting: _MatSelect
}, {
provide: MAT_OPTION_PARENT_COMPONENT,
useExisting: _MatSelect
}]), \u0275\u0275NgOnChangesFeature],
ngContentSelectors: _c34,
decls: 11,
vars: 9,
consts: [["fallbackOverlayOrigin", "cdkOverlayOrigin", "trigger", ""], ["panel", ""], ["cdk-overlay-origin", "", 1, "mat-mdc-select-trigger", 3, "click"], [1, "mat-mdc-select-value"], [1, "mat-mdc-select-placeholder", "mat-mdc-select-min-line"], [1, "mat-mdc-select-value-text"], [1, "mat-mdc-select-arrow-wrapper"], [1, "mat-mdc-select-arrow"], ["viewBox", "0 0 24 24", "width", "24px", "height", "24px", "focusable", "false", "aria-hidden", "true"], ["d", "M7 10l5 5 5-5z"], ["cdk-connected-overlay", "", "cdkConnectedOverlayLockPosition", "", "cdkConnectedOverlayHasBackdrop", "", "cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop", 3, "detach", "backdropClick", "overlayKeydown", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayWidth", "cdkConnectedOverlayFlexibleDimensions"], [1, "mat-mdc-select-min-line"], ["role", "listbox", "tabindex", "-1", 3, "keydown", "ngClass"]],
template: function MatSelect_Template(rf, ctx) {
if (rf & 1) {
const _r1 = \u0275\u0275getCurrentView();
\u0275\u0275projectionDef(_c24);
\u0275\u0275elementStart(0, "div", 2, 0);
\u0275\u0275listener("click", function MatSelect_Template_div_click_0_listener() {
\u0275\u0275restoreView(_r1);
return \u0275\u0275resetView(ctx.open());
});
\u0275\u0275elementStart(3, "div", 3);
\u0275\u0275conditionalCreate(4, MatSelect_Conditional_4_Template, 2, 1, "span", 4)(5, MatSelect_Conditional_5_Template, 3, 1, "span", 5);
\u0275\u0275elementEnd();
\u0275\u0275elementStart(6, "div", 6)(7, "div", 7);
\u0275\u0275namespaceSVG();
\u0275\u0275elementStart(8, "svg", 8);
\u0275\u0275element(9, "path", 9);
\u0275\u0275elementEnd()()()();
\u0275\u0275template(10, MatSelect_ng_template_10_Template, 3, 10, "ng-template", 10);
\u0275\u0275listener("detach", function MatSelect_Template_ng_template_detach_10_listener() {
\u0275\u0275restoreView(_r1);
return \u0275\u0275resetView(ctx.close());
})("backdropClick", function MatSelect_Template_ng_template_backdropClick_10_listener() {
\u0275\u0275restoreView(_r1);
return \u0275\u0275resetView(ctx.close());
})("overlayKeydown", function MatSelect_Template_ng_template_overlayKeydown_10_listener($event) {
\u0275\u0275restoreView(_r1);
return \u0275\u0275resetView(ctx._handleOverlayKeydown($event));
});
}
if (rf & 2) {
const fallbackOverlayOrigin_r4 = \u0275\u0275reference(1);
\u0275\u0275advance(3);
\u0275\u0275attribute("id", ctx._valueId);
\u0275\u0275advance();
\u0275\u0275conditional(ctx.empty ? 4 : 5);
\u0275\u0275advance(6);
\u0275\u0275property("cdkConnectedOverlayDisableClose", true)("cdkConnectedOverlayPanelClass", ctx._overlayPanelClass)("cdkConnectedOverlayScrollStrategy", ctx._scrollStrategy)("cdkConnectedOverlayOrigin", ctx._preferredOverlayOrigin || fallbackOverlayOrigin_r4)("cdkConnectedOverlayPositions", ctx._positions)("cdkConnectedOverlayWidth", ctx._overlayWidth)("cdkConnectedOverlayFlexibleDimensions", true);
}
},
dependencies: [CdkOverlayOrigin, CdkConnectedOverlay, NgClass],
styles: ['@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}\n'],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatSelect, [{
type: Component,
args: [{
selector: "mat-select",
exportAs: "matSelect",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
"role": "combobox",
"aria-haspopup": "listbox",
"class": "mat-mdc-select",
"[attr.id]": "id",
"[attr.tabindex]": "disabled ? -1 : tabIndex",
"[attr.aria-controls]": 'panelOpen ? id + "-panel" : null',
"[attr.aria-expanded]": "panelOpen",
"[attr.aria-label]": "ariaLabel || null",
"[attr.aria-required]": "required.toString()",
"[attr.aria-disabled]": "disabled.toString()",
"[attr.aria-invalid]": "errorState",
"[attr.aria-activedescendant]": "_getAriaActiveDescendant()",
"[class.mat-mdc-select-disabled]": "disabled",
"[class.mat-mdc-select-invalid]": "errorState",
"[class.mat-mdc-select-required]": "required",
"[class.mat-mdc-select-empty]": "empty",
"[class.mat-mdc-select-multiple]": "multiple",
"(keydown)": "_handleKeydown($event)",
"(focus)": "_onFocus()",
"(blur)": "_onBlur()"
},
providers: [{
provide: MatFormFieldControl,
useExisting: MatSelect
}, {
provide: MAT_OPTION_PARENT_COMPONENT,
useExisting: MatSelect
}],
imports: [CdkOverlayOrigin, CdkConnectedOverlay, NgClass],
template: `<div cdk-overlay-origin
class="mat-mdc-select-trigger"
(click)="open()"
#fallbackOverlayOrigin="cdkOverlayOrigin"
#trigger>
<div class="mat-mdc-select-value" [attr.id]="_valueId">
@if (empty) {
<span class="mat-mdc-select-placeholder mat-mdc-select-min-line">{{placeholder}}</span>
} @else {
<span class="mat-mdc-select-value-text">
@if (customTrigger) {
<ng-content select="mat-select-trigger"></ng-content>
} @else {
<span class="mat-mdc-select-min-line">{{triggerValue}}</span>
}
</span>
}
</div>
<div class="mat-mdc-select-arrow-wrapper">
<div class="mat-mdc-select-arrow">
<!-- Use an inline SVG, because it works better than a CSS triangle in high contrast mode. -->
<svg viewBox="0 0 24 24" width="24px" height="24px" focusable="false" aria-hidden="true">
<path d="M7 10l5 5 5-5z"/>
</svg>
</div>
</div>
</div>
<ng-template
cdk-connected-overlay
cdkConnectedOverlayLockPosition
cdkConnectedOverlayHasBackdrop
cdkConnectedOverlayBackdropClass="cdk-overlay-transparent-backdrop"
[cdkConnectedOverlayDisableClose]="true"
[cdkConnectedOverlayPanelClass]="_overlayPanelClass"
[cdkConnectedOverlayScrollStrategy]="_scrollStrategy"
[cdkConnectedOverlayOrigin]="_preferredOverlayOrigin || fallbackOverlayOrigin"
[cdkConnectedOverlayPositions]="_positions"
[cdkConnectedOverlayWidth]="_overlayWidth"
[cdkConnectedOverlayFlexibleDimensions]="true"
(detach)="close()"
(backdropClick)="close()"
(overlayKeydown)="_handleOverlayKeydown($event)">
<div
#panel
role="listbox"
tabindex="-1"
class="mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open {{ _getPanelTheme() }}"
[class.mat-select-panel-animations-enabled]="!_animationsDisabled"
[attr.id]="id + '-panel'"
[attr.aria-multiselectable]="multiple"
[attr.aria-label]="ariaLabel || null"
[attr.aria-labelledby]="_getPanelAriaLabelledby()"
[ngClass]="panelClass"
(keydown)="_handleKeydown($event)">
<ng-content></ng-content>
</div>
</ng-template>
`,
styles: ['@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}\n']
}]
}], () => [], {
options: [{
type: ContentChildren,
args: [MatOption, {
descendants: true
}]
}],
optionGroups: [{
type: ContentChildren,
args: [MAT_OPTGROUP, {
descendants: true
}]
}],
customTrigger: [{
type: ContentChild,
args: [MAT_SELECT_TRIGGER]
}],
userAriaDescribedBy: [{
type: Input,
args: ["aria-describedby"]
}],
trigger: [{
type: ViewChild,
args: ["trigger"]
}],
panel: [{
type: ViewChild,
args: ["panel"]
}],
_overlayDir: [{
type: ViewChild,
args: [CdkConnectedOverlay]
}],
panelClass: [{
type: Input
}],
disabled: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
disableRipple: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
tabIndex: [{
type: Input,
args: [{
transform: (value) => value == null ? 0 : numberAttribute(value)
}]
}],
hideSingleSelectionIndicator: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
placeholder: [{
type: Input
}],
required: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
multiple: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
disableOptionCentering: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
compareWith: [{
type: Input
}],
value: [{
type: Input
}],
ariaLabel: [{
type: Input,
args: ["aria-label"]
}],
ariaLabelledby: [{
type: Input,
args: ["aria-labelledby"]
}],
errorStateMatcher: [{
type: Input
}],
typeaheadDebounceInterval: [{
type: Input,
args: [{
transform: numberAttribute
}]
}],
sortComparator: [{
type: Input
}],
id: [{
type: Input
}],
panelWidth: [{
type: Input
}],
canSelectNullableOptions: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
openedChange: [{
type: Output
}],
_openedStream: [{
type: Output,
args: ["opened"]
}],
_closedStream: [{
type: Output,
args: ["closed"]
}],
selectionChange: [{
type: Output
}],
valueChange: [{
type: Output
}]
});
})();
var MatSelectTrigger = class _MatSelectTrigger {
static \u0275fac = function MatSelectTrigger_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatSelectTrigger)();
};
static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
type: _MatSelectTrigger,
selectors: [["mat-select-trigger"]],
features: [\u0275\u0275ProvidersFeature([{
provide: MAT_SELECT_TRIGGER,
useExisting: _MatSelectTrigger
}])]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatSelectTrigger, [{
type: Directive,
args: [{
selector: "mat-select-trigger",
providers: [{
provide: MAT_SELECT_TRIGGER,
useExisting: MatSelectTrigger
}]
}]
}], null, null);
})();
var MatSelectModule = class _MatSelectModule {
static \u0275fac = function MatSelectModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatSelectModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _MatSelectModule,
imports: [OverlayModule, MatOptionModule, MatCommonModule, MatSelect, MatSelectTrigger],
exports: [CdkScrollableModule, MatFormFieldModule, MatSelect, MatSelectTrigger, MatOptionModule, MatCommonModule]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
providers: [MAT_SELECT_SCROLL_STRATEGY_PROVIDER],
imports: [OverlayModule, MatOptionModule, MatCommonModule, CdkScrollableModule, MatFormFieldModule, MatOptionModule, MatCommonModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatSelectModule, [{
type: NgModule,
args: [{
imports: [OverlayModule, MatOptionModule, MatCommonModule, MatSelect, MatSelectTrigger],
exports: [CdkScrollableModule, MatFormFieldModule, MatSelect, MatSelectTrigger, MatOptionModule, MatCommonModule],
providers: [MAT_SELECT_SCROLL_STRATEGY_PROVIDER]
}]
}], null, null);
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/internal-form-field.mjs
var _c09 = ["mat-internal-form-field", ""];
var _c17 = ["*"];
var _MatInternalFormField = class __MatInternalFormField {
/** Position of the label relative to the content. */
labelPosition;
static \u0275fac = function _MatInternalFormField_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || __MatInternalFormField)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: __MatInternalFormField,
selectors: [["div", "mat-internal-form-field", ""]],
hostAttrs: [1, "mdc-form-field", "mat-internal-form-field"],
hostVars: 2,
hostBindings: function _MatInternalFormField_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275classProp("mdc-form-field--align-end", ctx.labelPosition === "before");
}
},
inputs: {
labelPosition: "labelPosition"
},
attrs: _c09,
ngContentSelectors: _c17,
decls: 1,
vars: 0,
template: function _MatInternalFormField_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275projectionDef();
\u0275\u0275projection(0);
}
},
styles: [".mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}\n"],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(_MatInternalFormField, [{
type: Component,
args: [{
selector: "div[mat-internal-form-field]",
template: "<ng-content></ng-content>",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
"class": "mdc-form-field mat-internal-form-field",
"[class.mdc-form-field--align-end]": 'labelPosition === "before"'
},
styles: [".mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}\n"]
}]
}], null, {
labelPosition: [{
type: Input,
args: [{
required: true
}]
}]
});
})();
// node_modules/.pnpm/@angular+material@20.2.0_@angular+cdk@20.2.0_@angular+common@20.2.1_@angular+core@20.2.1_@ang_awrsjmhxfn5unao7dg6glqdxaq/node_modules/@angular/material/fesm2022/slide-toggle.mjs
var _c010 = ["switch"];
var _c18 = ["*"];
function MatSlideToggle_Conditional_11_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "span", 11);
\u0275\u0275namespaceSVG();
\u0275\u0275elementStart(1, "svg", 13);
\u0275\u0275element(2, "path", 14);
\u0275\u0275elementEnd();
\u0275\u0275elementStart(3, "svg", 15);
\u0275\u0275element(4, "path", 16);
\u0275\u0275elementEnd()();
}
}
var MAT_SLIDE_TOGGLE_DEFAULT_OPTIONS = new InjectionToken("mat-slide-toggle-default-options", {
providedIn: "root",
factory: () => ({
disableToggleValue: false,
hideIcon: false,
disabledInteractive: false
})
});
var MatSlideToggleChange = class {
source;
checked;
constructor(source, checked) {
this.source = source;
this.checked = checked;
}
};
var MatSlideToggle = class _MatSlideToggle {
_elementRef = inject2(ElementRef);
_focusMonitor = inject2(FocusMonitor);
_changeDetectorRef = inject2(ChangeDetectorRef);
defaults = inject2(MAT_SLIDE_TOGGLE_DEFAULT_OPTIONS);
_onChange = (_) => {
};
_onTouched = () => {
};
_validatorOnChange = () => {
};
_uniqueId;
_checked = false;
_createChangeEvent(isChecked) {
return new MatSlideToggleChange(this, isChecked);
}
/** Unique ID for the label element. */
_labelId;
/** Returns the unique id for the visual hidden button. */
get buttonId() {
return `${this.id || this._uniqueId}-button`;
}
/** Reference to the MDC switch element. */
_switchElement;
/** Focuses the slide-toggle. */
focus() {
this._switchElement.nativeElement.focus();
}
/** Whether noop animations are enabled. */
_noopAnimations = _animationsDisabled();
/** Whether the slide toggle is currently focused. */
_focused;
/** Name value will be applied to the input element if present. */
name = null;
/** A unique id for the slide-toggle input. If none is supplied, it will be auto-generated. */
id;
/** Whether the label should appear after or before the slide-toggle. Defaults to 'after'. */
labelPosition = "after";
/** Used to set the aria-label attribute on the underlying input element. */
ariaLabel = null;
/** Used to set the aria-labelledby attribute on the underlying input element. */
ariaLabelledby = null;
/** Used to set the aria-describedby attribute on the underlying input element. */
ariaDescribedby;
/** Whether the slide-toggle is required. */
required;
// TODO(crisbeto): this should be a ThemePalette, but some internal apps were abusing
// the lack of type checking previously and assigning random strings.
/**
* Theme color of the slide toggle. This API is supported in M2 themes only,
* it has no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/slide-toggle/styling.
*
* For information on applying color variants in M3, see
* https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants
*/
color;
/** Whether the slide toggle is disabled. */
disabled = false;
/** Whether the slide toggle has a ripple. */
disableRipple = false;
/** Tabindex of slide toggle. */
tabIndex = 0;
/** Whether the slide-toggle element is checked or not. */
get checked() {
return this._checked;
}
set checked(value) {
this._checked = value;
this._changeDetectorRef.markForCheck();
}
/** Whether to hide the icon inside of the slide toggle. */
hideIcon;
/** Whether the slide toggle should remain interactive when it is disabled. */
disabledInteractive;
/** An event will be dispatched each time the slide-toggle changes its value. */
change = new EventEmitter();
/**
* An event will be dispatched each time the slide-toggle input is toggled.
* This event is always emitted when the user toggles the slide toggle, but this does not mean
* the slide toggle's value has changed.
*/
toggleChange = new EventEmitter();
/** Returns the unique id for the visual hidden input. */
get inputId() {
return `${this.id || this._uniqueId}-input`;
}
constructor() {
inject2(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);
const tabIndex = inject2(new HostAttributeToken("tabindex"), {
optional: true
});
const defaults2 = this.defaults;
this.tabIndex = tabIndex == null ? 0 : parseInt(tabIndex) || 0;
this.color = defaults2.color || "accent";
this.id = this._uniqueId = inject2(_IdGenerator).getId("mat-mdc-slide-toggle-");
this.hideIcon = defaults2.hideIcon ?? false;
this.disabledInteractive = defaults2.disabledInteractive ?? false;
this._labelId = this._uniqueId + "-label";
}
ngAfterContentInit() {
this._focusMonitor.monitor(this._elementRef, true).subscribe((focusOrigin) => {
if (focusOrigin === "keyboard" || focusOrigin === "program") {
this._focused = true;
this._changeDetectorRef.markForCheck();
} else if (!focusOrigin) {
Promise.resolve().then(() => {
this._focused = false;
this._onTouched();
this._changeDetectorRef.markForCheck();
});
}
});
}
ngOnChanges(changes) {
if (changes["required"]) {
this._validatorOnChange();
}
}
ngOnDestroy() {
this._focusMonitor.stopMonitoring(this._elementRef);
}
/** Implemented as part of ControlValueAccessor. */
writeValue(value) {
this.checked = !!value;
}
/** Implemented as part of ControlValueAccessor. */
registerOnChange(fn) {
this._onChange = fn;
}
/** Implemented as part of ControlValueAccessor. */
registerOnTouched(fn) {
this._onTouched = fn;
}
/** Implemented as a part of Validator. */
validate(control) {
return this.required && control.value !== true ? {
"required": true
} : null;
}
/** Implemented as a part of Validator. */
registerOnValidatorChange(fn) {
this._validatorOnChange = fn;
}
/** Implemented as a part of ControlValueAccessor. */
setDisabledState(isDisabled) {
this.disabled = isDisabled;
this._changeDetectorRef.markForCheck();
}
/** Toggles the checked state of the slide-toggle. */
toggle() {
this.checked = !this.checked;
this._onChange(this.checked);
}
/**
* Emits a change event on the `change` output. Also notifies the FormControl about the change.
*/
_emitChangeEvent() {
this._onChange(this.checked);
this.change.emit(this._createChangeEvent(this.checked));
}
/** Method being called whenever the underlying button is clicked. */
_handleClick() {
if (!this.disabled) {
this.toggleChange.emit();
if (!this.defaults.disableToggleValue) {
this.checked = !this.checked;
this._onChange(this.checked);
this.change.emit(new MatSlideToggleChange(this, this.checked));
}
}
}
_getAriaLabelledBy() {
if (this.ariaLabelledby) {
return this.ariaLabelledby;
}
return this.ariaLabel ? null : this._labelId;
}
static \u0275fac = function MatSlideToggle_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatSlideToggle)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
type: _MatSlideToggle,
selectors: [["mat-slide-toggle"]],
viewQuery: function MatSlideToggle_Query(rf, ctx) {
if (rf & 1) {
\u0275\u0275viewQuery(_c010, 5);
}
if (rf & 2) {
let _t;
\u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._switchElement = _t.first);
}
},
hostAttrs: [1, "mat-mdc-slide-toggle"],
hostVars: 13,
hostBindings: function MatSlideToggle_HostBindings(rf, ctx) {
if (rf & 2) {
\u0275\u0275domProperty("id", ctx.id);
\u0275\u0275attribute("tabindex", null)("aria-label", null)("name", null)("aria-labelledby", null);
\u0275\u0275classMap(ctx.color ? "mat-" + ctx.color : "");
\u0275\u0275classProp("mat-mdc-slide-toggle-focused", ctx._focused)("mat-mdc-slide-toggle-checked", ctx.checked)("_mat-animation-noopable", ctx._noopAnimations);
}
},
inputs: {
name: "name",
id: "id",
labelPosition: "labelPosition",
ariaLabel: [0, "aria-label", "ariaLabel"],
ariaLabelledby: [0, "aria-labelledby", "ariaLabelledby"],
ariaDescribedby: [0, "aria-describedby", "ariaDescribedby"],
required: [2, "required", "required", booleanAttribute],
color: "color",
disabled: [2, "disabled", "disabled", booleanAttribute],
disableRipple: [2, "disableRipple", "disableRipple", booleanAttribute],
tabIndex: [2, "tabIndex", "tabIndex", (value) => value == null ? 0 : numberAttribute(value)],
checked: [2, "checked", "checked", booleanAttribute],
hideIcon: [2, "hideIcon", "hideIcon", booleanAttribute],
disabledInteractive: [2, "disabledInteractive", "disabledInteractive", booleanAttribute]
},
outputs: {
change: "change",
toggleChange: "toggleChange"
},
exportAs: ["matSlideToggle"],
features: [\u0275\u0275ProvidersFeature([{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => _MatSlideToggle),
multi: true
}, {
provide: NG_VALIDATORS,
useExisting: _MatSlideToggle,
multi: true
}]), \u0275\u0275NgOnChangesFeature],
ngContentSelectors: _c18,
decls: 14,
vars: 27,
consts: [["switch", ""], ["mat-internal-form-field", "", 3, "labelPosition"], ["role", "switch", "type", "button", 1, "mdc-switch", 3, "click", "tabIndex", "disabled"], [1, "mat-mdc-slide-toggle-touch-target"], [1, "mdc-switch__track"], [1, "mdc-switch__handle-track"], [1, "mdc-switch__handle"], [1, "mdc-switch__shadow"], [1, "mdc-elevation-overlay"], [1, "mdc-switch__ripple"], ["mat-ripple", "", 1, "mat-mdc-slide-toggle-ripple", "mat-focus-indicator", 3, "matRippleTrigger", "matRippleDisabled", "matRippleCentered"], [1, "mdc-switch__icons"], [1, "mdc-label", 3, "click", "for"], ["viewBox", "0 0 24 24", "aria-hidden", "true", 1, "mdc-switch__icon", "mdc-switch__icon--on"], ["d", "M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"], ["viewBox", "0 0 24 24", "aria-hidden", "true", 1, "mdc-switch__icon", "mdc-switch__icon--off"], ["d", "M20 13H4v-2h16v2z"]],
template: function MatSlideToggle_Template(rf, ctx) {
if (rf & 1) {
const _r1 = \u0275\u0275getCurrentView();
\u0275\u0275projectionDef();
\u0275\u0275elementStart(0, "div", 1)(1, "button", 2, 0);
\u0275\u0275listener("click", function MatSlideToggle_Template_button_click_1_listener() {
\u0275\u0275restoreView(_r1);
return \u0275\u0275resetView(ctx._handleClick());
});
\u0275\u0275element(3, "div", 3)(4, "span", 4);
\u0275\u0275elementStart(5, "span", 5)(6, "span", 6)(7, "span", 7);
\u0275\u0275element(8, "span", 8);
\u0275\u0275elementEnd();
\u0275\u0275elementStart(9, "span", 9);
\u0275\u0275element(10, "span", 10);
\u0275\u0275elementEnd();
\u0275\u0275conditionalCreate(11, MatSlideToggle_Conditional_11_Template, 5, 0, "span", 11);
\u0275\u0275elementEnd()()();
\u0275\u0275elementStart(12, "label", 12);
\u0275\u0275listener("click", function MatSlideToggle_Template_label_click_12_listener($event) {
\u0275\u0275restoreView(_r1);
return \u0275\u0275resetView($event.stopPropagation());
});
\u0275\u0275projection(13);
\u0275\u0275elementEnd()();
}
if (rf & 2) {
const switch_r2 = \u0275\u0275reference(2);
\u0275\u0275property("labelPosition", ctx.labelPosition);
\u0275\u0275advance();
\u0275\u0275classProp("mdc-switch--selected", ctx.checked)("mdc-switch--unselected", !ctx.checked)("mdc-switch--checked", ctx.checked)("mdc-switch--disabled", ctx.disabled)("mat-mdc-slide-toggle-disabled-interactive", ctx.disabledInteractive);
\u0275\u0275property("tabIndex", ctx.disabled && !ctx.disabledInteractive ? -1 : ctx.tabIndex)("disabled", ctx.disabled && !ctx.disabledInteractive);
\u0275\u0275attribute("id", ctx.buttonId)("name", ctx.name)("aria-label", ctx.ariaLabel)("aria-labelledby", ctx._getAriaLabelledBy())("aria-describedby", ctx.ariaDescribedby)("aria-required", ctx.required || null)("aria-checked", ctx.checked)("aria-disabled", ctx.disabled && ctx.disabledInteractive ? "true" : null);
\u0275\u0275advance(9);
\u0275\u0275property("matRippleTrigger", switch_r2)("matRippleDisabled", ctx.disableRipple || ctx.disabled)("matRippleCentered", true);
\u0275\u0275advance();
\u0275\u0275conditional(!ctx.hideIcon ? 11 : -1);
\u0275\u0275advance();
\u0275\u0275property("for", ctx.buttonId);
\u0275\u0275attribute("id", ctx._labelId);
}
},
dependencies: [MatRipple, _MatInternalFormField],
styles: ['.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mat-slide-toggle-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mat-slide-toggle-track-height, 32px);border-radius:var(--mat-slide-toggle-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mat-slide-toggle-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-slide-toggle-track-outline-width, 2px);border-color:var(--mat-slide-toggle-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-slide-toggle-selected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-slide-toggle-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mat-slide-toggle-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mat-slide-toggle-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mat-slide-toggle-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mat-slide-toggle-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mat-slide-toggle-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mat-slide-toggle-handle-width);height:var(--mat-slide-toggle-handle-height);border-radius:var(--mat-slide-toggle-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-slide-toggle-unselected-handle-size, 16px);height:var(--mat-slide-toggle-unselected-handle-size, 16px);margin:var(--mat-slide-toggle-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-slide-toggle-selected-handle-size, 24px);height:var(--mat-slide-toggle-selected-handle-size, 24px);margin:var(--mat-slide-toggle-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-slide-toggle-with-icon-handle-size, 24px);height:var(--mat-slide-toggle-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-slide-toggle-pressed-handle-size, 28px);height:var(--mat-slide-toggle-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mat-slide-toggle-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mat-slide-toggle-state-layer-size, 40px);height:var(--mat-slide-toggle-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-hover-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-focus-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-hover-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-focus-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1;transform:translateZ(0)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mat-slide-toggle-unselected-icon-size, 16px);height:var(--mat-slide-toggle-unselected-icon-size, 16px);fill:var(--mat-slide-toggle-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mat-slide-toggle-selected-icon-size, 16px);height:var(--mat-slide-toggle-selected-icon-size, 16px);fill:var(--mat-slide-toggle-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-slide-toggle-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-slide-toggle-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-slide-toggle-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-slide-toggle-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-slide-toggle-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-slide-toggle-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mat-slide-toggle-disabled-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-slide-toggle-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-slide-toggle-touch-target-size, 48px);width:100%;transform:translate(-50%, -50%);display:var(--mat-slide-toggle-touch-target-display, block)}[dir=rtl] .mat-mdc-slide-toggle-touch-target{left:auto;right:50%;transform:translate(50%, -50%)}\n'],
encapsulation: 2,
changeDetection: 0
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatSlideToggle, [{
type: Component,
args: [{
selector: "mat-slide-toggle",
host: {
"class": "mat-mdc-slide-toggle",
"[id]": "id",
// Needs to be removed since it causes some a11y issues (see #21266).
"[attr.tabindex]": "null",
"[attr.aria-label]": "null",
"[attr.name]": "null",
"[attr.aria-labelledby]": "null",
"[class.mat-mdc-slide-toggle-focused]": "_focused",
"[class.mat-mdc-slide-toggle-checked]": "checked",
"[class._mat-animation-noopable]": "_noopAnimations",
"[class]": 'color ? "mat-" + color : ""'
},
exportAs: "matSlideToggle",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => MatSlideToggle),
multi: true
}, {
provide: NG_VALIDATORS,
useExisting: MatSlideToggle,
multi: true
}],
imports: [MatRipple, _MatInternalFormField],
template: `<div mat-internal-form-field [labelPosition]="labelPosition">
<button
class="mdc-switch"
role="switch"
type="button"
[class.mdc-switch--selected]="checked"
[class.mdc-switch--unselected]="!checked"
[class.mdc-switch--checked]="checked"
[class.mdc-switch--disabled]="disabled"
[class.mat-mdc-slide-toggle-disabled-interactive]="disabledInteractive"
[tabIndex]="disabled && !disabledInteractive ? -1 : tabIndex"
[disabled]="disabled && !disabledInteractive"
[attr.id]="buttonId"
[attr.name]="name"
[attr.aria-label]="ariaLabel"
[attr.aria-labelledby]="_getAriaLabelledBy()"
[attr.aria-describedby]="ariaDescribedby"
[attr.aria-required]="required || null"
[attr.aria-checked]="checked"
[attr.aria-disabled]="disabled && disabledInteractive ? 'true' : null"
(click)="_handleClick()"
#switch>
<div class="mat-mdc-slide-toggle-touch-target"></div>
<span class="mdc-switch__track"></span>
<span class="mdc-switch__handle-track">
<span class="mdc-switch__handle">
<span class="mdc-switch__shadow">
<span class="mdc-elevation-overlay"></span>
</span>
<span class="mdc-switch__ripple">
<span class="mat-mdc-slide-toggle-ripple mat-focus-indicator" mat-ripple
[matRippleTrigger]="switch"
[matRippleDisabled]="disableRipple || disabled"
[matRippleCentered]="true"></span>
</span>
@if (!hideIcon) {
<span class="mdc-switch__icons">
<svg
class="mdc-switch__icon mdc-switch__icon--on"
viewBox="0 0 24 24"
aria-hidden="true">
<path d="M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z" />
</svg>
<svg
class="mdc-switch__icon mdc-switch__icon--off"
viewBox="0 0 24 24"
aria-hidden="true">
<path d="M20 13H4v-2h16v2z" />
</svg>
</span>
}
</span>
</span>
</button>
<!--
Clicking on the label will trigger another click event from the button.
Stop propagation here so other listeners further up in the DOM don't execute twice.
-->
<label class="mdc-label" [for]="buttonId" [attr.id]="_labelId" (click)="$event.stopPropagation()">
<ng-content></ng-content>
</label>
</div>
`,
styles: ['.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mat-slide-toggle-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mat-slide-toggle-track-height, 32px);border-radius:var(--mat-slide-toggle-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mat-slide-toggle-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-slide-toggle-track-outline-width, 2px);border-color:var(--mat-slide-toggle-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-slide-toggle-selected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-slide-toggle-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mat-slide-toggle-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mat-slide-toggle-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mat-slide-toggle-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mat-slide-toggle-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mat-slide-toggle-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mat-slide-toggle-handle-width);height:var(--mat-slide-toggle-handle-height);border-radius:var(--mat-slide-toggle-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-slide-toggle-unselected-handle-size, 16px);height:var(--mat-slide-toggle-unselected-handle-size, 16px);margin:var(--mat-slide-toggle-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-slide-toggle-selected-handle-size, 24px);height:var(--mat-slide-toggle-selected-handle-size, 24px);margin:var(--mat-slide-toggle-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-slide-toggle-with-icon-handle-size, 24px);height:var(--mat-slide-toggle-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-slide-toggle-pressed-handle-size, 28px);height:var(--mat-slide-toggle-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mat-slide-toggle-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mat-slide-toggle-state-layer-size, 40px);height:var(--mat-slide-toggle-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-hover-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-focus-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-hover-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-focus-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1;transform:translateZ(0)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mat-slide-toggle-unselected-icon-size, 16px);height:var(--mat-slide-toggle-unselected-icon-size, 16px);fill:var(--mat-slide-toggle-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mat-slide-toggle-selected-icon-size, 16px);height:var(--mat-slide-toggle-selected-icon-size, 16px);fill:var(--mat-slide-toggle-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-slide-toggle-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-slide-toggle-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-slide-toggle-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-slide-toggle-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-slide-toggle-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-slide-toggle-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mat-slide-toggle-disabled-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-slide-toggle-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-slide-toggle-touch-target-size, 48px);width:100%;transform:translate(-50%, -50%);display:var(--mat-slide-toggle-touch-target-display, block)}[dir=rtl] .mat-mdc-slide-toggle-touch-target{left:auto;right:50%;transform:translate(50%, -50%)}\n']
}]
}], () => [], {
_switchElement: [{
type: ViewChild,
args: ["switch"]
}],
name: [{
type: Input
}],
id: [{
type: Input
}],
labelPosition: [{
type: Input
}],
ariaLabel: [{
type: Input,
args: ["aria-label"]
}],
ariaLabelledby: [{
type: Input,
args: ["aria-labelledby"]
}],
ariaDescribedby: [{
type: Input,
args: ["aria-describedby"]
}],
required: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
color: [{
type: Input
}],
disabled: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
disableRipple: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
tabIndex: [{
type: Input,
args: [{
transform: (value) => value == null ? 0 : numberAttribute(value)
}]
}],
checked: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
hideIcon: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
disabledInteractive: [{
type: Input,
args: [{
transform: booleanAttribute
}]
}],
change: [{
type: Output
}],
toggleChange: [{
type: Output
}]
});
})();
var MatSlideToggleModule = class _MatSlideToggleModule {
static \u0275fac = function MatSlideToggleModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MatSlideToggleModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _MatSlideToggleModule,
imports: [MatSlideToggle, MatCommonModule],
exports: [MatSlideToggle, MatCommonModule]
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
imports: [MatSlideToggle, MatCommonModule, MatCommonModule]
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatSlideToggleModule, [{
type: NgModule,
args: [{
imports: [MatSlideToggle, MatCommonModule],
exports: [MatSlideToggle, MatCommonModule]
}]
}], null, null);
})();
// node_modules/.pnpm/@ngx-pwa+local-storage@20.0.0_@angular+common@20.2.1_@angular+core@20.2.1_@angular+compiler@2_7cifzpi2rg3xtnrgsbwt423hlu/node_modules/@ngx-pwa/local-storage/fesm2022/ngx-pwa-local-storage.mjs
var IDB_BROKEN_ERROR = "indexedDB is not working";
var IDBBrokenError = class extends Error {
message = IDB_BROKEN_ERROR;
};
var SERIALIZATION_ERROR = `The storage is currently localStorage,
where data must be serialized, and the provided data can't be serialized.`;
var SerializationError = class extends Error {
message = SERIALIZATION_ERROR;
};
var LS_PREFIX = new InjectionToken("localStoragePrefix", {
providedIn: "root",
factory: () => ""
});
var DEFAULT_IDB_DB_NAME = "ngStorage";
var IDB_DB_NAME = new InjectionToken("localStorageIDBDBName", {
providedIn: "root",
factory: () => DEFAULT_IDB_DB_NAME
});
var DEFAULT_IDB_DB_VERSION = 1;
var IDB_DB_VERSION = new InjectionToken("localStorageIDBDBVersion", {
providedIn: "root",
factory: () => DEFAULT_IDB_DB_VERSION
});
var DEFAULT_IDB_STORE_NAME = "localStorage";
var IDB_STORE_NAME = new InjectionToken("localStorageIDBStoreName", {
providedIn: "root",
factory: () => DEFAULT_IDB_STORE_NAME
});
var DEFAULT_IDB_NO_WRAP = true;
var IDB_NO_WRAP = new InjectionToken("localStorageIDBWrap", {
providedIn: "root",
factory: () => DEFAULT_IDB_NO_WRAP
});
var StorageModule = class _StorageModule {
/**
* Only useful to provide options, otherwise it does nothing.
*
* **Must be used at initialization, ie. in `AppModule`, and must not be loaded again in another module.**
*/
static forRoot(config2) {
return {
ngModule: _StorageModule,
providers: [
// eslint-disable-next-line @typescript-eslint/no-deprecated
config2.LSPrefix !== void 0 ? {
provide: LS_PREFIX,
useValue: config2.LSPrefix
} : [],
// eslint-disable-next-line @typescript-eslint/no-deprecated
config2.IDBDBName !== void 0 ? {
provide: IDB_DB_NAME,
useValue: config2.IDBDBName
} : [],
// eslint-disable-next-line @typescript-eslint/no-deprecated
config2.IDBStoreName !== void 0 ? {
provide: IDB_STORE_NAME,
useValue: config2.IDBStoreName
} : [],
// eslint-disable-next-line @typescript-eslint/no-deprecated
config2.IDBDBVersion !== void 0 ? {
provide: IDB_DB_VERSION,
useValue: config2.IDBDBVersion
} : [],
config2.IDBNoWrap === false ? {
provide: IDB_NO_WRAP,
useValue: config2.IDBNoWrap
} : []
]
};
}
static \u0275fac = function StorageModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _StorageModule)();
};
static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
type: _StorageModule
});
static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(StorageModule, [{
type: NgModule
}], null, null);
})();
var VALIDATION_ERROR = `Data stored is not valid against the provided JSON schema.
Check your JSON schema, otherwise it means data has been corrupted.`;
var ValidationError = class extends Error {
message = VALIDATION_ERROR;
};
var LocalStorageDatabase = class _LocalStorageDatabase {
/**
* Optional user prefix to avoid collision for multiple apps on the same subdomain
*/
prefix;
constructor() {
this.prefix = inject2(LS_PREFIX);
}
/**
* Number of items in `localStorage`
*/
get size() {
return of(localStorage.length);
}
/**
* Gets an item value in `localStorage`
* @param key The item's key
* @returns The item's value if the key exists, `undefined` otherwise, wrapped in a RxJS `Observable`
*/
get(key) {
const unparsedData = localStorage.getItem(this.prefixKey(key));
if (unparsedData !== null) {
try {
const parsedData = JSON.parse(unparsedData);
return of(parsedData);
} catch (error) {
return throwError(() => error);
}
}
return of(void 0);
}
/**
* Store an item in `localStorage`
* @param key The item's key
* @param data The item's value
* @returns A RxJS `Observable` to wait the end of the operation
*/
set(key, data) {
let serializedData = null;
const dataPrototype = Object.getPrototypeOf(data);
if (typeof data === "object" && !Array.isArray(data) && !(dataPrototype === Object.prototype || dataPrototype === null)) {
return throwError(() => new SerializationError());
}
try {
serializedData = JSON.stringify(data);
if (serializedData === void 0) {
throw new Error();
}
} catch (error) {
return throwError(() => error);
}
try {
localStorage.setItem(this.prefixKey(key), serializedData);
} catch (error) {
return throwError(() => error);
}
return of(void 0);
}
/**
* Deletes an item in `localStorage`
* @param key The item's key
* @returns A RxJS `Observable` to wait the end of the operation
*/
delete(key) {
localStorage.removeItem(this.prefixKey(key));
return of(void 0);
}
/**
* Deletes all items in `localStorage`
* @returns A RxJS `Observable` to wait the end of the operation
*/
clear() {
localStorage.clear();
return of(void 0);
}
/**
* Get all keys in `localStorage`
* Note the order of the keys may be inconsistent in Firefox
* @returns A RxJS `Observable` iterating on keys
*/
keys() {
return new Observable((subscriber) => {
for (let index = 0; index < localStorage.length; index += 1) {
subscriber.next(this.getUnprefixedKey(index));
}
subscriber.complete();
}).pipe(
/* Required to work like other databases which are asynchronous */
observeOn(asyncScheduler)
);
}
/**
* Check if a key exists in `localStorage`
* @param key The item's key
* @returns A RxJS `Observable` telling if the key exists or not
*/
has(key) {
for (let index = 0; index < localStorage.length; index += 1) {
if (key === this.getUnprefixedKey(index)) {
return of(true);
}
}
return of(false);
}
/**
* Get an unprefixed key
* @param index Index of the key
* @returns The unprefixed key name if exists, `null` otherwise
*/
getUnprefixedKey(index) {
const prefixedKey = localStorage.key(index);
if (prefixedKey !== null) {
return this.prefix === "" ? prefixedKey : prefixedKey.substring(this.prefix.length);
}
return null;
}
/**
* Add the prefix to a key
* @param key The key name
* @returns The prefixed key name
*/
prefixKey(key) {
return `${this.prefix}${key}`;
}
static \u0275fac = function LocalStorageDatabase_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _LocalStorageDatabase)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _LocalStorageDatabase,
factory: _LocalStorageDatabase.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LocalStorageDatabase, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var MemoryDatabase = class _MemoryDatabase {
/**
* Memory storage
*/
memoryStorage = /* @__PURE__ */ new Map();
/**
* Number of items in memory
*/
get size() {
return of(this.memoryStorage.size);
}
/**
* Gets an item value in memory
* @param key The item's key
* @returns The item's value if the key exists, `undefined` otherwise, wrapped in a RxJS `Observable`
*/
get(key) {
return of(this.memoryStorage.get(key));
}
/**
* Sets an item in memory
* @param key The item's key
* @param data The item's value
* @returns A RxJS `Observable` to wait the end of the operation
*/
set(key, data) {
this.memoryStorage.set(key, data);
return of(void 0);
}
/**
* Deletes an item in memory
* @param key The item's key
* @returns A RxJS `Observable` to wait the end of the operation
*/
delete(key) {
this.memoryStorage.delete(key);
return of(void 0);
}
/**
* Deletes all items in memory
* @returns A RxJS `Observable` to wait the end of the operation
*/
clear() {
this.memoryStorage.clear();
return of(void 0);
}
/**
* Get all keys in memory
* @returns A RxJS `Observable` iterating on keys
*/
keys() {
return from(this.memoryStorage.keys());
}
/**
* Check if a key exists in memory
* @param key Key name
* @returns a RxJS `Observable` telling if the key exists or not
*/
has(key) {
return of(this.memoryStorage.has(key));
}
static \u0275fac = function MemoryDatabase_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _MemoryDatabase)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _MemoryDatabase,
factory: _MemoryDatabase.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MemoryDatabase, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], null, null);
})();
function localDatabaseFactory() {
const platformId = inject2(PLATFORM_ID);
try {
if (isPlatformBrowser(platformId) && indexedDB !== void 0 && indexedDB !== null && "open" in indexedDB) {
return new IndexedDBDatabase();
} else if (isPlatformBrowser(platformId) && localStorage !== void 0 && localStorage !== null && "getItem" in localStorage) {
return new LocalStorageDatabase();
}
} catch {
}
return new MemoryDatabase();
}
var LocalDatabase = class _LocalDatabase {
static \u0275fac = function LocalDatabase_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _LocalDatabase)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _LocalDatabase,
factory: () => localDatabaseFactory(),
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LocalDatabase, [{
type: Injectable,
args: [{
providedIn: "root",
useFactory: localDatabaseFactory
}]
}], null, null);
})();
var IndexedDBDatabase = class _IndexedDBDatabase {
/**
* `indexedDB` database name
*/
dbName;
/**
* `indexedDB` object store name
*/
storeName;
/**
* `indexedDB` database version. Must be an unsigned **integer**
*/
dbVersion;
/**
* `indexedDB` database connection, wrapped in a RxJS `ReplaySubject` to be able to access the connection
* even after the connection success event happened
*/
database = new ReplaySubject(1);
/**
* Flag to not wrap `indexedDB` values for interoperability or to wrap for backward compatibility.
*/
noWrap;
/**
* Index used when wrapping value. *For backward compatibility only.*
*/
wrapIndex = "value";
constructor() {
this.dbName = inject2(IDB_DB_NAME);
this.storeName = inject2(IDB_STORE_NAME);
this.dbVersion = inject2(IDB_DB_VERSION);
this.noWrap = inject2(IDB_NO_WRAP);
this.connect();
}
/**
* Information about `indexedDB` connection. *Only useful for interoperability.*
* @returns `indexedDB` database name, store name and database version
*/
get backingStore() {
return {
database: this.dbName,
store: this.storeName,
version: this.dbVersion
};
}
/**
* Number of items in our `indexedDB` database and object store
*/
get size() {
return this.transaction("readonly").pipe(
mergeMap((transactionData) => {
const {
store: store2,
events
} = transactionData;
const request = store2.count();
return events.pipe(map(() => request.result));
}),
/* The observable will complete after the first value */
first()
);
}
/**
* Gets an item value in our `indexedDB` store
* @param key The item's key
* @returns The item's value if the key exists, `undefined` otherwise, wrapped in an RxJS `Observable`
*/
get(key) {
return this.transaction("readonly").pipe(
mergeMap((transactionData) => {
const {
store: store2,
events
} = transactionData;
const request = store2.get(key);
return events.pipe(map(() => {
if (request.result !== void 0 && request.result !== null) {
if (!this.noWrap && typeof request.result === "object" && this.wrapIndex in request.result && // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Required by indexedDb behavior
request.result[this.wrapIndex] !== void 0 && request.result[this.wrapIndex] !== null) {
return request.result[this.wrapIndex];
} else {
return request.result;
}
}
return void 0;
}));
}),
/* The observable will complete after the first value */
first()
);
}
/**
* Sets an item in our `indexedDB` store
* @param key The item's key
* @param data The item's value
* @returns An RxJS `Observable` to wait the end of the operation
*/
set(key, data) {
if (data === void 0) {
return this.delete(key);
}
return this.transaction("readwrite").pipe(
mergeMap((transactionData) => {
const {
store: store2,
events
} = transactionData;
const dataToStore = this.noWrap ? data : {
[this.wrapIndex]: data
};
store2.put(dataToStore, key);
return events.pipe(map(() => void 0));
}),
/* The observable will complete after the first value */
first()
);
}
/**
* Deletes an item in our `indexedDB` store
* @param key The item's key
* @returns An RxJS `Observable` to wait the end of the operation
*/
delete(key) {
return this.transaction("readwrite").pipe(
mergeMap((transactionData) => {
const {
store: store2,
events
} = transactionData;
store2.delete(key);
return events.pipe(map(() => void 0));
}),
/* The observable will complete after the first value */
first()
);
}
/**
* Deletes all items from our `indexedDB` objet store
* @returns An RxJS `Observable` to wait the end of the operation
*/
clear() {
return this.transaction("readwrite").pipe(
mergeMap((transactionData) => {
const {
store: store2,
events
} = transactionData;
store2.clear();
return events.pipe(map(() => void 0));
}),
/* The observable will complete */
first()
);
}
/**
* Get all the keys in our `indexedDB` store
* @returns An RxJS `Observable` iterating on each key
*/
keys() {
return this.transaction("readonly").pipe(
/* `first()` is used as the final operator in other methods to complete the `Observable`
* (as it all starts from a `ReplaySubject` which never ends),
* but as this method is iterating over multiple values, `first()` **must** be used here */
first(),
mergeMap((transactionData) => {
const {
store: store2
} = transactionData;
const request = store2.openKeyCursor();
const success$ = fromEvent(request, "success").pipe(
/* Stop the `Observable` when the cursor is `null` */
// // eslint-disable-next-line rxjs/no-ignored-takewhile-value -- Required by indexedDb behavior, getting the result from the event does not always work
takeWhile(() => request.result !== null),
/* This lib only allows string keys, but user could have added other types of keys from outside
* It's OK to cast as the cursor as been tested in the previous operator */
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-base-to-string -- Required by indexedDb behavior, and strings are enforced by the lib
map(() => request.result.key.toString()),
/* Iterate on the cursor */
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- Required by indexedDb behavior
tap(() => {
request.result.continue();
})
);
const error$ = this.listenError(request);
return race([success$, error$]);
})
);
}
/**
* Check if a key exists in our `indexedDB` store
* @returns An RxJS `Observable` telling if the key exists or not
*/
has(key) {
return this.transaction("readonly").pipe(
mergeMap((transactionData) => {
const {
store: store2,
events
} = transactionData;
const request = store2.getKey(key);
return events.pipe(map(() => request.result !== void 0 ? true : false));
}),
/* The observable will complete */
first()
);
}
/**
* Connects to `indexedDB` and creates the object store on first time
*/
connect() {
let request;
try {
request = indexedDB.open(this.dbName, this.dbVersion);
} catch {
this.database.error(new IDBBrokenError());
return;
}
this.createStore(request);
const success$ = fromEvent(request, "success");
const error$ = this.listenError(request);
race([success$, error$]).pipe(first()).subscribe({
next: () => {
this.database.next(request.result);
},
error: () => {
this.database.error(new IDBBrokenError());
}
});
}
/**
* Create store on first use of `indexedDB`
* @param request `indexedDB` database opening request
*/
createStore(request) {
fromEvent(request, "upgradeneeded").pipe(first()).subscribe({
next: () => {
if (!request.result.objectStoreNames.contains(this.storeName)) {
request.result.createObjectStore(this.storeName);
}
}
});
}
/**
* Open an `indexedDB` transaction and get our store
* @param mode `readonly` or `readwrite`
* @returns An `indexedDB` transaction store and events, wrapped in an RxJS `Observable`
*/
transaction(mode) {
return this.database.pipe(mergeMap((database) => {
let transaction;
try {
transaction = database.transaction([this.storeName], mode);
} catch (error) {
return throwError(() => error);
}
const store2 = transaction.objectStore(this.storeName);
const events = this.listenTransactionEvents(transaction);
return of({
store: store2,
events
});
}));
}
/**
* Listen errors on a transaction or request, and throw if trigerred
* @param transactionOrRequest `indexedDb` transaction or request to listen
* @returns An `Observable` listening to errors
*/
listenError(transactionOrRequest) {
return fromEvent(transactionOrRequest, "error").pipe(
/* Throw on error to be able to catch errors in RxJS way.
* Here `event.target` must be used, as `transactionOrRequest.error` will be `null`
* if we are on the request and the error is only triggered later by the transaction */
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
mergeMap((event) => throwError(() => event.target?.error))
);
}
/**
* Listen transaction `complete` and `error` events
* @param transaction Transaction to listen
* @returns An `Observable` listening to transaction `complete` and `error` events
*/
listenTransactionEvents(transaction) {
const complete$ = fromEvent(transaction, "complete");
const error$ = this.listenError(transaction);
return race([complete$, error$]);
}
static \u0275fac = function IndexedDBDatabase_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _IndexedDBDatabase)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _IndexedDBDatabase,
factory: _IndexedDBDatabase.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(IndexedDBDatabase, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [], null);
})();
var JSONValidator = class _JSONValidator {
/**
* Validate a JSON data against a Jsubset of the JSON Schema standard.
* Types are enforced to validate everything: each schema must
* @param data JSON data to validate
* @param schema Subset of JSON Schema. Must have a `type`.
* @returns If data is valid: `true`, if it is invalid: `false`
* @see {@link https://github.com/cyrilletuzi/angular-async-local-storage/blob/main/docs/VALIDATION.md}
*/
validate(data, schema) {
switch (schema.type) {
case "string":
return this.validateString(data, schema);
case "number":
case "integer":
return this.validateNumber(data, schema);
case "boolean":
return this.validateBoolean(data, schema);
case "array":
return this.validateArray(data, schema);
case "object":
return this.validateObject(data, schema);
}
}
/**
* Validate a string
* @param data Data to validate
* @param schema Schema describing the string
* @returns If data is valid: `true`, if it is invalid: `false`
*/
validateString(data, schema) {
if (typeof data !== "string") {
return false;
}
if (!this.validateConst(data, schema)) {
return false;
}
if (!this.validateEnum(data, schema)) {
return false;
}
if (schema.maxLength !== void 0 && data.length > schema.maxLength) {
return false;
}
if (schema.minLength !== void 0 && data.length < schema.minLength) {
return false;
}
if (schema.pattern !== void 0) {
try {
const regularExpression = new RegExp(schema.pattern);
if (!regularExpression.test(data)) {
return false;
}
} catch {
}
}
return true;
}
/**
* Validate a number or an integer
* @param data Data to validate
* @param schema Schema describing the number or integer
* @returns If data is valid: `true`, if it is invalid: `false`
*/
validateNumber(data, schema) {
if (typeof data !== "number") {
return false;
}
if (schema.type === "integer" && !Number.isInteger(data)) {
return false;
}
if (!this.validateConst(data, schema)) {
return false;
}
if (!this.validateEnum(data, schema)) {
return false;
}
if (schema.multipleOf !== void 0 && schema.multipleOf !== 0 && Number.isFinite(schema.multipleOf) && !Number.isInteger(data / schema.multipleOf)) {
return false;
}
if (schema.maximum !== void 0 && data > schema.maximum) {
return false;
}
if (schema.exclusiveMaximum !== void 0 && data >= schema.exclusiveMaximum) {
return false;
}
if (schema.minimum !== void 0 && data < schema.minimum) {
return false;
}
if (schema.exclusiveMinimum !== void 0 && data <= schema.exclusiveMinimum) {
return false;
}
return true;
}
/**
* Validate a boolean
* @param data Data to validate
* @param schema Schema describing the boolean
* @returns If data is valid: `true`, if it is invalid: `false`
*/
validateBoolean(data, schema) {
if (typeof data !== "boolean") {
return false;
}
if (!this.validateConst(data, schema)) {
return false;
}
return true;
}
/**
* Validate an array
* @param data Data to validate
* @param schema Schema describing the array
* @returns If data is valid: `true`, if it is invalid: `false`
*/
validateArray(data, schema) {
if (!Array.isArray(data)) {
return false;
}
if (schema.maxItems !== void 0 && data.length > schema.maxItems) {
return false;
}
if (schema.minItems !== void 0 && data.length < schema.minItems) {
return false;
}
if (schema.uniqueItems === true) {
const dataSet = new Set(data);
if (data.length !== dataSet.size) {
return false;
}
}
if (Array.isArray(schema.items) || schema.items === void 0) {
return this.validateTuple(data, schema.items);
}
for (const value of data) {
if (!this.validate(value, schema.items)) {
return false;
}
}
return true;
}
/**
* Validate a tuple (array with fixed length and multiple types)
* @param data Data to validate
* @param schemas Schemas describing the tuple
* @returns If data is valid: `true`, if it is invalid: `false`
*/
validateTuple(data, schemas) {
const lengthToCheck = schemas ? schemas.length : 0;
if (data.length !== lengthToCheck) {
return false;
}
if (schemas) {
for (const [index, schema] of schemas.entries()) {
if (!this.validate(data[index], schema)) {
return false;
}
}
}
return true;
}
/**
* Validate an object
* @param data Data to validate
* @param schema JSON schema describing the object
* @returns If data is valid: `true`, if it is invalid: `false`
*/
validateObject(data, schema) {
if (typeof data !== "object" || data === null) {
return false;
}
if (Object.keys(schema.properties).length < Object.keys(data).length) {
return false;
}
if (schema.required) {
for (const requiredProp of schema.required) {
if (!Object.hasOwn(data, requiredProp)) {
return false;
}
}
}
for (const property in schema.properties) {
if (Object.hasOwn(schema.properties, property) && Object.hasOwn(data, property)) {
if (!this.validate(data[property], schema.properties[property])) {
return false;
}
}
}
return true;
}
/**
* Validate a constant
* @param data Data ta validate
* @param schema JSON schema describing the constant
* @returns If data is valid: `true`, if it is invalid: `false`
*/
validateConst(data, schema) {
if (schema.const === void 0) {
return true;
}
return data === schema.const;
}
/**
* Validate an enum
* @param data Data ta validate
* @param schema JSON schema describing the enum
* @returns If data is valid: `true`, if it is invalid: `false`
*/
validateEnum(data, schema) {
if (!schema.enum) {
return true;
}
return schema.enum.includes(data);
}
static \u0275fac = function JSONValidator_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _JSONValidator)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _JSONValidator,
factory: _JSONValidator.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(JSONValidator, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], null, null);
})();
var StorageMap = class _StorageMap {
#database;
#jsonValidator;
#notifiers = /* @__PURE__ */ new Map();
/**
* Constructor params are provided by Angular (but can also be passed manually in tests)
* @param database Storage to use
*/
constructor(database) {
this.#database = database;
this.#jsonValidator = new JSONValidator();
}
/**
* **Number of items** in storage, wrapped in an Observable.
*
* Note you do *not* need to unsubscribe (it is a self-completing Observable).
*
* @example
* this.storageMap.size.subscribe((size) => {
* console.log(size);
* });
*/
get size() {
return this.#database.size.pipe(this.#catchIDBBroken(() => this.#database.size));
}
/**
* Tells you which storage engine is used.
*
* *Only useful for interoperability.*
*
* Note that due to some browsers issues in some special contexts
* (like Safari cross-origin iframes),
* **this information may be wrong at initialization,**
* as the storage could fallback from `indexedDB` to `localStorage`
* only after a first read or write operation.
* @returns Storage engine used
*
* @see {@link https://github.com/cyrilletuzi/angular-async-local-storage/blob/main/docs/INTEROPERABILITY.md}
*
* @example
* if (this.storageMap.backingEngine === 'indexedDB') {}
*/
get backingEngine() {
if (this.#database instanceof IndexedDBDatabase) {
return "indexedDB";
} else if (this.#database instanceof LocalStorageDatabase) {
return "localStorage";
} else if (this.#database instanceof MemoryDatabase) {
return "memory";
} else {
return "unknown";
}
}
/**
* Information about `indexedDB` database.
*
* *Only useful for interoperability.*
*
* @returns `indexedDB` database name, store name and database version.
* **Values will be empty if the storage is not `indexedDB`, so it should be used after an engine check**.
*
* @see {@link https://github.com/cyrilletuzi/angular-async-local-storage/blob/main/docs/INTEROPERABILITY.md}
*
* @example
* if (this.storageMap.backingEngine === 'indexedDB') {
* const { database, store, version } = this.storageMap.backingStore;
* }
*/
get backingStore() {
return this.#database instanceof IndexedDBDatabase ? this.#database.backingStore : {
database: "",
store: "",
version: 0
};
}
/**
* Information about `localStorage` fallback storage.
*
* *Only useful for interoperability.*
*
* @returns `localStorage` prefix.
* **Values will be empty if the storage is not `localStorage`, so it should be used after an engine check**.
*
* @see {@link https://github.com/cyrilletuzi/angular-async-local-storage/blob/main/docs/INTEROPERABILITY.md}
*
* @example
* if (this.storageMap.backingEngine === 'localStorage') {
* const { prefix } = this.storageMap.fallbackBackingStore;
* }
*/
get fallbackBackingStore() {
return this.#database instanceof LocalStorageDatabase ? {
prefix: this.#database.prefix
} : {
prefix: ""
};
}
get(key, schema) {
return this.#database.get(key).pipe(
/* Check if `indexedDb` is broken */
this.#catchIDBBroken(() => this.#database.get(key)),
mergeMap((data) => {
if (data === void 0 || data === null) {
return of(void 0);
} else if (schema) {
if (!this.#jsonValidator.validate(data, schema)) {
return throwError(() => new ValidationError());
}
return of(data);
}
return of(data);
})
);
}
/**
* Store an item in storage.
*
* Note that:
* * you *do* need to subscribe, even if you do not have something specific to do after writing in storage, otherwise nothing happens (because it is how RxJS Observables work),
* * but you do *not* need to unsubscribe (it is a self-completing Observable),
* * setting `null` or `undefined` will remove the item to avoid some browsers issues,
* * you should stick to serializable JSON data, meaning primitive types, arrays and literal objects. Date, Map, Set, Blob and other special structures can cause issues in some scenarios.
* @see {@link https://github.com/cyrilletuzi/angular-async-local-storage/blob/main/docs/SERIALIZATION.md}
*
* @param key The item's key
* @param data The item's value
* @param schema Optional JSON schema to validate the data
* @returns A RxJS Observable to wait the end of the operation
*
* @example
* this.storageMap.set('key', 'value').subscribe(() => {});
*/
set(key, data, schema) {
if (data === void 0 || data === null) {
return this.delete(key);
}
if (schema && !this.#jsonValidator.validate(data, schema)) {
return throwError(() => new ValidationError());
}
return this.#database.set(key, data).pipe(
/* Catch if `indexedDb` is broken */
this.#catchIDBBroken(() => this.#database.set(key, data)),
/* Notify watchers (must be last because it should only happen if the operation succeeds) */
tap(() => {
this.#notify(key, data);
})
);
}
/**
* Delete an item in storage.
*
* Note that:
* * you *do* need to subscribe, even if you do not have something specific to do after deleting, otherwise nothing happens (because it is how RxJS Observables work),
* * but you do *not* need to unsubscribe (it is a self-completing Observable).
*
* @param key The item's key
* @returns A RxJS Observable to wait the end of the operation
*
* @example
* this.storageMap.delete('key').subscribe(() => {});
*/
delete(key) {
return this.#database.delete(key).pipe(
/* Catch if `indexedDb` is broken */
this.#catchIDBBroken(() => this.#database.delete(key)),
/* Notify watchers (must be last because it should only happen if the operation succeeds) */
tap(() => {
this.#notify(key, void 0);
})
);
}
/**
* Delete all items in storage.
*
* Note that:
* * you *do* need to subscribe, even if you do not have something specific to do after clearing, otherwise nothing happens (because it is how RxJS Observables work),
* * but you do *not* need to unsubscribe (it is a self-completing Observable).
*
* @returns A RxJS Observable to wait the end of the operation
*
* @example
* this.storageMap.clear().subscribe(() => {});
*/
clear() {
return this.#database.clear().pipe(
/* Catch if `indexedDb` is broken */
this.#catchIDBBroken(() => this.#database.clear()),
/* Notify watchers (must be last because it should only happen if the operation succeeds) */
tap(() => {
for (const key of this.#notifiers.keys()) {
this.#notify(key, void 0);
}
})
);
}
/**
* Get all keys stored in storage.
*
* Note **this is an *iterating* Observable**:
* * if there is no key, the `next` callback will not be invoked,
* * if you need to wait the whole operation to end, be sure to act in the `complete` callback,
* as this Observable can emit several values and so will invoke the `next` callback several times,
* * you do *not* need to unsubscribe (it is a self-completing Observable).
*
* @returns A list of the keys wrapped in a RxJS Observable
*
* @example
* this.storageMap.keys().subscribe({
* next: (key) => { console.log(key); },
* complete: () => { console.log('Done'); },
* });
*/
keys() {
return this.#database.keys().pipe(this.#catchIDBBroken(() => this.#database.keys()));
}
/**
* Tells if a key exists in storage.
*
* Note you do *not* need to unsubscribe (it is a self-completing Observable).
*
* @returns A RxJS Observable telling if the key exists
*
* @example
* this.storageMap.has('key').subscribe((hasKey) => {
* if (hasKey) {}
* });
*/
has(key) {
return this.#database.has(key).pipe(this.#catchIDBBroken(() => this.#database.has(key)));
}
watch(key, schema) {
if (!this.#notifiers.has(key)) {
this.#notifiers.set(key, new ReplaySubject(1));
}
const notifier = this.#notifiers.get(key);
(schema ? this.get(key, schema) : this.get(key)).subscribe({
next: (result) => {
notifier.next(result);
},
error: (error) => {
notifier.error(error);
}
});
return schema ? (
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
notifier.asObservable()
) : notifier.asObservable();
}
/**
* Notify when a value changes
* @param key The item's key
* @param data The new value
*/
#notify(key, value) {
const notifier = this.#notifiers.get(key);
if (notifier) {
notifier.next(value);
}
}
/**
* RxJS operator to catch if `indexedDB` is broken
* @param operationCallback Callback with the operation to redo
*/
#catchIDBBroken(operationCallback) {
return catchError((error) => {
if (error !== void 0 && error !== null && typeof error === "object" && "message" in error && error.message === IDB_BROKEN_ERROR) {
try {
if ("getItem" in localStorage) {
this.#database = new LocalStorageDatabase();
} else {
this.#database = new MemoryDatabase();
}
} catch {
this.#database = new MemoryDatabase();
}
return operationCallback();
} else {
return throwError(() => error);
}
});
}
/**
* THIS METHOD IS FOR INTERNAL PURPOSE ONLY AND MUST NOT BE USED,
* IT CAN BE REMOVED AT ANY TIME AND MESSING WITH IT CAN CAUSE ISSUES
* @private
* @ignore
*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- Silence the not used error, it is used in tests
// @ts-ignore
\u0275internalGetDatabase() {
return this.#database;
}
static \u0275fac = function StorageMap_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _StorageMap)(\u0275\u0275inject(LocalDatabase));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _StorageMap,
factory: _StorageMap.\u0275fac,
providedIn: "root"
});
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(StorageMap, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [{
type: LocalDatabase
}], null);
})();
// src/app/common/model/enums.ts
var ProxyClient;
(function(ProxyClient2) {
ProxyClient2["Surge"] = "Surge";
ProxyClient2["Clash"] = "Clash";
})(ProxyClient || (ProxyClient = {}));
var SubProvider;
(function(SubProvider2) {
SubProvider2["BosLife"] = "Boslife";
})(SubProvider || (SubProvider = {}));
// src/app/common/model/policy.ts
var Policy = class _Policy {
name;
is_subscription;
option;
constructor(name, is_subscription, option) {
this.name = name;
this.is_subscription = is_subscription;
this.option = option;
}
static deserialize(policy3) {
return new _Policy(policy3.name, policy3.is_subscription, policy3.option);
}
clone() {
return new _Policy(this.name, this.is_subscription, this.option);
}
equals(other) {
if (!other)
return false;
return this.name === other.name && this.is_subscription === other.is_subscription && this.option === other.option;
}
serialize() {
return {
name: this.name,
is_subscription: this.is_subscription,
option: this.option
};
}
};
// src/app/common/model/convertor_url.ts
var ConvertorUrl = class _ConvertorUrl {
type;
server;
desc;
path;
query;
url;
constructor(type, server, desc, path, query) {
this.type = type;
this.server = server;
this.desc = desc;
this.path = path;
this.query = query;
if (server.length > 0) {
this.url = new URL(server);
}
const url = this.url;
if (url) {
if (!!path && path.length > 0 && !!query && query.length > 0) {
url.pathname = path;
url.search = query;
}
}
}
clone() {
return new _ConvertorUrl(this.type.clone(), this.server, this.desc, this.path, this.query);
}
equals(other) {
if (!other)
return false;
return this.type.equals(other.type) && this.server === other.server && this.desc === other.desc && this.path === other.path;
}
serialize() {
return {
type: this.type.serialize(),
server: this.server,
desc: this.desc,
path: this.path,
query: this.query
};
}
static deserialize(url) {
return new _ConvertorUrl(ConvertorUrlType.deserialize(url.type), url.server, url.desc, url.path, url.query);
}
static get RawUrl() {
return new _ConvertorUrl(new ConvertorUrlType("Raw"), "", "Raw URL", "", "");
}
static get RawProfileUrl() {
return new _ConvertorUrl(new ConvertorUrlType("RawProfile"), "", "Raw Profile URL", "", "");
}
static get ProfileUrl() {
return new _ConvertorUrl(new ConvertorUrlType("Profile"), "", "Profile URL", "", "");
}
static get SubLogsUrl() {
return new _ConvertorUrl(new ConvertorUrlType("Logs"), "", "Subscription Logs URL", "", "");
}
};
var ConvertorUrlType = class _ConvertorUrlType {
name;
policy;
constructor(name, policy3) {
this.name = name;
this.policy = policy3;
}
clone() {
return new _ConvertorUrlType(this.name, this.policy?.clone());
}
equals(other) {
if (!other)
return false;
return this.name === other?.name && (this.policy?.equals(other?.policy) ?? false);
}
serialize() {
return {
name: this.name,
policy: this.policy
};
}
static deserialize(type) {
if (typeof type === "string") {
return new _ConvertorUrlType(type);
} else {
const name = Object.keys(type)[0];
const policy3 = !!type[name] ? Policy.deserialize(type[name]) : void 0;
return new _ConvertorUrlType(name, policy3);
}
}
};
// src/app/common/model/url_result.ts
var UrlResult = class _UrlResult {
raw_url;
raw_profile_url;
profile_url;
sub_logs_url;
rule_providers_url;
constructor(raw_url, raw_profile_url, profile_url, sub_logs_url, rule_providers_url) {
this.raw_url = raw_url;
this.raw_profile_url = raw_profile_url;
this.profile_url = profile_url;
this.sub_logs_url = sub_logs_url;
this.rule_providers_url = rule_providers_url;
}
static empty() {
return new _UrlResult(ConvertorUrl.RawUrl, ConvertorUrl.RawProfileUrl, ConvertorUrl.ProfileUrl, ConvertorUrl.SubLogsUrl, []);
}
static deserialize(result) {
return new _UrlResult(ConvertorUrl.deserialize(result.raw_url), ConvertorUrl.deserialize(result.raw_profile_url), ConvertorUrl.deserialize(result.profile_url), ConvertorUrl.deserialize(result.sub_logs_url), result.rule_providers_url.map(ConvertorUrl.deserialize));
}
clone() {
return new _UrlResult(this.raw_url.clone(), this.raw_profile_url.clone(), this.profile_url.clone(), this.sub_logs_url.clone(), this.rule_providers_url.map((rp) => rp.clone()));
}
equals(other) {
if (!other)
return false;
return this.raw_url.equals(other.raw_url) && this.raw_profile_url.equals(other.raw_profile_url) && this.profile_url.equals(other.profile_url) && this.sub_logs_url.equals(other.sub_logs_url) && this.rule_providers_url.length === other.rule_providers_url.length && this.rule_providers_url.every((rp, index) => rp.equals(other.rule_providers_url[index]));
}
serialize() {
return {
raw_url: this.raw_url.serialize(),
raw_profile_url: this.raw_profile_url.serialize(),
profile_url: this.profile_url.serialize(),
sub_logs_url: this.sub_logs_url.serialize(),
rule_providers_url: this.rule_providers_url.map((rp) => rp.serialize())
};
}
};
// src/app/common/response/status.ts
var ApiStatus = class _ApiStatus {
code;
message;
constructor(code, message) {
this.code = code;
this.message = message;
}
static deserialize(json) {
return new _ApiStatus(json.code, json.message);
}
isOk() {
return this.code === 0;
}
isError() {
return this.code === -1;
}
};
// src/app/common/response/response.ts
var ApiResponse = class _ApiResponse {
status;
data;
constructor(status, data) {
this.status = status;
this.data = data;
}
static deserialize(json, ctor) {
return new _ApiResponse(ApiStatus.deserialize(json.status), ctor?.deserialize(json.data) ?? json.data);
}
};
// src/app/service/latency/latency-types.ts
var ResponseStatus;
(function(ResponseStatus2) {
ResponseStatus2["OK"] = "OK";
ResponseStatus2["TIMEOUT"] = "TIMEOUT";
ResponseStatus2["ERROR"] = "ERROR";
})(ResponseStatus || (ResponseStatus = {}));
// src/app/service/latency/latency-utils.ts
function toEpochMs(highResMs) {
return Math.round(performance.timeOrigin + highResMs);
}
function nowEpochMs() {
return toEpochMs(performance.now());
}
function nextFrame() {
return new Promise((resolve) => {
if (typeof requestAnimationFrame === "function") {
requestAnimationFrame(() => resolve());
} else {
setTimeout(() => resolve(), 0);
}
});
}
function addRtid(url, rtid, paramName) {
const u2 = typeof url === "string" ? new URL(url, location.href) : new URL(url.toString());
u2.searchParams.set(paramName, rtid);
return u2.toString();
}
function parseServerTimingHeader(value) {
if (!value)
return void 0;
const out = {};
for (const part of value.split(",")) {
const token = part.trim();
if (!token)
continue;
const name = token.split(";")[0]?.trim();
const durMatch = token.match(/dur=([\d.]+)/i);
if (name && durMatch) {
const n = Number(durMatch[1]);
if (Number.isFinite(n))
out[name] = n;
}
}
return Object.keys(out).length ? out : void 0;
}
function isAbortError(err) {
return !!(err && typeof err === "object" && err.name === "AbortError");
}
function getExactResourceTimingByName(url) {
const list = performance.getEntriesByName(url, "resource");
if (!Array.isArray(list) || list.length === 0)
return void 0;
const hit = list.find((e) => e.initiatorType === "fetch" || e.initiatorType === "xmlhttprequest");
return hit ?? list[0];
}
function buildPhases(e) {
const between = (a, b) => Number.isFinite(a) && Number.isFinite(b) && a > 0 && b > 0 ? Math.max(0, Math.round(b - a)) : 0;
const redirectMs = between(e.redirectStart, e.redirectEnd);
const dnsMs = between(e.domainLookupStart, e.domainLookupEnd);
const connectMs = between(e.connectStart, e.connectEnd);
const tlsMs = Number.isFinite(e.secureConnectionStart) && e.secureConnectionStart > 0 ? between(e.secureConnectionStart, e.connectEnd) : 0;
const requestMs = between(e.requestStart, e.responseStart);
const contentDownloadMs = between(e.responseStart, e.responseEnd);
return {
redirectMs: redirectMs || void 0,
dnsMs: dnsMs || void 0,
connectMs: connectMs || void 0,
tlsMs: tlsMs || void 0,
requestMs: requestMs || void 0,
ttfbMs: requestMs || void 0,
contentDownloadMs: contentDownloadMs || void 0,
transferSize: e.transferSize || void 0,
encodedBodySize: e.encodedBodySize || void 0,
decodedBodySize: e.decodedBodySize || void 0
};
}
// src/app/service/latency/latency-service.ts
var LatencyService = class _LatencyService {
/**
* 发起 JSON 请求并测量延迟,自动注入 rtid,用 Performance 覆盖自测
*/
async fetchWithLatency(input2, options = {}) {
const method = (options.method ?? "GET").toUpperCase();
const rtid = crypto.randomUUID();
const rtidParam = options.rtidParam ?? "rtid";
const url = addRtid(input2, rtid, rtidParam);
const ac = new AbortController();
const userSignal = options.signal;
if (userSignal?.aborted)
ac.abort();
else if (userSignal)
userSignal.addEventListener("abort", () => ac.abort(), { once: true });
let timeoutId;
if (typeof options.timeoutMs === "number" && options.timeoutMs > 0) {
timeoutId = window.setTimeout(() => ac.abort(), options.timeoutMs);
}
let startedAt = nowEpochMs();
let headersAt = startedAt;
let endedAt = startedAt;
let httpStatus = 0;
let httpOk = false;
let serverTiming;
let responseObj;
let status = ResponseStatus.ERROR;
let errorMessage;
try {
const resp = await fetch(url, __spreadProps(__spreadValues({}, options), {
signal: ac.signal
}));
headersAt = nowEpochMs();
httpStatus = resp.status;
httpOk = resp.ok;
serverTiming = parseServerTimingHeader(resp.headers.get("server-timing"));
const raw = await resp.json();
responseObj = ApiResponse.deserialize(raw);
endedAt = nowEpochMs();
let ttfbMs = Math.max(0, headersAt - startedAt);
let totalMs = Math.max(0, endedAt - startedAt);
await nextFrame();
const entry = getExactResourceTimingByName(url);
if (entry) {
const pStart = toEpochMs(entry.startTime);
const pHeaders = toEpochMs(entry.responseStart);
const pEnd = toEpochMs(entry.responseEnd);
startedAt = pStart;
headersAt = pHeaders;
endedAt = pEnd;
totalMs = Math.max(0, Math.round(entry.duration));
if (Number.isFinite(entry.requestStart) && Number.isFinite(entry.responseStart)) {
ttfbMs = Math.max(0, Math.round(entry.responseStart - entry.requestStart));
}
const phases = buildPhases(entry);
return {
url,
method,
status: ResponseStatus.OK,
httpStatus,
httpOk,
startedAt,
headersAt,
endedAt,
ttfbMs,
totalMs,
serverTiming,
phases,
response: responseObj,
rtid
};
}
status = ResponseStatus.OK;
return {
url,
method,
status,
httpStatus,
httpOk,
startedAt,
headersAt,
endedAt,
ttfbMs,
totalMs,
serverTiming,
response: responseObj,
rtid
};
} catch (err) {
endedAt = nowEpochMs();
if (isAbortError(err)) {
status = ResponseStatus.TIMEOUT;
errorMessage = "Request timed out or aborted";
} else {
status = ResponseStatus.ERROR;
errorMessage = err?.message ?? String(err);
}
try {
await nextFrame();
const entry = getExactResourceTimingByName(url);
if (entry) {
const pStart = toEpochMs(entry.startTime);
const pHeaders = toEpochMs(entry.responseStart);
const pEnd = toEpochMs(entry.responseEnd);
startedAt = pStart;
headersAt = Number.isFinite(entry.responseStart) ? pHeaders : startedAt;
endedAt = Number.isFinite(entry.responseEnd) ? pEnd : endedAt;
}
} catch {
}
const ttfbMs = Math.max(0, headersAt - startedAt);
const totalMs = Math.max(0, endedAt - startedAt);
return {
url,
method,
status,
httpStatus,
httpOk,
startedAt,
headersAt,
endedAt,
ttfbMs,
totalMs,
serverTiming,
response: responseObj,
errorMessage,
rtid
};
} finally {
if (timeoutId !== void 0) {
clearTimeout(timeoutId);
}
}
}
/**
* RxJS 封装:取消订阅(unsubscribe)将触发 fetch 的 Abort
*/
fetchWithLatency$(input2, options = {}) {
return new Observable((subscriber) => {
const ctrl = new AbortController();
const opts = __spreadProps(__spreadValues({}, options), { signal: ctrl.signal });
subscriber.add(() => {
try {
ctrl.abort();
} catch {
}
});
this.fetchWithLatency(input2, opts).then((res) => {
if (subscriber.closed)
return;
subscriber.next(res);
subscriber.complete();
}).catch((err) => {
if (subscriber.closed)
return;
subscriber.error(err);
});
});
}
static \u0275fac = function LatencyService_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _LatencyService)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _LatencyService, factory: _LatencyService.\u0275fac, providedIn: "root" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LatencyService, [{
type: Injectable,
args: [{ providedIn: "root" }]
}], null, null);
})();
// src/app/service/dashboard.service.ts
var DashboardService = class _DashboardService {
http;
latencyService;
static HEALTH_ENDPOINT = `/actuator/healthy`;
static REDIS_ENDPOINT = `/actuator/redis`;
constructor(http, latencyService) {
this.http = http;
this.latencyService = latencyService;
}
healthCheck() {
return this.http.get(_DashboardService.HEALTH_ENDPOINT).pipe(map((response) => ApiResponse.deserialize(response)));
}
async healthLatency() {
return await this.latencyService.fetchWithLatency(_DashboardService.HEALTH_ENDPOINT);
}
redisCheck() {
return this.http.get(_DashboardService.REDIS_ENDPOINT).pipe(map((response) => ApiResponse.deserialize(response)));
}
async redisLatency() {
return await this.latencyService.fetchWithLatency(_DashboardService.REDIS_ENDPOINT);
}
getSubscription(query) {
return this.http.get(query.subscriptionPath()).pipe(tap(console.log), map((response) => ApiResponse.deserialize(response, UrlResult)));
}
static \u0275fac = function DashboardService_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _DashboardService)(\u0275\u0275inject(HttpClient), \u0275\u0275inject(LatencyService));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _DashboardService, factory: _DashboardService.\u0275fac, providedIn: "root" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DashboardService, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [{ type: HttpClient }, { type: LatencyService }], null);
})();
// src/app/common/model/convertor_query.ts
var ConvertorQuery = class _ConvertorQuery {
client;
provider;
interval;
strict;
sub_url;
static API_SUBSCRIPTION = "api/subscription";
constructor(client, provider, interval, strict, sub_url) {
this.client = client;
this.provider = provider;
this.interval = interval;
this.strict = strict;
this.sub_url = sub_url;
}
subscriptionPath() {
return `/${_ConvertorQuery.API_SUBSCRIPTION}/${this}`;
}
toString() {
const params = new URLSearchParams();
params.set("interval", this.interval.toString());
params.set("strict", this.strict ? "true" : "false");
params.set("sub_url", this.sub_url);
return `${this.client}/${this.provider}?${params.toString()}`;
}
};
// node_modules/.pnpm/@noble+ciphers@2.0.0/node_modules/@noble/ciphers/utils.js
function isBytes(a) {
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
}
function abool(b) {
if (typeof b !== "boolean")
throw new Error(`boolean expected, not ${b}`);
}
function anumber(n) {
if (!Number.isSafeInteger(n) || n < 0)
throw new Error("positive integer expected, got " + n);
}
function abytes(value, length, title = "") {
const bytes = isBytes(value);
const len = value?.length;
const needsLen = length !== void 0;
if (!bytes || needsLen && len !== length) {
const prefix = title && `"${title}" `;
const ofLen = needsLen ? ` of length ${length}` : "";
const got = bytes ? `length=${len}` : `type=${typeof value}`;
throw new Error(prefix + "expected Uint8Array" + ofLen + ", got " + got);
}
return value;
}
function aexists(instance, checkFinished = true) {
if (instance.destroyed)
throw new Error("Hash instance has been destroyed");
if (checkFinished && instance.finished)
throw new Error("Hash#digest() has already been called");
}
function aoutput(out, instance) {
abytes(out, void 0, "output");
const min = instance.outputLen;
if (out.length < min) {
throw new Error("digestInto() expects output buffer of length at least " + min);
}
}
function u32(arr) {
return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
}
function clean(...arrays) {
for (let i = 0; i < arrays.length; i++) {
arrays[i].fill(0);
}
}
function createView(arr) {
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
}
var isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
function checkOpts(defaults2, opts) {
if (opts == null || typeof opts !== "object")
throw new Error("options must be defined");
const merged = Object.assign(defaults2, opts);
return merged;
}
function equalBytes(a, b) {
if (a.length !== b.length)
return false;
let diff = 0;
for (let i = 0; i < a.length; i++)
diff |= a[i] ^ b[i];
return diff === 0;
}
var wrapCipher = /* @__NO_SIDE_EFFECTS__ */ (params, constructor) => {
function wrappedCipher(key, ...args) {
abytes(key, void 0, "key");
if (!isLE)
throw new Error("Non little-endian hardware is not yet supported");
if (params.nonceLength !== void 0) {
const nonce = args[0];
abytes(nonce, params.varSizeNonce ? void 0 : params.nonceLength, "nonce");
}
const tagl = params.tagLength;
if (tagl && args[1] !== void 0)
abytes(args[1], void 0, "AAD");
const cipher = constructor(key, ...args);
const checkOutput = (fnLength, output) => {
if (output !== void 0) {
if (fnLength !== 2)
throw new Error("cipher output not supported");
abytes(output, void 0, "output");
}
};
let called = false;
const wrCipher = {
encrypt(data, output) {
if (called)
throw new Error("cannot encrypt() twice with same key + nonce");
called = true;
abytes(data);
checkOutput(cipher.encrypt.length, output);
return cipher.encrypt(data, output);
},
decrypt(data, output) {
abytes(data);
if (tagl && data.length < tagl)
throw new Error('"ciphertext" expected length bigger than tagLength=' + tagl);
checkOutput(cipher.decrypt.length, output);
return cipher.decrypt(data, output);
}
};
return wrCipher;
}
Object.assign(wrappedCipher, params);
return wrappedCipher;
};
function getOutput(expectedLength, out, onlyAligned = true) {
if (out === void 0)
return new Uint8Array(expectedLength);
if (out.length !== expectedLength)
throw new Error('"output" expected Uint8Array of length ' + expectedLength + ", got: " + out.length);
if (onlyAligned && !isAligned32(out))
throw new Error("invalid output, must be aligned");
return out;
}
function u64Lengths(dataLength, aadLength, isLE2) {
abool(isLE2);
const num = new Uint8Array(16);
const view = createView(num);
view.setBigUint64(0, BigInt(aadLength), isLE2);
view.setBigUint64(8, BigInt(dataLength), isLE2);
return num;
}
function isAligned32(bytes) {
return bytes.byteOffset % 4 === 0;
}
function copyBytes(bytes) {
return Uint8Array.from(bytes);
}
function randomBytes(bytesLength = 32) {
const cr = typeof globalThis === "object" ? globalThis.crypto : null;
if (typeof cr?.getRandomValues !== "function")
throw new Error("crypto.getRandomValues must be defined");
return cr.getRandomValues(new Uint8Array(bytesLength));
}
// node_modules/.pnpm/@noble+ciphers@2.0.0/node_modules/@noble/ciphers/_arx.js
var encodeStr = (str) => Uint8Array.from(str.split(""), (c) => c.charCodeAt(0));
var sigma16 = encodeStr("expand 16-byte k");
var sigma32 = encodeStr("expand 32-byte k");
var sigma16_32 = u32(sigma16);
var sigma32_32 = u32(sigma32);
function rotl(a, b) {
return a << b | a >>> 32 - b;
}
function isAligned322(b) {
return b.byteOffset % 4 === 0;
}
var BLOCK_LEN = 64;
var BLOCK_LEN32 = 16;
var MAX_COUNTER = 2 ** 32 - 1;
var U32_EMPTY = Uint32Array.of();
function runCipher(core, sigma, key, nonce, data, output, counter2, rounds) {
const len = data.length;
const block = new Uint8Array(BLOCK_LEN);
const b32 = u32(block);
const isAligned = isAligned322(data) && isAligned322(output);
const d32 = isAligned ? u32(data) : U32_EMPTY;
const o32 = isAligned ? u32(output) : U32_EMPTY;
for (let pos = 0; pos < len; counter2++) {
core(sigma, key, nonce, b32, counter2, rounds);
if (counter2 >= MAX_COUNTER)
throw new Error("arx: counter overflow");
const take2 = Math.min(BLOCK_LEN, len - pos);
if (isAligned && take2 === BLOCK_LEN) {
const pos32 = pos / 4;
if (pos % 4 !== 0)
throw new Error("arx: invalid block position");
for (let j = 0, posj; j < BLOCK_LEN32; j++) {
posj = pos32 + j;
o32[posj] = d32[posj] ^ b32[j];
}
pos += BLOCK_LEN;
continue;
}
for (let j = 0, posj; j < take2; j++) {
posj = pos + j;
output[posj] = data[posj] ^ block[j];
}
pos += take2;
}
}
function createCipher(core, opts) {
const { allowShortKeys, extendNonceFn, counterLength, counterRight, rounds } = checkOpts({ allowShortKeys: false, counterLength: 8, counterRight: false, rounds: 20 }, opts);
if (typeof core !== "function")
throw new Error("core must be a function");
anumber(counterLength);
anumber(rounds);
abool(counterRight);
abool(allowShortKeys);
return (key, nonce, data, output, counter2 = 0) => {
abytes(key, void 0, "key");
abytes(nonce, void 0, "nonce");
abytes(data, void 0, "data");
const len = data.length;
if (output === void 0)
output = new Uint8Array(len);
abytes(output, void 0, "output");
anumber(counter2);
if (counter2 < 0 || counter2 >= MAX_COUNTER)
throw new Error("arx: counter overflow");
if (output.length < len)
throw new Error(`arx: output (${output.length}) is shorter than data (${len})`);
const toClean = [];
let l = key.length;
let k;
let sigma;
if (l === 32) {
toClean.push(k = copyBytes(key));
sigma = sigma32_32;
} else if (l === 16 && allowShortKeys) {
k = new Uint8Array(32);
k.set(key);
k.set(key, 16);
sigma = sigma16_32;
toClean.push(k);
} else {
abytes(key, 32, "arx key");
throw new Error("invalid key size");
}
if (!isAligned322(nonce))
toClean.push(nonce = copyBytes(nonce));
const k32 = u32(k);
if (extendNonceFn) {
if (nonce.length !== 24)
throw new Error(`arx: extended nonce must be 24 bytes`);
extendNonceFn(sigma, k32, u32(nonce.subarray(0, 16)), k32);
nonce = nonce.subarray(16);
}
const nonceNcLen = 16 - counterLength;
if (nonceNcLen !== nonce.length)
throw new Error(`arx: nonce must be ${nonceNcLen} or 16 bytes`);
if (nonceNcLen !== 12) {
const nc = new Uint8Array(12);
nc.set(nonce, counterRight ? 0 : 12 - nonce.length);
nonce = nc;
toClean.push(nonce);
}
const n32 = u32(nonce);
runCipher(core, sigma, k32, n32, data, output, counter2, rounds);
clean(...toClean);
return output;
};
}
// node_modules/.pnpm/@noble+ciphers@2.0.0/node_modules/@noble/ciphers/_poly1305.js
function u8to16(a, i) {
return a[i++] & 255 | (a[i++] & 255) << 8;
}
var Poly1305 = class {
blockLen = 16;
outputLen = 16;
buffer = new Uint8Array(16);
r = new Uint16Array(10);
// Allocating 1 array with .subarray() here is slower than 3
h = new Uint16Array(10);
pad = new Uint16Array(8);
pos = 0;
finished = false;
// Can be speed-up using BigUint64Array, at the cost of complexity
constructor(key) {
key = copyBytes(abytes(key, 32, "key"));
const t0 = u8to16(key, 0);
const t1 = u8to16(key, 2);
const t2 = u8to16(key, 4);
const t3 = u8to16(key, 6);
const t4 = u8to16(key, 8);
const t5 = u8to16(key, 10);
const t6 = u8to16(key, 12);
const t7 = u8to16(key, 14);
this.r[0] = t0 & 8191;
this.r[1] = (t0 >>> 13 | t1 << 3) & 8191;
this.r[2] = (t1 >>> 10 | t2 << 6) & 7939;
this.r[3] = (t2 >>> 7 | t3 << 9) & 8191;
this.r[4] = (t3 >>> 4 | t4 << 12) & 255;
this.r[5] = t4 >>> 1 & 8190;
this.r[6] = (t4 >>> 14 | t5 << 2) & 8191;
this.r[7] = (t5 >>> 11 | t6 << 5) & 8065;
this.r[8] = (t6 >>> 8 | t7 << 8) & 8191;
this.r[9] = t7 >>> 5 & 127;
for (let i = 0; i < 8; i++)
this.pad[i] = u8to16(key, 16 + 2 * i);
}
process(data, offset, isLast = false) {
const hibit = isLast ? 0 : 1 << 11;
const { h, r } = this;
const r0 = r[0];
const r1 = r[1];
const r2 = r[2];
const r3 = r[3];
const r4 = r[4];
const r5 = r[5];
const r6 = r[6];
const r7 = r[7];
const r8 = r[8];
const r9 = r[9];
const t0 = u8to16(data, offset + 0);
const t1 = u8to16(data, offset + 2);
const t2 = u8to16(data, offset + 4);
const t3 = u8to16(data, offset + 6);
const t4 = u8to16(data, offset + 8);
const t5 = u8to16(data, offset + 10);
const t6 = u8to16(data, offset + 12);
const t7 = u8to16(data, offset + 14);
let h0 = h[0] + (t0 & 8191);
let h1 = h[1] + ((t0 >>> 13 | t1 << 3) & 8191);
let h2 = h[2] + ((t1 >>> 10 | t2 << 6) & 8191);
let h3 = h[3] + ((t2 >>> 7 | t3 << 9) & 8191);
let h4 = h[4] + ((t3 >>> 4 | t4 << 12) & 8191);
let h5 = h[5] + (t4 >>> 1 & 8191);
let h6 = h[6] + ((t4 >>> 14 | t5 << 2) & 8191);
let h7 = h[7] + ((t5 >>> 11 | t6 << 5) & 8191);
let h8 = h[8] + ((t6 >>> 8 | t7 << 8) & 8191);
let h9 = h[9] + (t7 >>> 5 | hibit);
let c = 0;
let d0 = c + h0 * r0 + h1 * (5 * r9) + h2 * (5 * r8) + h3 * (5 * r7) + h4 * (5 * r6);
c = d0 >>> 13;
d0 &= 8191;
d0 += h5 * (5 * r5) + h6 * (5 * r4) + h7 * (5 * r3) + h8 * (5 * r2) + h9 * (5 * r1);
c += d0 >>> 13;
d0 &= 8191;
let d1 = c + h0 * r1 + h1 * r0 + h2 * (5 * r9) + h3 * (5 * r8) + h4 * (5 * r7);
c = d1 >>> 13;
d1 &= 8191;
d1 += h5 * (5 * r6) + h6 * (5 * r5) + h7 * (5 * r4) + h8 * (5 * r3) + h9 * (5 * r2);
c += d1 >>> 13;
d1 &= 8191;
let d2 = c + h0 * r2 + h1 * r1 + h2 * r0 + h3 * (5 * r9) + h4 * (5 * r8);
c = d2 >>> 13;
d2 &= 8191;
d2 += h5 * (5 * r7) + h6 * (5 * r6) + h7 * (5 * r5) + h8 * (5 * r4) + h9 * (5 * r3);
c += d2 >>> 13;
d2 &= 8191;
let d3 = c + h0 * r3 + h1 * r2 + h2 * r1 + h3 * r0 + h4 * (5 * r9);
c = d3 >>> 13;
d3 &= 8191;
d3 += h5 * (5 * r8) + h6 * (5 * r7) + h7 * (5 * r6) + h8 * (5 * r5) + h9 * (5 * r4);
c += d3 >>> 13;
d3 &= 8191;
let d4 = c + h0 * r4 + h1 * r3 + h2 * r2 + h3 * r1 + h4 * r0;
c = d4 >>> 13;
d4 &= 8191;
d4 += h5 * (5 * r9) + h6 * (5 * r8) + h7 * (5 * r7) + h8 * (5 * r6) + h9 * (5 * r5);
c += d4 >>> 13;
d4 &= 8191;
let d5 = c + h0 * r5 + h1 * r4 + h2 * r3 + h3 * r2 + h4 * r1;
c = d5 >>> 13;
d5 &= 8191;
d5 += h5 * r0 + h6 * (5 * r9) + h7 * (5 * r8) + h8 * (5 * r7) + h9 * (5 * r6);
c += d5 >>> 13;
d5 &= 8191;
let d6 = c + h0 * r6 + h1 * r5 + h2 * r4 + h3 * r3 + h4 * r2;
c = d6 >>> 13;
d6 &= 8191;
d6 += h5 * r1 + h6 * r0 + h7 * (5 * r9) + h8 * (5 * r8) + h9 * (5 * r7);
c += d6 >>> 13;
d6 &= 8191;
let d7 = c + h0 * r7 + h1 * r6 + h2 * r5 + h3 * r4 + h4 * r3;
c = d7 >>> 13;
d7 &= 8191;
d7 += h5 * r2 + h6 * r1 + h7 * r0 + h8 * (5 * r9) + h9 * (5 * r8);
c += d7 >>> 13;
d7 &= 8191;
let d8 = c + h0 * r8 + h1 * r7 + h2 * r6 + h3 * r5 + h4 * r4;
c = d8 >>> 13;
d8 &= 8191;
d8 += h5 * r3 + h6 * r2 + h7 * r1 + h8 * r0 + h9 * (5 * r9);
c += d8 >>> 13;
d8 &= 8191;
let d9 = c + h0 * r9 + h1 * r8 + h2 * r7 + h3 * r6 + h4 * r5;
c = d9 >>> 13;
d9 &= 8191;
d9 += h5 * r4 + h6 * r3 + h7 * r2 + h8 * r1 + h9 * r0;
c += d9 >>> 13;
d9 &= 8191;
c = (c << 2) + c | 0;
c = c + d0 | 0;
d0 = c & 8191;
c = c >>> 13;
d1 += c;
h[0] = d0;
h[1] = d1;
h[2] = d2;
h[3] = d3;
h[4] = d4;
h[5] = d5;
h[6] = d6;
h[7] = d7;
h[8] = d8;
h[9] = d9;
}
finalize() {
const { h, pad } = this;
const g = new Uint16Array(10);
let c = h[1] >>> 13;
h[1] &= 8191;
for (let i = 2; i < 10; i++) {
h[i] += c;
c = h[i] >>> 13;
h[i] &= 8191;
}
h[0] += c * 5;
c = h[0] >>> 13;
h[0] &= 8191;
h[1] += c;
c = h[1] >>> 13;
h[1] &= 8191;
h[2] += c;
g[0] = h[0] + 5;
c = g[0] >>> 13;
g[0] &= 8191;
for (let i = 1; i < 10; i++) {
g[i] = h[i] + c;
c = g[i] >>> 13;
g[i] &= 8191;
}
g[9] -= 1 << 13;
let mask = (c ^ 1) - 1;
for (let i = 0; i < 10; i++)
g[i] &= mask;
mask = ~mask;
for (let i = 0; i < 10; i++)
h[i] = h[i] & mask | g[i];
h[0] = (h[0] | h[1] << 13) & 65535;
h[1] = (h[1] >>> 3 | h[2] << 10) & 65535;
h[2] = (h[2] >>> 6 | h[3] << 7) & 65535;
h[3] = (h[3] >>> 9 | h[4] << 4) & 65535;
h[4] = (h[4] >>> 12 | h[5] << 1 | h[6] << 14) & 65535;
h[5] = (h[6] >>> 2 | h[7] << 11) & 65535;
h[6] = (h[7] >>> 5 | h[8] << 8) & 65535;
h[7] = (h[8] >>> 8 | h[9] << 5) & 65535;
let f = h[0] + pad[0];
h[0] = f & 65535;
for (let i = 1; i < 8; i++) {
f = (h[i] + pad[i] | 0) + (f >>> 16) | 0;
h[i] = f & 65535;
}
clean(g);
}
update(data) {
aexists(this);
abytes(data);
data = copyBytes(data);
const { buffer, blockLen } = this;
const len = data.length;
for (let pos = 0; pos < len; ) {
const take2 = Math.min(blockLen - this.pos, len - pos);
if (take2 === blockLen) {
for (; blockLen <= len - pos; pos += blockLen)
this.process(data, pos);
continue;
}
buffer.set(data.subarray(pos, pos + take2), this.pos);
this.pos += take2;
pos += take2;
if (this.pos === blockLen) {
this.process(buffer, 0, false);
this.pos = 0;
}
}
return this;
}
destroy() {
clean(this.h, this.r, this.buffer, this.pad);
}
digestInto(out) {
aexists(this);
aoutput(out, this);
this.finished = true;
const { buffer, h } = this;
let { pos } = this;
if (pos) {
buffer[pos++] = 1;
for (; pos < 16; pos++)
buffer[pos] = 0;
this.process(buffer, 0, true);
}
this.finalize();
let opos = 0;
for (let i = 0; i < 8; i++) {
out[opos++] = h[i] >>> 0;
out[opos++] = h[i] >>> 8;
}
return out;
}
digest() {
const { buffer, outputLen } = this;
this.digestInto(buffer);
const res = buffer.slice(0, outputLen);
this.destroy();
return res;
}
};
function wrapConstructorWithKey(hashCons) {
const hashC = (msg, key) => hashCons(key).update(msg).digest();
const tmp = hashCons(new Uint8Array(32));
hashC.outputLen = tmp.outputLen;
hashC.blockLen = tmp.blockLen;
hashC.create = (key) => hashCons(key);
return hashC;
}
var poly1305 = /* @__PURE__ */ (() => wrapConstructorWithKey((key) => new Poly1305(key)))();
// node_modules/.pnpm/@noble+ciphers@2.0.0/node_modules/@noble/ciphers/chacha.js
function chachaCore(s, k, n, out, cnt, rounds = 20) {
let y00 = s[0], y01 = s[1], y02 = s[2], y03 = s[3], y04 = k[0], y05 = k[1], y06 = k[2], y07 = k[3], y08 = k[4], y09 = k[5], y10 = k[6], y11 = k[7], y12 = cnt, y13 = n[0], y14 = n[1], y15 = n[2];
let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15;
for (let r = 0; r < rounds; r += 2) {
x00 = x00 + x04 | 0;
x12 = rotl(x12 ^ x00, 16);
x08 = x08 + x12 | 0;
x04 = rotl(x04 ^ x08, 12);
x00 = x00 + x04 | 0;
x12 = rotl(x12 ^ x00, 8);
x08 = x08 + x12 | 0;
x04 = rotl(x04 ^ x08, 7);
x01 = x01 + x05 | 0;
x13 = rotl(x13 ^ x01, 16);
x09 = x09 + x13 | 0;
x05 = rotl(x05 ^ x09, 12);
x01 = x01 + x05 | 0;
x13 = rotl(x13 ^ x01, 8);
x09 = x09 + x13 | 0;
x05 = rotl(x05 ^ x09, 7);
x02 = x02 + x06 | 0;
x14 = rotl(x14 ^ x02, 16);
x10 = x10 + x14 | 0;
x06 = rotl(x06 ^ x10, 12);
x02 = x02 + x06 | 0;
x14 = rotl(x14 ^ x02, 8);
x10 = x10 + x14 | 0;
x06 = rotl(x06 ^ x10, 7);
x03 = x03 + x07 | 0;
x15 = rotl(x15 ^ x03, 16);
x11 = x11 + x15 | 0;
x07 = rotl(x07 ^ x11, 12);
x03 = x03 + x07 | 0;
x15 = rotl(x15 ^ x03, 8);
x11 = x11 + x15 | 0;
x07 = rotl(x07 ^ x11, 7);
x00 = x00 + x05 | 0;
x15 = rotl(x15 ^ x00, 16);
x10 = x10 + x15 | 0;
x05 = rotl(x05 ^ x10, 12);
x00 = x00 + x05 | 0;
x15 = rotl(x15 ^ x00, 8);
x10 = x10 + x15 | 0;
x05 = rotl(x05 ^ x10, 7);
x01 = x01 + x06 | 0;
x12 = rotl(x12 ^ x01, 16);
x11 = x11 + x12 | 0;
x06 = rotl(x06 ^ x11, 12);
x01 = x01 + x06 | 0;
x12 = rotl(x12 ^ x01, 8);
x11 = x11 + x12 | 0;
x06 = rotl(x06 ^ x11, 7);
x02 = x02 + x07 | 0;
x13 = rotl(x13 ^ x02, 16);
x08 = x08 + x13 | 0;
x07 = rotl(x07 ^ x08, 12);
x02 = x02 + x07 | 0;
x13 = rotl(x13 ^ x02, 8);
x08 = x08 + x13 | 0;
x07 = rotl(x07 ^ x08, 7);
x03 = x03 + x04 | 0;
x14 = rotl(x14 ^ x03, 16);
x09 = x09 + x14 | 0;
x04 = rotl(x04 ^ x09, 12);
x03 = x03 + x04 | 0;
x14 = rotl(x14 ^ x03, 8);
x09 = x09 + x14 | 0;
x04 = rotl(x04 ^ x09, 7);
}
let oi = 0;
out[oi++] = y00 + x00 | 0;
out[oi++] = y01 + x01 | 0;
out[oi++] = y02 + x02 | 0;
out[oi++] = y03 + x03 | 0;
out[oi++] = y04 + x04 | 0;
out[oi++] = y05 + x05 | 0;
out[oi++] = y06 + x06 | 0;
out[oi++] = y07 + x07 | 0;
out[oi++] = y08 + x08 | 0;
out[oi++] = y09 + x09 | 0;
out[oi++] = y10 + x10 | 0;
out[oi++] = y11 + x11 | 0;
out[oi++] = y12 + x12 | 0;
out[oi++] = y13 + x13 | 0;
out[oi++] = y14 + x14 | 0;
out[oi++] = y15 + x15 | 0;
}
function hchacha(s, k, i, out) {
let x00 = s[0], x01 = s[1], x02 = s[2], x03 = s[3], x04 = k[0], x05 = k[1], x06 = k[2], x07 = k[3], x08 = k[4], x09 = k[5], x10 = k[6], x11 = k[7], x12 = i[0], x13 = i[1], x14 = i[2], x15 = i[3];
for (let r = 0; r < 20; r += 2) {
x00 = x00 + x04 | 0;
x12 = rotl(x12 ^ x00, 16);
x08 = x08 + x12 | 0;
x04 = rotl(x04 ^ x08, 12);
x00 = x00 + x04 | 0;
x12 = rotl(x12 ^ x00, 8);
x08 = x08 + x12 | 0;
x04 = rotl(x04 ^ x08, 7);
x01 = x01 + x05 | 0;
x13 = rotl(x13 ^ x01, 16);
x09 = x09 + x13 | 0;
x05 = rotl(x05 ^ x09, 12);
x01 = x01 + x05 | 0;
x13 = rotl(x13 ^ x01, 8);
x09 = x09 + x13 | 0;
x05 = rotl(x05 ^ x09, 7);
x02 = x02 + x06 | 0;
x14 = rotl(x14 ^ x02, 16);
x10 = x10 + x14 | 0;
x06 = rotl(x06 ^ x10, 12);
x02 = x02 + x06 | 0;
x14 = rotl(x14 ^ x02, 8);
x10 = x10 + x14 | 0;
x06 = rotl(x06 ^ x10, 7);
x03 = x03 + x07 | 0;
x15 = rotl(x15 ^ x03, 16);
x11 = x11 + x15 | 0;
x07 = rotl(x07 ^ x11, 12);
x03 = x03 + x07 | 0;
x15 = rotl(x15 ^ x03, 8);
x11 = x11 + x15 | 0;
x07 = rotl(x07 ^ x11, 7);
x00 = x00 + x05 | 0;
x15 = rotl(x15 ^ x00, 16);
x10 = x10 + x15 | 0;
x05 = rotl(x05 ^ x10, 12);
x00 = x00 + x05 | 0;
x15 = rotl(x15 ^ x00, 8);
x10 = x10 + x15 | 0;
x05 = rotl(x05 ^ x10, 7);
x01 = x01 + x06 | 0;
x12 = rotl(x12 ^ x01, 16);
x11 = x11 + x12 | 0;
x06 = rotl(x06 ^ x11, 12);
x01 = x01 + x06 | 0;
x12 = rotl(x12 ^ x01, 8);
x11 = x11 + x12 | 0;
x06 = rotl(x06 ^ x11, 7);
x02 = x02 + x07 | 0;
x13 = rotl(x13 ^ x02, 16);
x08 = x08 + x13 | 0;
x07 = rotl(x07 ^ x08, 12);
x02 = x02 + x07 | 0;
x13 = rotl(x13 ^ x02, 8);
x08 = x08 + x13 | 0;
x07 = rotl(x07 ^ x08, 7);
x03 = x03 + x04 | 0;
x14 = rotl(x14 ^ x03, 16);
x09 = x09 + x14 | 0;
x04 = rotl(x04 ^ x09, 12);
x03 = x03 + x04 | 0;
x14 = rotl(x14 ^ x03, 8);
x09 = x09 + x14 | 0;
x04 = rotl(x04 ^ x09, 7);
}
let oi = 0;
out[oi++] = x00;
out[oi++] = x01;
out[oi++] = x02;
out[oi++] = x03;
out[oi++] = x12;
out[oi++] = x13;
out[oi++] = x14;
out[oi++] = x15;
}
var chacha20 = /* @__PURE__ */ createCipher(chachaCore, {
counterRight: false,
counterLength: 4,
allowShortKeys: false
});
var xchacha20 = /* @__PURE__ */ createCipher(chachaCore, {
counterRight: false,
counterLength: 8,
extendNonceFn: hchacha,
allowShortKeys: false
});
var ZEROS16 = /* @__PURE__ */ new Uint8Array(16);
var updatePadded = (h, msg) => {
h.update(msg);
const leftover = msg.length % 16;
if (leftover)
h.update(ZEROS16.subarray(leftover));
};
var ZEROS32 = /* @__PURE__ */ new Uint8Array(32);
function computeTag(fn, key, nonce, ciphertext, AAD) {
if (AAD !== void 0)
abytes(AAD, void 0, "AAD");
const authKey = fn(key, nonce, ZEROS32);
const lengths = u64Lengths(ciphertext.length, AAD ? AAD.length : 0, true);
const h = poly1305.create(authKey);
if (AAD)
updatePadded(h, AAD);
updatePadded(h, ciphertext);
h.update(lengths);
const res = h.digest();
clean(authKey, lengths);
return res;
}
var _poly1305_aead = (xorStream) => (key, nonce, AAD) => {
const tagLength = 16;
return {
encrypt(plaintext, output) {
const plength = plaintext.length;
output = getOutput(plength + tagLength, output, false);
output.set(plaintext);
const oPlain = output.subarray(0, -tagLength);
xorStream(key, nonce, oPlain, oPlain, 1);
const tag = computeTag(xorStream, key, nonce, oPlain, AAD);
output.set(tag, plength);
clean(tag);
return output;
},
decrypt(ciphertext, output) {
output = getOutput(ciphertext.length - tagLength, output, false);
const data = ciphertext.subarray(0, -tagLength);
const passedTag = ciphertext.subarray(-tagLength);
const tag = computeTag(xorStream, key, nonce, data, AAD);
if (!equalBytes(passedTag, tag))
throw new Error("invalid tag");
output.set(ciphertext.subarray(0, -tagLength));
xorStream(key, nonce, output, output, 1);
clean(tag);
return output;
}
};
};
var chacha20poly1305 = /* @__PURE__ */ wrapCipher({ blockSize: 64, nonceLength: 12, tagLength: 16 }, _poly1305_aead(chacha20));
var xchacha20poly1305 = /* @__PURE__ */ wrapCipher({ blockSize: 64, nonceLength: 24, tagLength: 16 }, _poly1305_aead(xchacha20));
// src/app/service/crypto_xchacha.service.ts
function bytesToBase64Url(bytes) {
let bin = "";
for (let i = 0; i < bytes.length; i++)
bin += String.fromCharCode(bytes[i]);
return btoa(bin).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
}
function base64UrlToBytes(s) {
let b64 = s.replace(/-/g, "+").replace(/_/g, "/");
while (b64.length % 4)
b64 += "=";
const bin = atob(b64);
const out = new Uint8Array(bin.length);
for (let i = 0; i < bin.length; i++)
out[i] = bin.charCodeAt(i);
return out;
}
var te = new TextEncoder();
var td = new TextDecoder();
var Crypto_xchachaService = class _Crypto_xchachaService {
static NONCE_LEN = 24;
// 24B
static NONCE_B64URL_LEN = 32;
// 24B -> 32 chars (url-safe, no pad)
/** Rust 同款:不足 32B 0 填充,超过截断 */
normalizeKey(secret) {
const src = typeof secret === "string" ? te.encode(secret) : secret;
const out = new Uint8Array(32);
out.set(src.subarray(0, 32), 0);
return out;
}
/** encrypt:token = base64url(nonce24) + base64url(ciphertext) */
encrypt(secret, plaintext) {
const key = this.normalizeKey(secret);
const nonce = randomBytes(_Crypto_xchachaService.NONCE_LEN);
const aead = xchacha20poly1305(key, nonce);
const ct = aead.encrypt(te.encode(plaintext));
return bytesToBase64Url(nonce) + bytesToBase64Url(ct);
}
/** decrypt:前 32 字符是 nonce 的 base64url,后半是密文 */
decrypt(secret, token) {
if (token.length < _Crypto_xchachaService.NONCE_B64URL_LEN) {
throw new Error("nonce \u957F\u5EA6\u4E0D\u5408\u6CD5");
}
const noncePart = token.slice(0, _Crypto_xchachaService.NONCE_B64URL_LEN);
const ctPart = token.slice(_Crypto_xchachaService.NONCE_B64URL_LEN);
const nonce = base64UrlToBytes(noncePart);
if (nonce.length !== _Crypto_xchachaService.NONCE_LEN) {
throw new Error("nonce \u957F\u5EA6\u4E0D\u5408\u6CD5");
}
const ciphertext = base64UrlToBytes(ctPart);
const key = this.normalizeKey(secret);
const aead = xchacha20poly1305(key, nonce);
try {
const pt = aead.decrypt(ciphertext);
return td.decode(pt);
} catch {
throw new Error("\u89E3\u5BC6\u5931\u8D25");
}
}
static \u0275fac = function Crypto_xchachaService_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _Crypto_xchachaService)();
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _Crypto_xchachaService, factory: _Crypto_xchachaService.\u0275fac, providedIn: "root" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Crypto_xchachaService, [{
type: Injectable,
args: [{ providedIn: "root" }]
}], null, null);
})();
// src/app/service/url.service.ts
var UrlService = class _UrlService {
crypto;
constructor(crypto2) {
this.crypto = crypto2;
}
buildSubscriptionQuery(params) {
const { secret, url, client, provider, interval, strict } = params;
const sub_url = this.crypto.encrypt(secret, url);
return new ConvertorQuery(client, provider, interval, strict, sub_url);
}
static \u0275fac = function UrlService_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _UrlService)(\u0275\u0275inject(Crypto_xchachaService));
};
static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _UrlService, factory: _UrlService.\u0275fac, providedIn: "root" });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(UrlService, [{
type: Injectable,
args: [{
providedIn: "root"
}]
}], () => [{ type: Crypto_xchachaService }], null);
})();
// src/app/page/dashboard/dashboard-sub/dashboard-sub.ts
var _forTrack0 = ($index, $item) => $item.desc;
function DashboardSub_For_13_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "mat-option", 5);
\u0275\u0275text(1);
\u0275\u0275elementEnd();
}
if (rf & 2) {
const c_r1 = ctx.$implicit;
\u0275\u0275property("value", \u0275\u0275interpolate(c_r1.toLowerCase()));
\u0275\u0275advance();
\u0275\u0275textInterpolate(c_r1);
}
}
function DashboardSub_For_19_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "mat-option", 5);
\u0275\u0275text(1);
\u0275\u0275elementEnd();
}
if (rf & 2) {
const p_r2 = ctx.$implicit;
\u0275\u0275property("value", \u0275\u0275interpolate(p_r2.toLowerCase()));
\u0275\u0275advance();
\u0275\u0275textInterpolate(p_r2);
}
}
function DashboardSub_For_35_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "div", 12)(1, "div", 13)(2, "h5");
\u0275\u0275text(3);
\u0275\u0275elementEnd();
\u0275\u0275elementStart(4, "app-icon-button", 14);
\u0275\u0275text(5, "content_copy");
\u0275\u0275elementEnd()();
\u0275\u0275elementStart(6, "div", 15)(7, "code");
\u0275\u0275text(8);
\u0275\u0275elementEnd()()();
}
if (rf & 2) {
const url_r3 = ctx.$implicit;
\u0275\u0275advance(3);
\u0275\u0275textInterpolate(url_r3.desc);
\u0275\u0275advance();
\u0275\u0275property("cdkCopyToClipboard", \u0275\u0275interpolate(url_r3.url));
\u0275\u0275advance(4);
\u0275\u0275textInterpolate1(" ", url_r3.url, " ");
}
}
var DashboardSub = class _DashboardSub {
providers = Object.values(SubProvider);
clients = Object.values(ProxyClient);
destroyRef = inject2(DestroyRef);
urlService = inject2(UrlService);
dashboardService = inject2(DashboardService);
storage = inject2(StorageMap);
subscriptionForm = new FormGroup({
secret: new FormControl(null, {
validators: [Validators.required],
updateOn: "blur"
}),
url: new FormControl(null, {
validators: [Validators.required],
updateOn: "blur"
}),
interval: new FormControl(43200, {
nonNullable: true,
validators: [Validators.required],
updateOn: "blur"
}),
client: new FormControl(ProxyClient.Surge.toLowerCase(), { nonNullable: true }),
provider: new FormControl(SubProvider.BosLife.toLowerCase(), { nonNullable: true }),
strict: new FormControl(true, { nonNullable: true })
});
urlResult = new BehaviorSubject(UrlResult.empty());
urls$ = this.urlResult.pipe(filter((v) => !!v), map((result) => [
result.raw_url,
result.raw_profile_url,
result.profile_url,
result.sub_logs_url,
...result.rule_providers_url
]));
loading = new BehaviorSubject(false);
submit$ = new Subject();
cancel$ = new Subject();
error$ = new Subject();
params$ = this.subscriptionForm.valueChanges.pipe(debounceTime(300), map(() => this.subscriptionForm.getRawValue()), distinctUntilChanged(this.deepEqual), filter(() => this.subscriptionForm.valid), map((payload) => this.toUrlParams(payload)), shareReplay({ bufferSize: 1, refCount: true }));
formRestoreSub = merge(this.storage.get("url").pipe(map((value) => typeof value === "string" ? value : void 0), map((value) => ({ url: value, secret: void 0 }))), this.storage.get("secret").pipe(map((value) => typeof value === "string" ? value : void 0), map((value) => ({ url: void 0, secret: value })))).pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
console.log(value);
if (!value.url) {
delete value.url;
}
if (!value.secret) {
delete value.secret;
}
this.subscriptionForm.patchValue(value, { emitEvent: false });
});
storageSub = merge(
// 监听表单变化,debounce后保存
this.subscriptionForm.valueChanges.pipe(debounceTime(300), map(() => this.subscriptionForm.getRawValue())),
// 手动提交时立即保存
this.submit$.pipe(map(() => this.subscriptionForm.getRawValue()))
).pipe(switchMap((formValue) => {
const saveOperations = [];
if (formValue.url && formValue.url.trim()) {
saveOperations.push(this.storage.set("url", formValue.url.trim()));
}
if (formValue.secret && formValue.secret.trim()) {
saveOperations.push(this.storage.set("secret", formValue.secret.trim()));
}
if (saveOperations.length === 0) {
return EMPTY;
}
return forkJoin(saveOperations).pipe(catchError(() => EMPTY));
}), takeUntilDestroyed(this.destroyRef)).subscribe();
requestSub = merge(
this.params$,
// 手动:点击提交时直接抓取当前 rawValue(不依赖 params$ 是否已发过值)
this.submit$.pipe(map(() => this.subscriptionForm.getRawValue()), filter(() => this.subscriptionForm.valid), map((payload) => this.toUrlParams(payload)))
).pipe(exhaustMap((urlParams) => {
return defer(() => {
this.subscriptionForm.disable({ emitEvent: false });
this.loading.next(true);
const query = this.urlService.buildSubscriptionQuery(urlParams);
return this.dashboardService.getSubscription(query).pipe(
// 主动取消当前请求
takeUntil(this.cancel$),
// 错误只在 HTTP 内部处理,吞掉,不打断主流
catchError((err) => {
console.error(err);
return EMPTY;
}),
// 结束(成功/失败/取消):解锁 & 关 loading
finalize(() => {
this.subscriptionForm.enable({ emitEvent: false });
this.loading.next(false);
})
);
});
}), takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
console.log(value);
if (value.status.isOk()) {
this.urlResult.next(value.data);
} else {
}
});
submit() {
this.submit$.next();
}
cancel() {
this.cancel$.next();
}
toUrlParams(payload) {
return {
secret: payload.secret,
url: payload.url,
client: payload.client,
provider: payload.provider,
interval: payload.interval,
strict: payload.strict
};
}
deepEqual(a, b) {
return JSON.stringify(a) === JSON.stringify(b);
}
static \u0275fac = function DashboardSub_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _DashboardSub)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _DashboardSub, selectors: [["app-dashboard-sub"]], decls: 37, vars: 3, consts: [[3, "submit", "formGroup"], [1, "form-row"], ["appearance", "outline", "subscriptSizing", "dynamic"], ["formControlName", "secret", "matInput", ""], ["formControlName", "client", "panelClass", "my-mat-option"], [3, "value"], ["formControlName", "provider", "panelClass", "my-mat-option"], ["formControlName", "interval", "matInput", "", "type", "number"], ["formControlName", "strict", "labelPosition", "before", 1, "form-suffix"], ["formControlName", "url", "matInput", ""], ["matButton", "filled", 1, "form-suffix"], [1, "scroll-area"], [1, "convertor-url"], [1, "convertor-url-label"], [3, "cdkCopyToClipboard"], [1, "convertor-url-link"]], template: function DashboardSub_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "h2");
\u0275\u0275text(1, "\u8BA2\u9605\u94FE\u63A5");
\u0275\u0275elementEnd();
\u0275\u0275elementStart(2, "form", 0);
\u0275\u0275listener("submit", function DashboardSub_Template_form_submit_2_listener() {
return ctx.submit();
});
\u0275\u0275elementStart(3, "div", 1)(4, "mat-form-field", 2)(5, "mat-label");
\u0275\u0275text(6, "Secret");
\u0275\u0275elementEnd();
\u0275\u0275element(7, "input", 3);
\u0275\u0275elementEnd();
\u0275\u0275elementStart(8, "mat-form-field", 2)(9, "mat-label");
\u0275\u0275text(10, "Client");
\u0275\u0275elementEnd();
\u0275\u0275elementStart(11, "mat-select", 4);
\u0275\u0275repeaterCreate(12, DashboardSub_For_13_Template, 2, 3, "mat-option", 5, \u0275\u0275repeaterTrackByIdentity);
\u0275\u0275elementEnd()();
\u0275\u0275elementStart(14, "mat-form-field", 2)(15, "mat-label");
\u0275\u0275text(16, "Provider");
\u0275\u0275elementEnd();
\u0275\u0275elementStart(17, "mat-select", 6);
\u0275\u0275repeaterCreate(18, DashboardSub_For_19_Template, 2, 3, "mat-option", 5, \u0275\u0275repeaterTrackByIdentity);
\u0275\u0275elementEnd()();
\u0275\u0275elementStart(20, "mat-form-field", 2)(21, "mat-label");
\u0275\u0275text(22, "Interval");
\u0275\u0275elementEnd();
\u0275\u0275element(23, "input", 7);
\u0275\u0275elementEnd();
\u0275\u0275elementStart(24, "mat-slide-toggle", 8);
\u0275\u0275text(25, "Strict");
\u0275\u0275elementEnd()();
\u0275\u0275elementStart(26, "div", 1)(27, "mat-form-field", 2)(28, "mat-label");
\u0275\u0275text(29, "Raw Subscription URL");
\u0275\u0275elementEnd();
\u0275\u0275element(30, "input", 9);
\u0275\u0275elementEnd();
\u0275\u0275elementStart(31, "button", 10);
\u0275\u0275text(32, "Gen");
\u0275\u0275elementEnd()()();
\u0275\u0275elementStart(33, "section", 11);
\u0275\u0275repeaterCreate(34, DashboardSub_For_35_Template, 9, 4, "div", 12, _forTrack0);
\u0275\u0275pipe(36, "async");
\u0275\u0275elementEnd();
}
if (rf & 2) {
\u0275\u0275advance(2);
\u0275\u0275property("formGroup", ctx.subscriptionForm);
\u0275\u0275advance(10);
\u0275\u0275repeater(ctx.clients);
\u0275\u0275advance(6);
\u0275\u0275repeater(ctx.providers);
\u0275\u0275advance(16);
\u0275\u0275repeater(\u0275\u0275pipeBind1(36, 1, ctx.urls$));
}
}, dependencies: [
MatFormField,
MatLabel,
MatInput,
MatSelect,
MatOption,
MatButton,
IconButton,
MatSlideToggle,
ReactiveFormsModule,
\u0275NgNoValidate,
DefaultValueAccessor,
NumberValueAccessor,
NgControlStatus,
NgControlStatusGroup,
FormGroupDirective,
FormControlName,
CdkCopyToClipboard,
AsyncPipe
], styles: ["\n\n[_nghost-%COMP%] {\n display: flex;\n overflow: hidden;\n flex: 1 1 auto;\n flex-direction: column;\n width: 100%;\n gap: 8px;\n}\n[_nghost-%COMP%] h2[_ngcontent-%COMP%] {\n font-size: 16px;\n font-weight: 500;\n}\n[_nghost-%COMP%] form[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n[_nghost-%COMP%] form[_ngcontent-%COMP%] .form-row[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n gap: 12px;\n}\n[_nghost-%COMP%] form[_ngcontent-%COMP%] .form-suffix[_ngcontent-%COMP%] {\n width: 82.5px;\n}\n[_nghost-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%] {\n flex: 1;\n}\n[_nghost-%COMP%] form[_ngcontent-%COMP%] mat-slide-toggle[_ngcontent-%COMP%] {\n padding-top: 4px;\n}\n[_nghost-%COMP%] form[_ngcontent-%COMP%] button[matButton=filled][_ngcontent-%COMP%] {\n margin-top: 2px;\n}\n[_nghost-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%] {\n --mat-form-field-container-text-size: 12px;\n}\n[_nghost-%COMP%] form[_ngcontent-%COMP%] mat-select[_ngcontent-%COMP%] {\n --mat-select-trigger-text-size: 12px;\n}\n[_nghost-%COMP%] form[_ngcontent-%COMP%] .mat-mdc-option {\n min-height: 28px;\n}\n[_nghost-%COMP%] section[_ngcontent-%COMP%] {\n display: flex;\n overflow-y: auto;\n flex-direction: column;\n gap: 12px;\n}\n[_nghost-%COMP%] section[_ngcontent-%COMP%] .convertor-url[_ngcontent-%COMP%] {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n justify-content: center;\n box-sizing: border-box;\n width: 100%;\n height: auto;\n padding: 12px;\n border-radius: 12px;\n background: #1a1c20;\n gap: 12px;\n}\n[_nghost-%COMP%] section[_ngcontent-%COMP%] .convertor-url[_ngcontent-%COMP%] .convertor-url-label[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n flex-direction: row;\n width: 100%;\n}\n[_nghost-%COMP%] section[_ngcontent-%COMP%] .convertor-url[_ngcontent-%COMP%] .convertor-url-label[_ngcontent-%COMP%] h5[_ngcontent-%COMP%] {\n font-size: 12px;\n font-weight: 400;\n font-style: normal;\n line-height: normal;\n flex: 1 1 auto;\n color: #ffffff;\n}\n[_nghost-%COMP%] section[_ngcontent-%COMP%] .convertor-url[_ngcontent-%COMP%] .convertor-url-link[_ngcontent-%COMP%] {\n display: flex;\n align-items: flex-start;\n align-self: stretch;\n flex-direction: column;\n padding: 8px;\n border-radius: 6px;\n background: #0c0e12;\n gap: 10px;\n}\n[_nghost-%COMP%] section[_ngcontent-%COMP%] .convertor-url[_ngcontent-%COMP%] .convertor-url-link[_ngcontent-%COMP%] code[_ngcontent-%COMP%] {\n font-size: 12px;\n font-weight: 400;\n font-style: normal;\n line-height: normal;\n overflow: hidden;\n overflow-y: auto;\n flex: 1 1 auto;\n width: 100%;\n text-overflow: ellipsis;\n word-break: break-word;\n color: #ffffff;\n overflow-wrap: anywhere;\n}\n/*# sourceMappingURL=dashboard-sub.css.map */"] });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DashboardSub, [{
type: Component,
args: [{ selector: "app-dashboard-sub", imports: [
MatFormField,
MatLabel,
MatInput,
MatSelect,
MatOption,
MatButton,
IconButton,
MatSlideToggle,
ReactiveFormsModule,
AsyncPipe,
CdkCopyToClipboard
], template: '<h2>\u8BA2\u9605\u94FE\u63A5</h2>\n\n<form (submit)="submit()" [formGroup]="subscriptionForm">\n <div class="form-row">\n <mat-form-field appearance="outline" subscriptSizing="dynamic">\n <mat-label>Secret</mat-label>\n <input formControlName="secret" matInput>\n </mat-form-field>\n <mat-form-field appearance="outline" subscriptSizing="dynamic">\n <mat-label>Client</mat-label>\n <mat-select formControlName="client" panelClass="my-mat-option">\n @for (c of clients; track c) {\n <mat-option value="{{ c.toLowerCase() }}">{{ c }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n <mat-form-field appearance="outline" subscriptSizing="dynamic">\n <mat-label>Provider</mat-label>\n <mat-select formControlName="provider" panelClass="my-mat-option">\n @for (p of providers; track p) {\n <mat-option value="{{ p.toLowerCase() }}">{{ p }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n <mat-form-field appearance="outline" subscriptSizing="dynamic">\n <mat-label>Interval</mat-label>\n <input formControlName="interval" matInput type="number">\n </mat-form-field>\n <mat-slide-toggle class="form-suffix" formControlName="strict" labelPosition="before">Strict</mat-slide-toggle>\n </div>\n <div class="form-row">\n <mat-form-field appearance="outline" subscriptSizing="dynamic">\n <mat-label>Raw Subscription URL</mat-label>\n <input formControlName="url" matInput>\n </mat-form-field>\n <button class="form-suffix" matButton="filled">Gen</button>\n </div>\n</form>\n\n<section class="scroll-area">\n @for (url of urls$ | async; track url.desc) {\n <div class="convertor-url">\n <div class="convertor-url-label">\n <h5>{{ url.desc }}</h5>\n <app-icon-button cdkCopyToClipboard="{{ url.url }}">content_copy</app-icon-button>\n </div>\n <div class="convertor-url-link">\n <code>\n {{ url.url }}\n </code>\n </div>\n </div>\n }\n</section>\n', styles: ["/* src/app/page/dashboard/dashboard-sub/dashboard-sub.scss */\n:host {\n display: flex;\n overflow: hidden;\n flex: 1 1 auto;\n flex-direction: column;\n width: 100%;\n gap: 8px;\n}\n:host h2 {\n font-size: 16px;\n font-weight: 500;\n}\n:host form {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n:host form .form-row {\n display: flex;\n flex-direction: row;\n gap: 12px;\n}\n:host form .form-suffix {\n width: 82.5px;\n}\n:host form mat-form-field {\n flex: 1;\n}\n:host form mat-slide-toggle {\n padding-top: 4px;\n}\n:host form button[matButton=filled] {\n margin-top: 2px;\n}\n:host form mat-form-field {\n --mat-form-field-container-text-size: 12px;\n}\n:host form mat-select {\n --mat-select-trigger-text-size: 12px;\n}\n:host form ::ng-deep .mat-mdc-option {\n min-height: 28px;\n}\n:host section {\n display: flex;\n overflow-y: auto;\n flex-direction: column;\n gap: 12px;\n}\n:host section .convertor-url {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n justify-content: center;\n box-sizing: border-box;\n width: 100%;\n height: auto;\n padding: 12px;\n border-radius: 12px;\n background: #1a1c20;\n gap: 12px;\n}\n:host section .convertor-url .convertor-url-label {\n display: flex;\n align-items: center;\n flex-direction: row;\n width: 100%;\n}\n:host section .convertor-url .convertor-url-label h5 {\n font-size: 12px;\n font-weight: 400;\n font-style: normal;\n line-height: normal;\n flex: 1 1 auto;\n color: #ffffff;\n}\n:host section .convertor-url .convertor-url-link {\n display: flex;\n align-items: flex-start;\n align-self: stretch;\n flex-direction: column;\n padding: 8px;\n border-radius: 6px;\n background: #0c0e12;\n gap: 10px;\n}\n:host section .convertor-url .convertor-url-link code {\n font-size: 12px;\n font-weight: 400;\n font-style: normal;\n line-height: normal;\n overflow: hidden;\n overflow-y: auto;\n flex: 1 1 auto;\n width: 100%;\n text-overflow: ellipsis;\n word-break: break-word;\n color: #ffffff;\n overflow-wrap: anywhere;\n}\n/*# sourceMappingURL=dashboard-sub.css.map */\n"] }]
}], null, null);
})();
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(DashboardSub, { className: "DashboardSub", filePath: "src/app/page/dashboard/dashboard-sub/dashboard-sub.ts", lineNumber: 56 });
})();
// src/app/page/dashboard/dashboard.ts
var Dashboard = class _Dashboard {
static \u0275fac = function Dashboard_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _Dashboard)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _Dashboard, selectors: [["app-dashboard"]], decls: 5, vars: 0, template: function Dashboard_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275elementStart(0, "div")(1, "h1");
\u0275\u0275text(2, "Convertor \xB7 Dashboard");
\u0275\u0275elementEnd()();
\u0275\u0275element(3, "app-dashboard-info")(4, "app-dashboard-sub");
}
}, dependencies: [
DashboardInfo,
DashboardSub
], styles: ["\n\n[_nghost-%COMP%] {\n display: flex;\n overflow: hidden;\n align-items: flex-start;\n flex-direction: column;\n box-sizing: border-box;\n height: 100%;\n padding: 24px 120px;\n gap: 16px;\n}\n[_nghost-%COMP%] h1[_ngcontent-%COMP%] {\n font-size: 16px;\n font-weight: 600;\n}\n[_nghost-%COMP%] .dashboard-content[_ngcontent-%COMP%] {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n justify-content: space-between;\n}\n[_nghost-%COMP%] .dashboard-content[_ngcontent-%COMP%] .dashboard-row[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n}\n[_nghost-%COMP%] .example-spacer[_ngcontent-%COMP%] {\n flex: 1 1 auto;\n}\n/*# sourceMappingURL=dashboard.css.map */"], changeDetection: 0 });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Dashboard, [{
type: Component,
args: [{ selector: "app-dashboard", imports: [
DashboardInfo,
DashboardSub
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div>\n <h1>Convertor \xB7 Dashboard</h1>\n</div>\n<app-dashboard-info></app-dashboard-info>\n<app-dashboard-sub></app-dashboard-sub>\n", styles: ["/* src/app/page/dashboard/dashboard.scss */\n:host {\n display: flex;\n overflow: hidden;\n align-items: flex-start;\n flex-direction: column;\n box-sizing: border-box;\n height: 100%;\n padding: 24px 120px;\n gap: 16px;\n}\n:host h1 {\n font-size: 16px;\n font-weight: 600;\n}\n:host .dashboard-content {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n justify-content: space-between;\n}\n:host .dashboard-content .dashboard-row {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n}\n:host .example-spacer {\n flex: 1 1 auto;\n}\n/*# sourceMappingURL=dashboard.css.map */\n"] }]
}], null, null);
})();
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(Dashboard, { className: "Dashboard", filePath: "src/app/page/dashboard/dashboard.ts", lineNumber: 15 });
})();
// src/app/app.ts
var App = class _App {
title = signal("Convertor Dashboard", ...ngDevMode ? [{ debugName: "title" }] : []);
static \u0275fac = function App_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _App)();
};
static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _App, selectors: [["app-root"]], decls: 1, vars: 0, template: function App_Template(rf, ctx) {
if (rf & 1) {
\u0275\u0275element(0, "app-dashboard");
}
}, dependencies: [Dashboard], styles: ['@charset "UTF-8";\n\n\n\n[_nghost-%COMP%] {\n display: block;\n overflow: hidden;\n width: 100%;\n height: 100%;\n}\n[_nghost-%COMP%] .aurora-container[_ngcontent-%COMP%] {\n position: relative;\n width: 100%;\n min-height: 100vh;\n background-color: #020617;\n}\n[_nghost-%COMP%] .aurora-container__bg[_ngcontent-%COMP%] {\n position: absolute;\n z-index: 0;\n background: #000000;\n background-image:\n radial-gradient(\n circle at 1px 1px,\n rgba(139, 92, 246, 0.2) 1px,\n transparent 0),\n radial-gradient(\n circle at 1px 1px,\n rgba(59, 130, 246, 0.18) 1px,\n transparent 0),\n radial-gradient(\n circle at 1px 1px,\n rgba(236, 72, 153, 0.15) 1px,\n transparent 0);\n background-position:\n 0 0,\n 10px 10px,\n 15px 5px;\n background-size:\n 20px 20px,\n 30px 30px,\n 25px 25px;\n inset: 0;\n}\n[_nghost-%COMP%] .aurora-container__content[_ngcontent-%COMP%] {\n position: relative;\n z-index: 1;\n height: 100%;\n background: red;\n}\n/*# sourceMappingURL=app.css.map */'], changeDetection: 0 });
};
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(App, [{
type: Component,
args: [{ selector: "app-root", imports: [Dashboard], changeDetection: ChangeDetectionStrategy.OnPush, template: "<app-dashboard></app-dashboard>\n", styles: ['@charset "UTF-8";\n\n/* src/app/app.scss */\n:host {\n display: block;\n overflow: hidden;\n width: 100%;\n height: 100%;\n}\n:host .aurora-container {\n position: relative;\n width: 100%;\n min-height: 100vh;\n background-color: #020617;\n}\n:host .aurora-container__bg {\n position: absolute;\n z-index: 0;\n background: #000000;\n background-image:\n radial-gradient(\n circle at 1px 1px,\n rgba(139, 92, 246, 0.2) 1px,\n transparent 0),\n radial-gradient(\n circle at 1px 1px,\n rgba(59, 130, 246, 0.18) 1px,\n transparent 0),\n radial-gradient(\n circle at 1px 1px,\n rgba(236, 72, 153, 0.15) 1px,\n transparent 0);\n background-position:\n 0 0,\n 10px 10px,\n 15px 5px;\n background-size:\n 20px 20px,\n 30px 30px,\n 25px 25px;\n inset: 0;\n}\n:host .aurora-container__content {\n position: relative;\n z-index: 1;\n height: 100%;\n background: red;\n}\n/*# sourceMappingURL=app.css.map */\n'] }]
}], null, null);
})();
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(App, { className: "App", filePath: "src/app/app.ts", lineNumber: 11 });
})();
// src/main.ts
bootstrapApplication(App, appConfig).catch((err) => console.error(err));
/*! Bundled license information:
@angular/core/fesm2022/not_found.mjs:
@angular/core/fesm2022/signal.mjs:
@angular/core/fesm2022/untracked.mjs:
@angular/core/fesm2022/primitives/signals.mjs:
@angular/core/fesm2022/primitives/di.mjs:
@angular/core/fesm2022/root_effect_scheduler.mjs:
@angular/core/fesm2022/debug_node.mjs:
@angular/core/fesm2022/resource.mjs:
@angular/core/fesm2022/core.mjs:
@angular/common/fesm2022/location.mjs:
@angular/common/fesm2022/common_module.mjs:
@angular/common/fesm2022/xhr.mjs:
@angular/common/fesm2022/common.mjs:
@angular/platform-browser/fesm2022/dom_renderer.mjs:
@angular/platform-browser/fesm2022/browser.mjs:
@angular/common/fesm2022/module.mjs:
@angular/common/fesm2022/http.mjs:
@angular/platform-browser/fesm2022/platform-browser.mjs:
@angular/core/fesm2022/rxjs-interop.mjs:
@angular/forms/fesm2022/forms.mjs:
(**
* @license Angular v20.2.1
* (c) 2010-2025 Google LLC. https://angular.io/
* License: MIT
*)
@angular/core/fesm2022/debug_node.mjs:
@angular/core/fesm2022/debug_node.mjs:
@angular/core/fesm2022/debug_node.mjs:
@angular/core/fesm2022/debug_node.mjs:
@angular/core/fesm2022/debug_node.mjs:
@angular/core/fesm2022/debug_node.mjs:
@angular/core/fesm2022/debug_node.mjs:
@angular/core/fesm2022/core.mjs:
@angular/core/fesm2022/core.mjs:
@angular/core/fesm2022/core.mjs:
(*!
* @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.dev/license
*)
@noble/ciphers/utils.js:
(*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *)
*/
//# sourceMappingURL=main.js.map