@angular/common 13.3.12 → 13.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common.d.ts +385 -1
- package/esm2020/http/src/client.mjs +3 -3
- package/esm2020/http/src/interceptor.mjs +3 -3
- package/esm2020/http/src/jsonp.mjs +6 -6
- package/esm2020/http/src/module.mjs +15 -15
- package/esm2020/http/src/xhr.mjs +3 -3
- package/esm2020/http/src/xsrf.mjs +6 -6
- package/esm2020/http/testing/src/backend.mjs +3 -3
- package/esm2020/http/testing/src/module.mjs +4 -4
- package/esm2020/src/common.mjs +2 -1
- package/esm2020/src/common_module.mjs +4 -4
- package/esm2020/src/directives/index.mjs +3 -2
- package/esm2020/src/directives/ng_class.mjs +3 -3
- package/esm2020/src/directives/ng_component_outlet.mjs +3 -3
- package/esm2020/src/directives/ng_for_of.mjs +3 -3
- package/esm2020/src/directives/ng_if.mjs +3 -3
- package/esm2020/src/directives/ng_optimized_image/asserts.mjs +20 -0
- package/esm2020/src/directives/ng_optimized_image/error_helper.mjs +13 -0
- package/esm2020/src/directives/ng_optimized_image/image_loaders/cloudflare_loader.mjs +31 -0
- package/esm2020/src/directives/ng_optimized_image/image_loaders/cloudinary_loader.mjs +53 -0
- package/esm2020/src/directives/ng_optimized_image/image_loaders/image_loader.mjs +74 -0
- package/esm2020/src/directives/ng_optimized_image/image_loaders/imagekit_loader.mjs +44 -0
- package/esm2020/src/directives/ng_optimized_image/image_loaders/imgix_loader.mjs +43 -0
- package/esm2020/src/directives/ng_optimized_image/index.mjs +16 -0
- package/esm2020/src/directives/ng_optimized_image/lcp_image_observer.mjs +99 -0
- package/esm2020/src/directives/ng_optimized_image/ng_optimized_image.mjs +864 -0
- package/esm2020/src/directives/ng_optimized_image/preconnect_link_checker.mjs +136 -0
- package/esm2020/src/directives/ng_optimized_image/preload-link-creator.mjs +75 -0
- package/esm2020/src/directives/ng_optimized_image/tokens.mjs +24 -0
- package/esm2020/src/directives/ng_optimized_image/url.mjs +42 -0
- package/esm2020/src/directives/ng_plural.mjs +6 -6
- package/esm2020/src/directives/ng_style.mjs +3 -3
- package/esm2020/src/directives/ng_switch.mjs +9 -9
- package/esm2020/src/directives/ng_template_outlet.mjs +3 -3
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/i18n/localization.mjs +6 -6
- package/esm2020/src/location/hash_location_strategy.mjs +3 -3
- package/esm2020/src/location/location.mjs +3 -3
- package/esm2020/src/location/location_strategy.mjs +6 -6
- package/esm2020/src/location/platform_location.mjs +6 -6
- package/esm2020/src/pipes/async_pipe.mjs +3 -3
- package/esm2020/src/pipes/case_conversion_pipes.mjs +9 -9
- package/esm2020/src/pipes/date_pipe.mjs +3 -3
- package/esm2020/src/pipes/i18n_plural_pipe.mjs +3 -3
- package/esm2020/src/pipes/i18n_select_pipe.mjs +3 -3
- package/esm2020/src/pipes/json_pipe.mjs +3 -3
- package/esm2020/src/pipes/keyvalue_pipe.mjs +3 -3
- package/esm2020/src/pipes/number_pipe.mjs +9 -9
- package/esm2020/src/pipes/slice_pipe.mjs +3 -3
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/location_mock.mjs +3 -3
- package/esm2020/testing/src/mock_location_strategy.mjs +3 -3
- package/esm2020/testing/src/mock_platform_location.mjs +3 -3
- package/esm2020/upgrade/src/location_upgrade_module.mjs +4 -4
- package/fesm2015/common.mjs +1639 -144
- package/fesm2015/common.mjs.map +1 -1
- package/fesm2015/http/testing.mjs +8 -8
- package/fesm2015/http.mjs +37 -37
- package/fesm2015/testing.mjs +10 -10
- package/fesm2015/upgrade.mjs +5 -5
- package/fesm2020/common.mjs +1634 -144
- package/fesm2020/common.mjs.map +1 -1
- package/fesm2020/http/testing.mjs +8 -8
- package/fesm2020/http.mjs +37 -37
- package/fesm2020/testing.mjs +10 -10
- package/fesm2020/upgrade.mjs +5 -5
- package/http/http.d.ts +1 -1
- package/http/testing/testing.d.ts +1 -1
- package/package.json +2 -2
- package/testing/testing.d.ts +1 -1
- package/upgrade/upgrade.d.ts +1 -1
package/fesm2020/common.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v13.
|
|
2
|
+
* @license Angular v13.4.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { InjectionToken, Injectable, ɵɵinject, Inject, Optional, EventEmitter, ɵfindLocaleData, ɵLocaleDataIndex, ɵgetLocaleCurrencyCode, ɵgetLocalePluralCase, LOCALE_ID, ɵregisterLocaleData, ɵisListLikeIterable, ɵstringify, Directive, Input, NgModuleRef, ComponentFactoryResolver,
|
|
8
|
+
import { InjectionToken, Injectable, ɵɵinject, Inject, Optional, EventEmitter, ɵfindLocaleData, ɵLocaleDataIndex, ɵgetLocaleCurrencyCode, ɵgetLocalePluralCase, LOCALE_ID, ɵregisterLocaleData, ɵisListLikeIterable, ɵstringify, Directive, Input, NgModuleRef, ComponentFactoryResolver, ɵRuntimeError, inject, ɵformatRuntimeError, InjectFlags, NgZone, Renderer2, ElementRef, Injector, PLATFORM_ID, NgModule, Host, Attribute, ɵisPromise, ɵisSubscribable, Pipe, DEFAULT_CURRENCY_CODE, Version, ɵɵdefineInjectable } from '@angular/core';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @license
|
|
@@ -87,9 +87,9 @@ class PlatformLocation {
|
|
|
87
87
|
throw new Error('Not implemented');
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
PlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
91
|
-
PlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
92
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
90
|
+
PlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PlatformLocation, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
91
|
+
PlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PlatformLocation, providedIn: 'platform', useFactory: useBrowserPlatformLocation });
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PlatformLocation, decorators: [{
|
|
93
93
|
type: Injectable,
|
|
94
94
|
args: [{
|
|
95
95
|
providedIn: 'platform',
|
|
@@ -190,9 +190,9 @@ class BrowserPlatformLocation extends PlatformLocation {
|
|
|
190
190
|
return this._history.state;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
BrowserPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
194
|
-
BrowserPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
195
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
193
|
+
BrowserPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BrowserPlatformLocation, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
194
|
+
BrowserPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BrowserPlatformLocation, providedIn: 'platform', useFactory: createBrowserPlatformLocation });
|
|
195
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BrowserPlatformLocation, decorators: [{
|
|
196
196
|
type: Injectable,
|
|
197
197
|
args: [{
|
|
198
198
|
providedIn: 'platform',
|
|
@@ -311,9 +311,9 @@ class LocationStrategy {
|
|
|
311
311
|
throw new Error('Not implemented');
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
LocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
315
|
-
LocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
316
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
314
|
+
LocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LocationStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
315
|
+
LocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LocationStrategy, providedIn: 'root', useFactory: provideLocationStrategy });
|
|
316
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LocationStrategy, decorators: [{
|
|
317
317
|
type: Injectable,
|
|
318
318
|
args: [{ providedIn: 'root', useFactory: provideLocationStrategy }]
|
|
319
319
|
}] });
|
|
@@ -428,9 +428,9 @@ class PathLocationStrategy extends LocationStrategy {
|
|
|
428
428
|
this._platformLocation.historyGo?.(relativePosition);
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
-
PathLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
432
|
-
PathLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
433
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
431
|
+
PathLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PathLocationStrategy, deps: [{ token: PlatformLocation }, { token: APP_BASE_HREF, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
432
|
+
PathLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PathLocationStrategy });
|
|
433
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PathLocationStrategy, decorators: [{
|
|
434
434
|
type: Injectable
|
|
435
435
|
}], ctorParameters: function () { return [{ type: PlatformLocation }, { type: undefined, decorators: [{
|
|
436
436
|
type: Optional
|
|
@@ -522,9 +522,9 @@ class HashLocationStrategy extends LocationStrategy {
|
|
|
522
522
|
this._platformLocation.historyGo?.(relativePosition);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
HashLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
526
|
-
HashLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
527
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
525
|
+
HashLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: HashLocationStrategy, deps: [{ token: PlatformLocation }, { token: APP_BASE_HREF, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
526
|
+
HashLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: HashLocationStrategy });
|
|
527
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: HashLocationStrategy, decorators: [{
|
|
528
528
|
type: Injectable
|
|
529
529
|
}], ctorParameters: function () { return [{ type: PlatformLocation }, { type: undefined, decorators: [{
|
|
530
530
|
type: Optional
|
|
@@ -760,9 +760,9 @@ Location.joinWithSlash = joinWithSlash;
|
|
|
760
760
|
* @returns The URL string, modified if needed.
|
|
761
761
|
*/
|
|
762
762
|
Location.stripTrailingSlash = stripTrailingSlash;
|
|
763
|
-
Location.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
764
|
-
Location.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
765
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
763
|
+
Location.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: Location, deps: [{ token: LocationStrategy }, { token: PlatformLocation }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
764
|
+
Location.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: Location, providedIn: 'root', useFactory: createLocation });
|
|
765
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: Location, decorators: [{
|
|
766
766
|
type: Injectable,
|
|
767
767
|
args: [{
|
|
768
768
|
providedIn: 'root',
|
|
@@ -2578,9 +2578,9 @@ function parseIntAutoRadix(text) {
|
|
|
2578
2578
|
*/
|
|
2579
2579
|
class NgLocalization {
|
|
2580
2580
|
}
|
|
2581
|
-
NgLocalization.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
2582
|
-
NgLocalization.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
2583
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
2581
|
+
NgLocalization.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgLocalization, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2582
|
+
NgLocalization.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgLocalization, providedIn: 'root', useFactory: (locale) => new NgLocaleLocalization(locale), deps: [{ token: LOCALE_ID }] });
|
|
2583
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgLocalization, decorators: [{
|
|
2584
2584
|
type: Injectable,
|
|
2585
2585
|
args: [{
|
|
2586
2586
|
providedIn: 'root',
|
|
@@ -2635,9 +2635,9 @@ class NgLocaleLocalization extends NgLocalization {
|
|
|
2635
2635
|
}
|
|
2636
2636
|
}
|
|
2637
2637
|
}
|
|
2638
|
-
NgLocaleLocalization.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
2639
|
-
NgLocaleLocalization.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
2640
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
2638
|
+
NgLocaleLocalization.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgLocaleLocalization, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2639
|
+
NgLocaleLocalization.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgLocaleLocalization });
|
|
2640
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgLocaleLocalization, decorators: [{
|
|
2641
2641
|
type: Injectable
|
|
2642
2642
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
2643
2643
|
type: Inject,
|
|
@@ -2830,9 +2830,9 @@ class NgClass {
|
|
|
2830
2830
|
}
|
|
2831
2831
|
}
|
|
2832
2832
|
}
|
|
2833
|
-
NgClass.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
2834
|
-
NgClass.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.
|
|
2835
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
2833
|
+
NgClass.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgClass, deps: [{ token: i0.IterableDiffers }, { token: i0.KeyValueDiffers }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2834
|
+
NgClass.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: NgClass, selector: "[ngClass]", inputs: { klass: ["class", "klass"], ngClass: "ngClass" }, ngImport: i0 });
|
|
2835
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgClass, decorators: [{
|
|
2836
2836
|
type: Directive,
|
|
2837
2837
|
args: [{ selector: '[ngClass]' }]
|
|
2838
2838
|
}], ctorParameters: function () { return [{ type: i0.IterableDiffers }, { type: i0.KeyValueDiffers }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { klass: [{
|
|
@@ -2940,9 +2940,9 @@ class NgComponentOutlet {
|
|
|
2940
2940
|
this._moduleRef.destroy();
|
|
2941
2941
|
}
|
|
2942
2942
|
}
|
|
2943
|
-
NgComponentOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
2944
|
-
NgComponentOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.
|
|
2945
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
2943
|
+
NgComponentOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgComponentOutlet, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2944
|
+
NgComponentOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: { ngComponentOutlet: "ngComponentOutlet", ngComponentOutletInjector: "ngComponentOutletInjector", ngComponentOutletContent: "ngComponentOutletContent", ngComponentOutletNgModuleFactory: "ngComponentOutletNgModuleFactory" }, usesOnChanges: true, ngImport: i0 });
|
|
2945
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgComponentOutlet, decorators: [{
|
|
2946
2946
|
type: Directive,
|
|
2947
2947
|
args: [{ selector: '[ngComponentOutlet]' }]
|
|
2948
2948
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { ngComponentOutlet: [{
|
|
@@ -3216,9 +3216,9 @@ class NgForOf {
|
|
|
3216
3216
|
return true;
|
|
3217
3217
|
}
|
|
3218
3218
|
}
|
|
3219
|
-
NgForOf.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
3220
|
-
NgForOf.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.
|
|
3221
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
3219
|
+
NgForOf.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgForOf, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3220
|
+
NgForOf.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: { ngForOf: "ngForOf", ngForTrackBy: "ngForTrackBy", ngForTemplate: "ngForTemplate" }, ngImport: i0 });
|
|
3221
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgForOf, decorators: [{
|
|
3222
3222
|
type: Directive,
|
|
3223
3223
|
args: [{ selector: '[ngFor][ngForOf]' }]
|
|
3224
3224
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i0.IterableDiffers }]; }, propDecorators: { ngForOf: [{
|
|
@@ -3448,9 +3448,9 @@ class NgIf {
|
|
|
3448
3448
|
return true;
|
|
3449
3449
|
}
|
|
3450
3450
|
}
|
|
3451
|
-
NgIf.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
3452
|
-
NgIf.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.
|
|
3453
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
3451
|
+
NgIf.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgIf, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3452
|
+
NgIf.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: NgIf, selector: "[ngIf]", inputs: { ngIf: "ngIf", ngIfThen: "ngIfThen", ngIfElse: "ngIfElse" }, ngImport: i0 });
|
|
3453
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgIf, decorators: [{
|
|
3454
3454
|
type: Directive,
|
|
3455
3455
|
args: [{ selector: '[ngIf]' }]
|
|
3456
3456
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { ngIf: [{
|
|
@@ -3476,6 +3476,1498 @@ function assertTemplate(property, templateRef) {
|
|
|
3476
3476
|
}
|
|
3477
3477
|
}
|
|
3478
3478
|
|
|
3479
|
+
/**
|
|
3480
|
+
* @license
|
|
3481
|
+
* Copyright Google LLC All Rights Reserved.
|
|
3482
|
+
*
|
|
3483
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3484
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3485
|
+
*/
|
|
3486
|
+
const PLATFORM_BROWSER_ID = 'browser';
|
|
3487
|
+
const PLATFORM_SERVER_ID = 'server';
|
|
3488
|
+
const PLATFORM_WORKER_APP_ID = 'browserWorkerApp';
|
|
3489
|
+
const PLATFORM_WORKER_UI_ID = 'browserWorkerUi';
|
|
3490
|
+
/**
|
|
3491
|
+
* Returns whether a platform id represents a browser platform.
|
|
3492
|
+
* @publicApi
|
|
3493
|
+
*/
|
|
3494
|
+
function isPlatformBrowser(platformId) {
|
|
3495
|
+
return platformId === PLATFORM_BROWSER_ID;
|
|
3496
|
+
}
|
|
3497
|
+
/**
|
|
3498
|
+
* Returns whether a platform id represents a server platform.
|
|
3499
|
+
* @publicApi
|
|
3500
|
+
*/
|
|
3501
|
+
function isPlatformServer(platformId) {
|
|
3502
|
+
return platformId === PLATFORM_SERVER_ID;
|
|
3503
|
+
}
|
|
3504
|
+
/**
|
|
3505
|
+
* Returns whether a platform id represents a web worker app platform.
|
|
3506
|
+
* @publicApi
|
|
3507
|
+
*/
|
|
3508
|
+
function isPlatformWorkerApp(platformId) {
|
|
3509
|
+
return platformId === PLATFORM_WORKER_APP_ID;
|
|
3510
|
+
}
|
|
3511
|
+
/**
|
|
3512
|
+
* Returns whether a platform id represents a web worker UI platform.
|
|
3513
|
+
* @publicApi
|
|
3514
|
+
*/
|
|
3515
|
+
function isPlatformWorkerUi(platformId) {
|
|
3516
|
+
return platformId === PLATFORM_WORKER_UI_ID;
|
|
3517
|
+
}
|
|
3518
|
+
|
|
3519
|
+
/**
|
|
3520
|
+
* @license
|
|
3521
|
+
* Copyright Google LLC All Rights Reserved.
|
|
3522
|
+
*
|
|
3523
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3524
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3525
|
+
*/
|
|
3526
|
+
// Assembles directive details string, useful for error messages.
|
|
3527
|
+
function imgDirectiveDetails(ngSrc, includeNgSrc = true) {
|
|
3528
|
+
const ngSrcInfo = includeNgSrc ? `(activated on an <img> element with the \`ngSrc="${ngSrc}"\`) ` : '';
|
|
3529
|
+
return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`;
|
|
3530
|
+
}
|
|
3531
|
+
|
|
3532
|
+
/**
|
|
3533
|
+
* @license
|
|
3534
|
+
* Copyright Google LLC All Rights Reserved.
|
|
3535
|
+
*
|
|
3536
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3537
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3538
|
+
*/
|
|
3539
|
+
// Converts a string that represents a URL into a URL class instance.
|
|
3540
|
+
function getUrl(src, win) {
|
|
3541
|
+
// Don't use a base URL is the URL is absolute.
|
|
3542
|
+
return isAbsoluteUrl(src) ? new URL(src) : new URL(src, win.location.href);
|
|
3543
|
+
}
|
|
3544
|
+
// Checks whether a URL is absolute (i.e. starts with `http://` or `https://`).
|
|
3545
|
+
function isAbsoluteUrl(src) {
|
|
3546
|
+
return /^https?:\/\//.test(src);
|
|
3547
|
+
}
|
|
3548
|
+
// Given a URL, extract the hostname part.
|
|
3549
|
+
// If a URL is a relative one - the URL is returned as is.
|
|
3550
|
+
function extractHostname(url) {
|
|
3551
|
+
return isAbsoluteUrl(url) ? (new URL(url)).hostname : url;
|
|
3552
|
+
}
|
|
3553
|
+
function isValidPath(path) {
|
|
3554
|
+
const isString = typeof path === 'string';
|
|
3555
|
+
if (!isString || path.trim() === '') {
|
|
3556
|
+
return false;
|
|
3557
|
+
}
|
|
3558
|
+
// Calling new URL() will throw if the path string is malformed
|
|
3559
|
+
try {
|
|
3560
|
+
const url = new URL(path);
|
|
3561
|
+
return true;
|
|
3562
|
+
}
|
|
3563
|
+
catch {
|
|
3564
|
+
return false;
|
|
3565
|
+
}
|
|
3566
|
+
}
|
|
3567
|
+
function normalizePath(path) {
|
|
3568
|
+
return path.endsWith('/') ? path.slice(0, -1) : path;
|
|
3569
|
+
}
|
|
3570
|
+
function normalizeSrc(src) {
|
|
3571
|
+
return src.startsWith('/') ? src.slice(1) : src;
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3574
|
+
/**
|
|
3575
|
+
* @license
|
|
3576
|
+
* Copyright Google LLC All Rights Reserved.
|
|
3577
|
+
*
|
|
3578
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3579
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3580
|
+
*/
|
|
3581
|
+
/**
|
|
3582
|
+
* Noop image loader that does no transformation to the original src and just returns it as is.
|
|
3583
|
+
* This loader is used as a default one if more specific logic is not provided in an app config.
|
|
3584
|
+
*
|
|
3585
|
+
* @see `ImageLoader`
|
|
3586
|
+
* @see `NgOptimizedImage`
|
|
3587
|
+
*/
|
|
3588
|
+
const noopImageLoader = (config) => config.src;
|
|
3589
|
+
/**
|
|
3590
|
+
* Injection token that configures the image loader function.
|
|
3591
|
+
*
|
|
3592
|
+
* @see `ImageLoader`
|
|
3593
|
+
* @see `NgOptimizedImage`
|
|
3594
|
+
* @publicApi
|
|
3595
|
+
*/
|
|
3596
|
+
const IMAGE_LOADER = new InjectionToken('ImageLoader', {
|
|
3597
|
+
providedIn: 'root',
|
|
3598
|
+
factory: () => noopImageLoader,
|
|
3599
|
+
});
|
|
3600
|
+
/**
|
|
3601
|
+
* Internal helper function that makes it easier to introduce custom image loaders for the
|
|
3602
|
+
* `NgOptimizedImage` directive. It is enough to specify a URL builder function to obtain full DI
|
|
3603
|
+
* configuration for a given loader: a DI token corresponding to the actual loader function, plus DI
|
|
3604
|
+
* tokens managing preconnect check functionality.
|
|
3605
|
+
* @param buildUrlFn a function returning a full URL based on loader's configuration
|
|
3606
|
+
* @param exampleUrls example of full URLs for a given loader (used in error messages)
|
|
3607
|
+
* @returns a set of DI providers corresponding to the configured image loader
|
|
3608
|
+
*/
|
|
3609
|
+
function createImageLoader(buildUrlFn, exampleUrls) {
|
|
3610
|
+
return function provideImageLoader(path) {
|
|
3611
|
+
if (!isValidPath(path)) {
|
|
3612
|
+
throwInvalidPathError(path, exampleUrls || []);
|
|
3613
|
+
}
|
|
3614
|
+
// The trailing / is stripped (if provided) to make URL construction (concatenation) easier in
|
|
3615
|
+
// the individual loader functions.
|
|
3616
|
+
path = normalizePath(path);
|
|
3617
|
+
const loaderFn = (config) => {
|
|
3618
|
+
if (isAbsoluteUrl(config.src)) {
|
|
3619
|
+
// Image loader functions expect an image file name (e.g. `my-image.png`)
|
|
3620
|
+
// or a relative path + a file name (e.g. `/a/b/c/my-image.png`) as an input,
|
|
3621
|
+
// so the final absolute URL can be constructed.
|
|
3622
|
+
// When an absolute URL is provided instead - the loader can not
|
|
3623
|
+
// build a final URL, thus the error is thrown to indicate that.
|
|
3624
|
+
throwUnexpectedAbsoluteUrlError(path, config.src);
|
|
3625
|
+
}
|
|
3626
|
+
return buildUrlFn(path, { ...config, src: normalizeSrc(config.src) });
|
|
3627
|
+
};
|
|
3628
|
+
const providers = [{ provide: IMAGE_LOADER, useValue: loaderFn }];
|
|
3629
|
+
return providers;
|
|
3630
|
+
};
|
|
3631
|
+
}
|
|
3632
|
+
function throwInvalidPathError(path, exampleUrls) {
|
|
3633
|
+
throw new ɵRuntimeError(2959 /* INVALID_LOADER_ARGUMENTS */, ngDevMode &&
|
|
3634
|
+
`Image loader has detected an invalid path (\`${path}\`). ` +
|
|
3635
|
+
`To fix this, supply a path using one of the following formats: ${exampleUrls.join(' or ')}`);
|
|
3636
|
+
}
|
|
3637
|
+
function throwUnexpectedAbsoluteUrlError(path, url) {
|
|
3638
|
+
throw new ɵRuntimeError(2959 /* INVALID_LOADER_ARGUMENTS */, ngDevMode &&
|
|
3639
|
+
`Image loader has detected a \`<img>\` tag with an invalid \`ngSrc\` attribute: ${url}. ` +
|
|
3640
|
+
`This image loader expects \`ngSrc\` to be a relative URL - ` +
|
|
3641
|
+
`however the provided value is an absolute URL. ` +
|
|
3642
|
+
`To fix this, provide \`ngSrc\` as a path relative to the base URL ` +
|
|
3643
|
+
`configured for this loader (\`${path}\`).`);
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3646
|
+
/**
|
|
3647
|
+
* @license
|
|
3648
|
+
* Copyright Google LLC All Rights Reserved.
|
|
3649
|
+
*
|
|
3650
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3651
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3652
|
+
*/
|
|
3653
|
+
/**
|
|
3654
|
+
* Name and URL tester for Cloudinary.
|
|
3655
|
+
*/
|
|
3656
|
+
const cloudinaryLoaderInfo = {
|
|
3657
|
+
name: 'Cloudinary',
|
|
3658
|
+
testUrl: isCloudinaryUrl
|
|
3659
|
+
};
|
|
3660
|
+
const CLOUDINARY_LOADER_REGEX = /https?\:\/\/[^\/]+\.cloudinary\.com\/.+/;
|
|
3661
|
+
/**
|
|
3662
|
+
* Tests whether a URL is from Cloudinary CDN.
|
|
3663
|
+
*/
|
|
3664
|
+
function isCloudinaryUrl(url) {
|
|
3665
|
+
return CLOUDINARY_LOADER_REGEX.test(url);
|
|
3666
|
+
}
|
|
3667
|
+
/**
|
|
3668
|
+
* Function that generates an ImageLoader for Cloudinary and turns it into an Angular provider.
|
|
3669
|
+
*
|
|
3670
|
+
* @param path Base URL of your Cloudinary images
|
|
3671
|
+
* This URL should match one of the following formats:
|
|
3672
|
+
* https://res.cloudinary.com/mysite
|
|
3673
|
+
* https://mysite.cloudinary.com
|
|
3674
|
+
* https://subdomain.mysite.com
|
|
3675
|
+
* @returns Set of providers to configure the Cloudinary loader.
|
|
3676
|
+
*
|
|
3677
|
+
* @publicApi
|
|
3678
|
+
*/
|
|
3679
|
+
const provideCloudinaryLoader = createImageLoader(createCloudinaryUrl, ngDevMode ?
|
|
3680
|
+
[
|
|
3681
|
+
'https://res.cloudinary.com/mysite', 'https://mysite.cloudinary.com',
|
|
3682
|
+
'https://subdomain.mysite.com'
|
|
3683
|
+
] :
|
|
3684
|
+
undefined);
|
|
3685
|
+
// Exported for testing purposes in backport only. Not to be accessed except in unit tests.
|
|
3686
|
+
function createCloudinaryUrl(path, config) {
|
|
3687
|
+
// Cloudinary image URLformat:
|
|
3688
|
+
// https://cloudinary.com/documentation/image_transformations#transformation_url_structure
|
|
3689
|
+
// Example of a Cloudinary image URL:
|
|
3690
|
+
// https://res.cloudinary.com/mysite/image/upload/c_scale,f_auto,q_auto,w_600/marketing/tile-topics-m.png
|
|
3691
|
+
let params = `f_auto,q_auto`; // sets image format and quality to "auto"
|
|
3692
|
+
if (config.width) {
|
|
3693
|
+
params += `,w_${config.width}`;
|
|
3694
|
+
}
|
|
3695
|
+
return `${path}/image/upload/${params}/${config.src}`;
|
|
3696
|
+
}
|
|
3697
|
+
|
|
3698
|
+
/**
|
|
3699
|
+
* @license
|
|
3700
|
+
* Copyright Google LLC All Rights Reserved.
|
|
3701
|
+
*
|
|
3702
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3703
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3704
|
+
*/
|
|
3705
|
+
/**
|
|
3706
|
+
* Name and URL tester for ImageKit.
|
|
3707
|
+
*/
|
|
3708
|
+
const imageKitLoaderInfo = {
|
|
3709
|
+
name: 'ImageKit',
|
|
3710
|
+
testUrl: isImageKitUrl
|
|
3711
|
+
};
|
|
3712
|
+
const IMAGE_KIT_LOADER_REGEX = /https?\:\/\/[^\/]+\.imagekit\.io\/.+/;
|
|
3713
|
+
/**
|
|
3714
|
+
* Tests whether a URL is from ImageKit CDN.
|
|
3715
|
+
*/
|
|
3716
|
+
function isImageKitUrl(url) {
|
|
3717
|
+
return IMAGE_KIT_LOADER_REGEX.test(url);
|
|
3718
|
+
}
|
|
3719
|
+
/**
|
|
3720
|
+
* Function that generates an ImageLoader for ImageKit and turns it into an Angular provider.
|
|
3721
|
+
*
|
|
3722
|
+
* @param path Base URL of your ImageKit images
|
|
3723
|
+
* This URL should match one of the following formats:
|
|
3724
|
+
* https://ik.imagekit.io/myaccount
|
|
3725
|
+
* https://subdomain.mysite.com
|
|
3726
|
+
* @returns Set of providers to configure the ImageKit loader.
|
|
3727
|
+
*
|
|
3728
|
+
* @publicApi
|
|
3729
|
+
*/
|
|
3730
|
+
const provideImageKitLoader = createImageLoader(createImagekitUrl, ngDevMode ? ['https://ik.imagekit.io/mysite', 'https://subdomain.mysite.com'] : undefined);
|
|
3731
|
+
function createImagekitUrl(path, config) {
|
|
3732
|
+
// Example of an ImageKit image URL:
|
|
3733
|
+
// https://ik.imagekit.io/demo/tr:w-300,h-300/medium_cafe_B1iTdD0C.jpg
|
|
3734
|
+
let params = `tr:q-auto`; // applies the "auto quality" transformation
|
|
3735
|
+
if (config.width) {
|
|
3736
|
+
params += `,w-${config.width}`;
|
|
3737
|
+
}
|
|
3738
|
+
return `${path}/${params}/${config.src}`;
|
|
3739
|
+
}
|
|
3740
|
+
|
|
3741
|
+
/**
|
|
3742
|
+
* @license
|
|
3743
|
+
* Copyright Google LLC All Rights Reserved.
|
|
3744
|
+
*
|
|
3745
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3746
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3747
|
+
*/
|
|
3748
|
+
/**
|
|
3749
|
+
* Name and URL tester for Imgix.
|
|
3750
|
+
*/
|
|
3751
|
+
const imgixLoaderInfo = {
|
|
3752
|
+
name: 'Imgix',
|
|
3753
|
+
testUrl: isImgixUrl
|
|
3754
|
+
};
|
|
3755
|
+
const IMGIX_LOADER_REGEX = /https?\:\/\/[^\/]+\.imgix\.net\/.+/;
|
|
3756
|
+
/**
|
|
3757
|
+
* Tests whether a URL is from Imgix CDN.
|
|
3758
|
+
*/
|
|
3759
|
+
function isImgixUrl(url) {
|
|
3760
|
+
return IMGIX_LOADER_REGEX.test(url);
|
|
3761
|
+
}
|
|
3762
|
+
/**
|
|
3763
|
+
* Function that generates an ImageLoader for Imgix and turns it into an Angular provider.
|
|
3764
|
+
*
|
|
3765
|
+
* @param path path to the desired Imgix origin,
|
|
3766
|
+
* e.g. https://somepath.imgix.net or https://images.mysite.com
|
|
3767
|
+
* @returns Set of providers to configure the Imgix loader.
|
|
3768
|
+
*
|
|
3769
|
+
* @publicApi
|
|
3770
|
+
*/
|
|
3771
|
+
const provideImgixLoader = createImageLoader(createImgixUrl, ngDevMode ? ['https://somepath.imgix.net/'] : undefined);
|
|
3772
|
+
// Exported for testing purposes in backport only. Not to be accessed except in unit tests.
|
|
3773
|
+
function createImgixUrl(path, config) {
|
|
3774
|
+
const url = new URL(`${path}/${config.src}`);
|
|
3775
|
+
// This setting ensures the smallest allowable format is set.
|
|
3776
|
+
url.searchParams.set('auto', 'format');
|
|
3777
|
+
if (config.width) {
|
|
3778
|
+
url.searchParams.set('w', config.width.toString());
|
|
3779
|
+
}
|
|
3780
|
+
return url.href;
|
|
3781
|
+
}
|
|
3782
|
+
|
|
3783
|
+
/**
|
|
3784
|
+
* @license
|
|
3785
|
+
* Copyright Google LLC All Rights Reserved.
|
|
3786
|
+
*
|
|
3787
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3788
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3789
|
+
*/
|
|
3790
|
+
/**
|
|
3791
|
+
* Asserts that the application is in development mode. Throws an error if the application is in
|
|
3792
|
+
* production mode. This assert can be used to make sure that there is no dev-mode code invoked in
|
|
3793
|
+
* the prod mode accidentally.
|
|
3794
|
+
*/
|
|
3795
|
+
function assertDevMode(checkName) {
|
|
3796
|
+
if (!ngDevMode) {
|
|
3797
|
+
throw new ɵRuntimeError(2958 /* UNEXPECTED_DEV_MODE_CHECK_IN_PROD_MODE */, `Unexpected invocation of the ${checkName} in the prod mode. ` +
|
|
3798
|
+
`Please make sure that the prod mode is enabled for production builds.`);
|
|
3799
|
+
}
|
|
3800
|
+
}
|
|
3801
|
+
|
|
3802
|
+
/**
|
|
3803
|
+
* @license
|
|
3804
|
+
* Copyright Google LLC All Rights Reserved.
|
|
3805
|
+
*
|
|
3806
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3807
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3808
|
+
*/
|
|
3809
|
+
/**
|
|
3810
|
+
* Observer that detects whether an image with `NgOptimizedImage`
|
|
3811
|
+
* is treated as a Largest Contentful Paint (LCP) element. If so,
|
|
3812
|
+
* asserts that the image has the `priority` attribute.
|
|
3813
|
+
*
|
|
3814
|
+
* Note: this is a dev-mode only class and it does not appear in prod bundles,
|
|
3815
|
+
* thus there is no `ngDevMode` use in the code.
|
|
3816
|
+
*
|
|
3817
|
+
* Based on https://web.dev/lcp/#measure-lcp-in-javascript.
|
|
3818
|
+
*/
|
|
3819
|
+
class LCPImageObserver {
|
|
3820
|
+
constructor() {
|
|
3821
|
+
// Map of full image URLs -> original `ngSrc` values.
|
|
3822
|
+
this.images = new Map();
|
|
3823
|
+
// Keep track of images for which `console.warn` was produced.
|
|
3824
|
+
this.alreadyWarned = new Set();
|
|
3825
|
+
this.window = null;
|
|
3826
|
+
this.observer = null;
|
|
3827
|
+
assertDevMode('LCP checker');
|
|
3828
|
+
const win = inject(DOCUMENT).defaultView;
|
|
3829
|
+
if (typeof win !== 'undefined' && typeof PerformanceObserver !== 'undefined') {
|
|
3830
|
+
this.window = win;
|
|
3831
|
+
this.observer = this.initPerformanceObserver();
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
/**
|
|
3835
|
+
* Inits PerformanceObserver and subscribes to LCP events.
|
|
3836
|
+
* Based on https://web.dev/lcp/#measure-lcp-in-javascript
|
|
3837
|
+
*/
|
|
3838
|
+
initPerformanceObserver() {
|
|
3839
|
+
const observer = new PerformanceObserver((entryList) => {
|
|
3840
|
+
const entries = entryList.getEntries();
|
|
3841
|
+
if (entries.length === 0)
|
|
3842
|
+
return;
|
|
3843
|
+
// We use the latest entry produced by the `PerformanceObserver` as the best
|
|
3844
|
+
// signal on which element is actually an LCP one. As an example, the first image to load on
|
|
3845
|
+
// a page, by virtue of being the only thing on the page so far, is often a LCP candidate
|
|
3846
|
+
// and gets reported by PerformanceObserver, but isn't necessarily the LCP element.
|
|
3847
|
+
const lcpElement = entries[entries.length - 1];
|
|
3848
|
+
// Cast to `any` due to missing `element` on the `LargestContentfulPaint` type of entry.
|
|
3849
|
+
// See https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint
|
|
3850
|
+
const imgSrc = lcpElement.element?.src ?? '';
|
|
3851
|
+
// Exclude `data:` and `blob:` URLs, since they are not supported by the directive.
|
|
3852
|
+
if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:'))
|
|
3853
|
+
return;
|
|
3854
|
+
const imgNgSrc = this.images.get(imgSrc);
|
|
3855
|
+
if (imgNgSrc && !this.alreadyWarned.has(imgSrc)) {
|
|
3856
|
+
this.alreadyWarned.add(imgSrc);
|
|
3857
|
+
logMissingPriorityWarning(imgSrc);
|
|
3858
|
+
}
|
|
3859
|
+
});
|
|
3860
|
+
observer.observe({ type: 'largest-contentful-paint', buffered: true });
|
|
3861
|
+
return observer;
|
|
3862
|
+
}
|
|
3863
|
+
registerImage(rewrittenSrc, originalNgSrc) {
|
|
3864
|
+
if (!this.observer)
|
|
3865
|
+
return;
|
|
3866
|
+
this.images.set(getUrl(rewrittenSrc, this.window).href, originalNgSrc);
|
|
3867
|
+
}
|
|
3868
|
+
unregisterImage(rewrittenSrc) {
|
|
3869
|
+
if (!this.observer)
|
|
3870
|
+
return;
|
|
3871
|
+
this.images.delete(getUrl(rewrittenSrc, this.window).href);
|
|
3872
|
+
}
|
|
3873
|
+
ngOnDestroy() {
|
|
3874
|
+
if (!this.observer)
|
|
3875
|
+
return;
|
|
3876
|
+
this.observer.disconnect();
|
|
3877
|
+
this.images.clear();
|
|
3878
|
+
this.alreadyWarned.clear();
|
|
3879
|
+
}
|
|
3880
|
+
}
|
|
3881
|
+
LCPImageObserver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LCPImageObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3882
|
+
LCPImageObserver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LCPImageObserver, providedIn: 'root' });
|
|
3883
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LCPImageObserver, decorators: [{
|
|
3884
|
+
type: Injectable,
|
|
3885
|
+
args: [{ providedIn: 'root' }]
|
|
3886
|
+
}], ctorParameters: function () { return []; } });
|
|
3887
|
+
function logMissingPriorityWarning(ngSrc) {
|
|
3888
|
+
const directiveDetails = imgDirectiveDetails(ngSrc);
|
|
3889
|
+
console.warn(ɵformatRuntimeError(2955 /* LCP_IMG_MISSING_PRIORITY */, `${directiveDetails} this image is the Largest Contentful Paint (LCP) ` +
|
|
3890
|
+
`element but was not marked "priority". This image should be marked ` +
|
|
3891
|
+
`"priority" in order to prioritize its loading. ` +
|
|
3892
|
+
`To fix this, add the "priority" attribute.`));
|
|
3893
|
+
}
|
|
3894
|
+
|
|
3895
|
+
/**
|
|
3896
|
+
* @license
|
|
3897
|
+
* Copyright Google LLC All Rights Reserved.
|
|
3898
|
+
*
|
|
3899
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3900
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3901
|
+
*/
|
|
3902
|
+
// Set of origins that are always excluded from the preconnect checks.
|
|
3903
|
+
const INTERNAL_PRECONNECT_CHECK_BLOCKLIST = new Set(['localhost', '127.0.0.1', '0.0.0.0']);
|
|
3904
|
+
/**
|
|
3905
|
+
* Injection token to configure which origins should be excluded
|
|
3906
|
+
* from the preconnect checks. It can either be a single string or an array of strings
|
|
3907
|
+
* to represent a group of origins, for example:
|
|
3908
|
+
*
|
|
3909
|
+
* ```typescript
|
|
3910
|
+
* {provide: PRECONNECT_CHECK_BLOCKLIST, useValue: 'https://your-domain.com'}
|
|
3911
|
+
* ```
|
|
3912
|
+
*
|
|
3913
|
+
* or:
|
|
3914
|
+
*
|
|
3915
|
+
* ```typescript
|
|
3916
|
+
* {provide: PRECONNECT_CHECK_BLOCKLIST,
|
|
3917
|
+
* useValue: ['https://your-domain-1.com', 'https://your-domain-2.com']}
|
|
3918
|
+
* ```
|
|
3919
|
+
*
|
|
3920
|
+
* @publicApi
|
|
3921
|
+
*/
|
|
3922
|
+
const PRECONNECT_CHECK_BLOCKLIST = new InjectionToken('PRECONNECT_CHECK_BLOCKLIST');
|
|
3923
|
+
/**
|
|
3924
|
+
* Contains the logic to detect whether an image, marked with the "priority" attribute
|
|
3925
|
+
* has a corresponding `<link rel="preconnect">` tag in the `document.head`.
|
|
3926
|
+
*
|
|
3927
|
+
* Note: this is a dev-mode only class, which should not appear in prod bundles,
|
|
3928
|
+
* thus there is no `ngDevMode` use in the code.
|
|
3929
|
+
*/
|
|
3930
|
+
class PreconnectLinkChecker {
|
|
3931
|
+
constructor() {
|
|
3932
|
+
/**
|
|
3933
|
+
* Set of <link rel="preconnect"> tags found on this page.
|
|
3934
|
+
* The `null` value indicates that there was no DOM query operation performed.
|
|
3935
|
+
*/
|
|
3936
|
+
this.preconnectLinks = null;
|
|
3937
|
+
/*
|
|
3938
|
+
* Keep track of all already seen origin URLs to avoid repeating the same check.
|
|
3939
|
+
*/
|
|
3940
|
+
this.alreadySeen = new Set();
|
|
3941
|
+
this.window = null;
|
|
3942
|
+
this.blocklist = new Set(INTERNAL_PRECONNECT_CHECK_BLOCKLIST);
|
|
3943
|
+
this.document = inject(DOCUMENT);
|
|
3944
|
+
assertDevMode('preconnect link checker');
|
|
3945
|
+
const win = this.document.defaultView;
|
|
3946
|
+
if (typeof win !== 'undefined') {
|
|
3947
|
+
this.window = win;
|
|
3948
|
+
}
|
|
3949
|
+
const blocklist = inject(PRECONNECT_CHECK_BLOCKLIST, InjectFlags.Optional);
|
|
3950
|
+
if (blocklist) {
|
|
3951
|
+
this.populateBlocklist(blocklist);
|
|
3952
|
+
}
|
|
3953
|
+
}
|
|
3954
|
+
populateBlocklist(origins) {
|
|
3955
|
+
if (Array.isArray(origins)) {
|
|
3956
|
+
deepForEach(origins, origin => {
|
|
3957
|
+
this.blocklist.add(extractHostname(origin));
|
|
3958
|
+
});
|
|
3959
|
+
}
|
|
3960
|
+
else {
|
|
3961
|
+
this.blocklist.add(extractHostname(origins));
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3964
|
+
/**
|
|
3965
|
+
* Checks that a preconnect resource hint exists in the head for the
|
|
3966
|
+
* given src.
|
|
3967
|
+
*
|
|
3968
|
+
* @param rewrittenSrc src formatted with loader
|
|
3969
|
+
* @param originalNgSrc ngSrc value
|
|
3970
|
+
*/
|
|
3971
|
+
assertPreconnect(rewrittenSrc, originalNgSrc) {
|
|
3972
|
+
if (!this.window)
|
|
3973
|
+
return;
|
|
3974
|
+
const imgUrl = getUrl(rewrittenSrc, this.window);
|
|
3975
|
+
if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin))
|
|
3976
|
+
return;
|
|
3977
|
+
// Register this origin as seen, so we don't check it again later.
|
|
3978
|
+
this.alreadySeen.add(imgUrl.origin);
|
|
3979
|
+
if (!this.preconnectLinks) {
|
|
3980
|
+
// Note: we query for preconnect links only *once* and cache the results
|
|
3981
|
+
// for the entire lifespan of an application, since it's unlikely that the
|
|
3982
|
+
// list would change frequently. This allows to make sure there are no
|
|
3983
|
+
// performance implications of making extra DOM lookups for each image.
|
|
3984
|
+
this.preconnectLinks = this.queryPreconnectLinks();
|
|
3985
|
+
}
|
|
3986
|
+
if (!this.preconnectLinks.has(imgUrl.origin)) {
|
|
3987
|
+
console.warn(ɵformatRuntimeError(2956 /* PRIORITY_IMG_MISSING_PRECONNECT_TAG */, `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this ` +
|
|
3988
|
+
`image. Preconnecting to the origin(s) that serve priority images ensures that these ` +
|
|
3989
|
+
`images are delivered as soon as possible. To fix this, please add the following ` +
|
|
3990
|
+
`element into the <head> of the document:\n` +
|
|
3991
|
+
` <link rel="preconnect" href="${imgUrl.origin}">`));
|
|
3992
|
+
}
|
|
3993
|
+
}
|
|
3994
|
+
queryPreconnectLinks() {
|
|
3995
|
+
const preconnectUrls = new Set();
|
|
3996
|
+
const selector = 'link[rel=preconnect]';
|
|
3997
|
+
const links = Array.from(this.document.querySelectorAll(selector));
|
|
3998
|
+
for (let link of links) {
|
|
3999
|
+
const url = getUrl(link.href, this.window);
|
|
4000
|
+
preconnectUrls.add(url.origin);
|
|
4001
|
+
}
|
|
4002
|
+
return preconnectUrls;
|
|
4003
|
+
}
|
|
4004
|
+
ngOnDestroy() {
|
|
4005
|
+
this.preconnectLinks?.clear();
|
|
4006
|
+
this.alreadySeen.clear();
|
|
4007
|
+
}
|
|
4008
|
+
}
|
|
4009
|
+
PreconnectLinkChecker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PreconnectLinkChecker, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4010
|
+
PreconnectLinkChecker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PreconnectLinkChecker, providedIn: 'root' });
|
|
4011
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PreconnectLinkChecker, decorators: [{
|
|
4012
|
+
type: Injectable,
|
|
4013
|
+
args: [{ providedIn: 'root' }]
|
|
4014
|
+
}], ctorParameters: function () { return []; } });
|
|
4015
|
+
/**
|
|
4016
|
+
* Invokes a callback for each element in the array. Also invokes a callback
|
|
4017
|
+
* recursively for each nested array.
|
|
4018
|
+
*/
|
|
4019
|
+
function deepForEach(input, fn) {
|
|
4020
|
+
for (let value of input) {
|
|
4021
|
+
Array.isArray(value) ? deepForEach(value, fn) : fn(value);
|
|
4022
|
+
}
|
|
4023
|
+
}
|
|
4024
|
+
|
|
4025
|
+
/**
|
|
4026
|
+
* @license
|
|
4027
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4028
|
+
*
|
|
4029
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
4030
|
+
* found in the LICENSE file at https://angular.io/license
|
|
4031
|
+
*/
|
|
4032
|
+
/**
|
|
4033
|
+
* In SSR scenarios, a preload `<link>` element is generated for priority images.
|
|
4034
|
+
* Having a large number of preload tags may negatively affect the performance,
|
|
4035
|
+
* so we warn developers (by throwing an error) if the number of preloaded images
|
|
4036
|
+
* is above a certain threshold. This const specifies this threshold.
|
|
4037
|
+
*/
|
|
4038
|
+
const DEFAULT_PRELOADED_IMAGES_LIMIT = 5;
|
|
4039
|
+
/**
|
|
4040
|
+
* Helps to keep track of priority images that already have a corresponding
|
|
4041
|
+
* preload tag (to avoid generating multiple preload tags with the same URL).
|
|
4042
|
+
*
|
|
4043
|
+
* This Set tracks the original src passed into the `ngSrc` input not the src after it has been
|
|
4044
|
+
* run through the specified `IMAGE_LOADER`.
|
|
4045
|
+
*/
|
|
4046
|
+
const PRELOADED_IMAGES = new InjectionToken('NG_OPTIMIZED_PRELOADED_IMAGES', { providedIn: 'root', factory: () => new Set() });
|
|
4047
|
+
|
|
4048
|
+
/**
|
|
4049
|
+
* @license
|
|
4050
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4051
|
+
*
|
|
4052
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
4053
|
+
* found in the LICENSE file at https://angular.io/license
|
|
4054
|
+
*/
|
|
4055
|
+
/**
|
|
4056
|
+
* @description Contains the logic needed to track and add preload link tags to the `<head>` tag. It
|
|
4057
|
+
* will also track what images have already had preload link tags added so as to not duplicate link
|
|
4058
|
+
* tags.
|
|
4059
|
+
*
|
|
4060
|
+
* In dev mode this service will validate that the number of preloaded images does not exceed the
|
|
4061
|
+
* configured default preloaded images limit: {@link DEFAULT_PRELOADED_IMAGES_LIMIT}.
|
|
4062
|
+
*/
|
|
4063
|
+
class PreloadLinkCreator {
|
|
4064
|
+
constructor() {
|
|
4065
|
+
this.preloadedImages = inject(PRELOADED_IMAGES);
|
|
4066
|
+
this.document = inject(DOCUMENT);
|
|
4067
|
+
}
|
|
4068
|
+
/**
|
|
4069
|
+
* @description Add a preload `<link>` to the `<head>` of the `index.html` that is served from the
|
|
4070
|
+
* server while using Angular Universal and SSR to kick off image loads for high priority images.
|
|
4071
|
+
*
|
|
4072
|
+
* The `sizes` (passed in from the user) and `srcset` (parsed and formatted from `ngSrcset`)
|
|
4073
|
+
* properties used to set the corresponding attributes, `imagesizes` and `imagesrcset`
|
|
4074
|
+
* respectively, on the preload `<link>` tag so that the correctly sized image is preloaded from
|
|
4075
|
+
* the CDN.
|
|
4076
|
+
*
|
|
4077
|
+
* {@link https://web.dev/preload-responsive-images/#imagesrcset-and-imagesizes}
|
|
4078
|
+
*
|
|
4079
|
+
* @param renderer The `Renderer2` passed in from the directive
|
|
4080
|
+
* @param src The original src of the image that is set on the `ngSrc` input.
|
|
4081
|
+
* @param srcset The parsed and formatted srcset created from the `ngSrcset` input
|
|
4082
|
+
* @param sizes The value of the `sizes` attribute passed in to the `<img>` tag
|
|
4083
|
+
*/
|
|
4084
|
+
createPreloadLinkTag(renderer, src, srcset, sizes) {
|
|
4085
|
+
if (ngDevMode) {
|
|
4086
|
+
if (this.preloadedImages.size >= DEFAULT_PRELOADED_IMAGES_LIMIT) {
|
|
4087
|
+
throw new ɵRuntimeError(2961 /* TOO_MANY_PRELOADED_IMAGES */, ngDevMode &&
|
|
4088
|
+
`The \`NgOptimizedImage\` directive has detected that more than ` +
|
|
4089
|
+
`${DEFAULT_PRELOADED_IMAGES_LIMIT} images were marked as priority. ` +
|
|
4090
|
+
`This might negatively affect an overall performance of the page. ` +
|
|
4091
|
+
`To fix this, remove the "priority" attribute from images with less priority.`);
|
|
4092
|
+
}
|
|
4093
|
+
}
|
|
4094
|
+
if (this.preloadedImages.has(src)) {
|
|
4095
|
+
return;
|
|
4096
|
+
}
|
|
4097
|
+
this.preloadedImages.add(src);
|
|
4098
|
+
const preload = renderer.createElement('link');
|
|
4099
|
+
renderer.setAttribute(preload, 'as', 'image');
|
|
4100
|
+
renderer.setAttribute(preload, 'href', src);
|
|
4101
|
+
renderer.setAttribute(preload, 'rel', 'preload');
|
|
4102
|
+
renderer.setAttribute(preload, 'fetchpriority', 'high');
|
|
4103
|
+
if (sizes) {
|
|
4104
|
+
renderer.setAttribute(preload, 'imageSizes', sizes);
|
|
4105
|
+
}
|
|
4106
|
+
if (srcset) {
|
|
4107
|
+
renderer.setAttribute(preload, 'imageSrcset', srcset);
|
|
4108
|
+
}
|
|
4109
|
+
renderer.appendChild(this.document.head, preload);
|
|
4110
|
+
}
|
|
4111
|
+
}
|
|
4112
|
+
PreloadLinkCreator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PreloadLinkCreator, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4113
|
+
PreloadLinkCreator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PreloadLinkCreator, providedIn: 'root' });
|
|
4114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PreloadLinkCreator, decorators: [{
|
|
4115
|
+
type: Injectable,
|
|
4116
|
+
args: [{ providedIn: 'root' }]
|
|
4117
|
+
}], ctorParameters: function () { return []; } });
|
|
4118
|
+
|
|
4119
|
+
/**
|
|
4120
|
+
* @license
|
|
4121
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4122
|
+
*
|
|
4123
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
4124
|
+
* found in the LICENSE file at https://angular.io/license
|
|
4125
|
+
*/
|
|
4126
|
+
/**
|
|
4127
|
+
* When a Base64-encoded image is passed as an input to the `NgOptimizedImage` directive,
|
|
4128
|
+
* an error is thrown. The image content (as a string) might be very long, thus making
|
|
4129
|
+
* it hard to read an error message if the entire string is included. This const defines
|
|
4130
|
+
* the number of characters that should be included into the error message. The rest
|
|
4131
|
+
* of the content is truncated.
|
|
4132
|
+
*/
|
|
4133
|
+
const BASE64_IMG_MAX_LENGTH_IN_ERROR = 50;
|
|
4134
|
+
/**
|
|
4135
|
+
* RegExpr to determine whether a src in a srcset is using width descriptors.
|
|
4136
|
+
* Should match something like: "100w, 200w".
|
|
4137
|
+
*/
|
|
4138
|
+
const VALID_WIDTH_DESCRIPTOR_SRCSET = /^((\s*\d+w\s*(,|$)){1,})$/;
|
|
4139
|
+
/**
|
|
4140
|
+
* RegExpr to determine whether a src in a srcset is using density descriptors.
|
|
4141
|
+
* Should match something like: "1x, 2x, 50x". Also supports decimals like "1.5x, 1.50x".
|
|
4142
|
+
*/
|
|
4143
|
+
const VALID_DENSITY_DESCRIPTOR_SRCSET = /^((\s*\d+(\.\d+)?x\s*(,|$)){1,})$/;
|
|
4144
|
+
/**
|
|
4145
|
+
* Srcset values with a density descriptor higher than this value will actively
|
|
4146
|
+
* throw an error. Such densities are not permitted as they cause image sizes
|
|
4147
|
+
* to be unreasonably large and slow down LCP.
|
|
4148
|
+
*/
|
|
4149
|
+
const ABSOLUTE_SRCSET_DENSITY_CAP = 3;
|
|
4150
|
+
/**
|
|
4151
|
+
* Used only in error message text to communicate best practices, as we will
|
|
4152
|
+
* only throw based on the slightly more conservative ABSOLUTE_SRCSET_DENSITY_CAP.
|
|
4153
|
+
*/
|
|
4154
|
+
const RECOMMENDED_SRCSET_DENSITY_CAP = 2;
|
|
4155
|
+
/**
|
|
4156
|
+
* Used in generating automatic density-based srcsets
|
|
4157
|
+
*/
|
|
4158
|
+
const DENSITY_SRCSET_MULTIPLIERS = [1, 2];
|
|
4159
|
+
/**
|
|
4160
|
+
* Used to determine which breakpoints to use on full-width images
|
|
4161
|
+
*/
|
|
4162
|
+
const VIEWPORT_BREAKPOINT_CUTOFF = 640;
|
|
4163
|
+
/**
|
|
4164
|
+
* Used to determine whether two aspect ratios are similar in value.
|
|
4165
|
+
*/
|
|
4166
|
+
const ASPECT_RATIO_TOLERANCE = .1;
|
|
4167
|
+
/**
|
|
4168
|
+
* Used to determine whether the image has been requested at an overly
|
|
4169
|
+
* large size compared to the actual rendered image size (after taking
|
|
4170
|
+
* into account a typical device pixel ratio). In pixels.
|
|
4171
|
+
*/
|
|
4172
|
+
const OVERSIZED_IMAGE_TOLERANCE = 1000;
|
|
4173
|
+
/**
|
|
4174
|
+
* Used to limit automatic srcset generation of very large sources for
|
|
4175
|
+
* fixed-size images. In pixels.
|
|
4176
|
+
*/
|
|
4177
|
+
const FIXED_SRCSET_WIDTH_LIMIT = 1920;
|
|
4178
|
+
const FIXED_SRCSET_HEIGHT_LIMIT = 1080;
|
|
4179
|
+
/** Info about built-in loaders we can test for. */
|
|
4180
|
+
const BUILT_IN_LOADERS = [imgixLoaderInfo, imageKitLoaderInfo, cloudinaryLoaderInfo];
|
|
4181
|
+
const defaultConfig = {
|
|
4182
|
+
breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],
|
|
4183
|
+
};
|
|
4184
|
+
/**
|
|
4185
|
+
* Injection token that configures the image optimized image functionality.
|
|
4186
|
+
*
|
|
4187
|
+
* @see `NgOptimizedImage`
|
|
4188
|
+
* @publicApi
|
|
4189
|
+
*/
|
|
4190
|
+
const IMAGE_CONFIG = new InjectionToken('ImageConfig', { providedIn: 'root', factory: () => defaultConfig });
|
|
4191
|
+
/**
|
|
4192
|
+
* @ngModule NgOptimizedImageModule
|
|
4193
|
+
*
|
|
4194
|
+
* @description
|
|
4195
|
+
*
|
|
4196
|
+
* Directive that improves image loading performance by enforcing best practices.
|
|
4197
|
+
*
|
|
4198
|
+
* `NgOptimizedImage` ensures that the loading of the Largest Contentful Paint (LCP) image is
|
|
4199
|
+
* prioritized by:
|
|
4200
|
+
* - Automatically setting the `fetchpriority` attribute on the `<img>` tag
|
|
4201
|
+
* - Lazy loading non-priority images by default
|
|
4202
|
+
* - Asserting that there is a corresponding preconnect link tag in the document head
|
|
4203
|
+
*
|
|
4204
|
+
* In addition, the directive:
|
|
4205
|
+
* - Generates appropriate asset URLs if a corresponding `ImageLoader` function is provided
|
|
4206
|
+
* - Automatically generates a srcset
|
|
4207
|
+
* - Requires that `width` and `height` are set
|
|
4208
|
+
* - Warns if `width` or `height` have been set incorrectly
|
|
4209
|
+
* - Warns if the image will be visually distorted when rendered
|
|
4210
|
+
*
|
|
4211
|
+
* @usageNotes
|
|
4212
|
+
*
|
|
4213
|
+
* Follow the steps below to enable and use the directive:
|
|
4214
|
+
* 1. Import it into the necessary NgModule Component.
|
|
4215
|
+
* 2. Optionally provide an `ImageLoader` if you use an image hosting service.
|
|
4216
|
+
* 3. Update the necessary `<img>` tags in templates and replace `src` attributes with `ngSrc`.
|
|
4217
|
+
* Using a `ngSrc` allows the directive to control when the `src` gets set, which triggers an image
|
|
4218
|
+
* download.
|
|
4219
|
+
*
|
|
4220
|
+
* Step 1: import the `NgOptimizedImage` directive.
|
|
4221
|
+
*
|
|
4222
|
+
* ```typescript
|
|
4223
|
+
* import { NgOptimizedImageModule } from '@angular/common';
|
|
4224
|
+
*
|
|
4225
|
+
* // Include it into the necessary NgModule
|
|
4226
|
+
* @NgModule({
|
|
4227
|
+
* imports: [NgOptimizedImageModule],
|
|
4228
|
+
* })
|
|
4229
|
+
* class AppModule {}
|
|
4230
|
+
*
|
|
4231
|
+
*
|
|
4232
|
+
* Step 2: configure a loader.
|
|
4233
|
+
*
|
|
4234
|
+
* To use the **default loader**: no additional code changes are necessary. The URL returned by the
|
|
4235
|
+
* generic loader will always match the value of "src". In other words, this loader applies no
|
|
4236
|
+
* transformations to the resource URL and the value of the `ngSrc` attribute will be used as is.
|
|
4237
|
+
*
|
|
4238
|
+
* To use an existing loader for a **third-party image service**: add the provider factory for your
|
|
4239
|
+
* chosen service to the `providers` array. In the example below, the Imgix loader is used:
|
|
4240
|
+
*
|
|
4241
|
+
* ```typescript
|
|
4242
|
+
* import {provideImgixLoader} from '@angular/common';
|
|
4243
|
+
*
|
|
4244
|
+
* // Call the function and add the result to the `providers` array:
|
|
4245
|
+
* providers: [
|
|
4246
|
+
* provideImgixLoader("https://my.base.url/"),
|
|
4247
|
+
* ],
|
|
4248
|
+
* ```
|
|
4249
|
+
*
|
|
4250
|
+
* The `NgOptimizedImage` directive provides the following functions:
|
|
4251
|
+
* - `provideCloudflareLoader`
|
|
4252
|
+
* - `provideCloudinaryLoader`
|
|
4253
|
+
* - `provideImageKitLoader`
|
|
4254
|
+
* - `provideImgixLoader`
|
|
4255
|
+
*
|
|
4256
|
+
* If you use a different image provider, you can create a custom loader function as described
|
|
4257
|
+
* below.
|
|
4258
|
+
*
|
|
4259
|
+
* To use a **custom loader**: provide your loader function as a value for the `IMAGE_LOADER` DI
|
|
4260
|
+
* token.
|
|
4261
|
+
*
|
|
4262
|
+
* ```typescript
|
|
4263
|
+
* import {IMAGE_LOADER, ImageLoaderConfig} from '@angular/common';
|
|
4264
|
+
*
|
|
4265
|
+
* // Configure the loader using the `IMAGE_LOADER` token.
|
|
4266
|
+
* providers: [
|
|
4267
|
+
* {
|
|
4268
|
+
* provide: IMAGE_LOADER,
|
|
4269
|
+
* useValue: (config: ImageLoaderConfig) => {
|
|
4270
|
+
* return `https://example.com/${config.src}-${config.width}.jpg}`;
|
|
4271
|
+
* }
|
|
4272
|
+
* },
|
|
4273
|
+
* ],
|
|
4274
|
+
* ```
|
|
4275
|
+
*
|
|
4276
|
+
* Step 3: update `<img>` tags in templates to use `ngSrc` instead of `src`.
|
|
4277
|
+
*
|
|
4278
|
+
* ```
|
|
4279
|
+
* <img ngSrc="logo.png" width="200" height="100">
|
|
4280
|
+
* ```
|
|
4281
|
+
*
|
|
4282
|
+
* @publicApi
|
|
4283
|
+
*/
|
|
4284
|
+
class NgOptimizedImage {
|
|
4285
|
+
constructor(imageLoader, config, renderer, elementRef, injector, platformId, preloadLinkChecker) {
|
|
4286
|
+
this.imageLoader = imageLoader;
|
|
4287
|
+
this.config = config;
|
|
4288
|
+
this.renderer = renderer;
|
|
4289
|
+
this.elementRef = elementRef;
|
|
4290
|
+
this.injector = injector;
|
|
4291
|
+
this.platformId = platformId;
|
|
4292
|
+
this.preloadLinkChecker = preloadLinkChecker;
|
|
4293
|
+
/**
|
|
4294
|
+
* Calculate the rewritten `src` once and store it.
|
|
4295
|
+
* This is needed to avoid repetitive calculations and make sure the directive cleanup in the
|
|
4296
|
+
* `ngOnDestroy` does not rely on the `IMAGE_LOADER` logic (which in turn can rely on some other
|
|
4297
|
+
* instance that might be already destroyed).
|
|
4298
|
+
*/
|
|
4299
|
+
this._renderedSrc = null;
|
|
4300
|
+
this._priority = false;
|
|
4301
|
+
this._disableOptimizedSrcset = false;
|
|
4302
|
+
this._fill = false;
|
|
4303
|
+
this.config = processConfig(this.config);
|
|
4304
|
+
this.imgElement = this.elementRef.nativeElement;
|
|
4305
|
+
this.lcpObserver = ngDevMode ? this.injector.get(LCPImageObserver) : null;
|
|
4306
|
+
}
|
|
4307
|
+
/**
|
|
4308
|
+
* For responsive images: the intrinsic width of the image in pixels.
|
|
4309
|
+
* For fixed size images: the desired rendered width of the image in pixels.
|
|
4310
|
+
*/
|
|
4311
|
+
set width(value) {
|
|
4312
|
+
ngDevMode && assertGreaterThanZero(this, value, 'width');
|
|
4313
|
+
this._width = inputToInteger(value);
|
|
4314
|
+
}
|
|
4315
|
+
get width() {
|
|
4316
|
+
return this._width;
|
|
4317
|
+
}
|
|
4318
|
+
/**
|
|
4319
|
+
* For responsive images: the intrinsic height of the image in pixels.
|
|
4320
|
+
* For fixed size images: the desired rendered height of the image in pixels.* The intrinsic
|
|
4321
|
+
* height of the image in pixels.
|
|
4322
|
+
*/
|
|
4323
|
+
set height(value) {
|
|
4324
|
+
ngDevMode && assertGreaterThanZero(this, value, 'height');
|
|
4325
|
+
this._height = inputToInteger(value);
|
|
4326
|
+
}
|
|
4327
|
+
get height() {
|
|
4328
|
+
return this._height;
|
|
4329
|
+
}
|
|
4330
|
+
/**
|
|
4331
|
+
* Indicates whether this image should have a high priority.
|
|
4332
|
+
*/
|
|
4333
|
+
set priority(value) {
|
|
4334
|
+
this._priority = inputToBoolean(value);
|
|
4335
|
+
}
|
|
4336
|
+
get priority() {
|
|
4337
|
+
return this._priority;
|
|
4338
|
+
}
|
|
4339
|
+
/**
|
|
4340
|
+
* Disables automatic srcset generation for this image.
|
|
4341
|
+
*/
|
|
4342
|
+
set disableOptimizedSrcset(value) {
|
|
4343
|
+
this._disableOptimizedSrcset = inputToBoolean(value);
|
|
4344
|
+
}
|
|
4345
|
+
get disableOptimizedSrcset() {
|
|
4346
|
+
return this._disableOptimizedSrcset;
|
|
4347
|
+
}
|
|
4348
|
+
/**
|
|
4349
|
+
* Sets the image to "fill mode", which eliminates the height/width requirement and adds
|
|
4350
|
+
* styles such that the image fills its containing element.
|
|
4351
|
+
*/
|
|
4352
|
+
set fill(value) {
|
|
4353
|
+
this._fill = inputToBoolean(value);
|
|
4354
|
+
}
|
|
4355
|
+
get fill() {
|
|
4356
|
+
return this._fill;
|
|
4357
|
+
}
|
|
4358
|
+
/** @nodoc */
|
|
4359
|
+
ngOnInit() {
|
|
4360
|
+
if (ngDevMode) {
|
|
4361
|
+
assertNonEmptyInput(this, 'ngSrc', this.ngSrc);
|
|
4362
|
+
assertValidNgSrcset(this, this.ngSrcset);
|
|
4363
|
+
assertNoConflictingSrc(this);
|
|
4364
|
+
if (this.ngSrcset) {
|
|
4365
|
+
assertNoConflictingSrcset(this);
|
|
4366
|
+
}
|
|
4367
|
+
assertNotBase64Image(this);
|
|
4368
|
+
assertNotBlobUrl(this);
|
|
4369
|
+
if (this.fill) {
|
|
4370
|
+
assertEmptyWidthAndHeight(this);
|
|
4371
|
+
assertNonZeroRenderedHeight(this, this.imgElement, this.renderer);
|
|
4372
|
+
}
|
|
4373
|
+
else {
|
|
4374
|
+
assertNonEmptyWidthAndHeight(this);
|
|
4375
|
+
// Only check for distorted images when not in fill mode, where
|
|
4376
|
+
// images may be intentionally stretched, cropped or letterboxed.
|
|
4377
|
+
assertNoImageDistortion(this, this.imgElement, this.renderer);
|
|
4378
|
+
}
|
|
4379
|
+
assertValidLoadingInput(this);
|
|
4380
|
+
if (!this.ngSrcset) {
|
|
4381
|
+
assertNoComplexSizes(this);
|
|
4382
|
+
}
|
|
4383
|
+
assertNotMissingBuiltInLoader(this.ngSrc, this.imageLoader);
|
|
4384
|
+
assertNoNgSrcsetWithoutLoader(this, this.imageLoader);
|
|
4385
|
+
assertNoLoaderParamsWithoutLoader(this, this.imageLoader);
|
|
4386
|
+
if (this.priority) {
|
|
4387
|
+
const checker = this.injector.get(PreconnectLinkChecker);
|
|
4388
|
+
checker.assertPreconnect(this.getRewrittenSrc(), this.ngSrc);
|
|
4389
|
+
}
|
|
4390
|
+
else {
|
|
4391
|
+
// Monitor whether an image is an LCP element only in case
|
|
4392
|
+
// the `priority` attribute is missing. Otherwise, an image
|
|
4393
|
+
// has the necessary settings and no extra checks are required.
|
|
4394
|
+
if (this.lcpObserver !== null) {
|
|
4395
|
+
const ngZone = this.injector.get(NgZone);
|
|
4396
|
+
ngZone.runOutsideAngular(() => {
|
|
4397
|
+
this.lcpObserver.registerImage(this.getRewrittenSrc(), this.ngSrc);
|
|
4398
|
+
});
|
|
4399
|
+
}
|
|
4400
|
+
}
|
|
4401
|
+
}
|
|
4402
|
+
this.setHostAttributes();
|
|
4403
|
+
}
|
|
4404
|
+
setHostAttributes() {
|
|
4405
|
+
// Must set width/height explicitly in case they are bound (in which case they will
|
|
4406
|
+
// only be reflected and not found by the browser)
|
|
4407
|
+
if (this.fill) {
|
|
4408
|
+
if (!this.sizes) {
|
|
4409
|
+
this.sizes = '100vw';
|
|
4410
|
+
}
|
|
4411
|
+
this.renderer.setStyle(this.imgElement, 'position', 'absolute');
|
|
4412
|
+
this.renderer.setStyle(this.imgElement, 'width', '100%');
|
|
4413
|
+
this.renderer.setStyle(this.imgElement, 'height', '100%');
|
|
4414
|
+
this.renderer.setStyle(this.imgElement, 'inset', '0px');
|
|
4415
|
+
}
|
|
4416
|
+
else {
|
|
4417
|
+
this.setHostAttribute('width', this.width.toString());
|
|
4418
|
+
this.setHostAttribute('height', this.height.toString());
|
|
4419
|
+
}
|
|
4420
|
+
this.setHostAttribute('loading', this.getLoadingBehavior());
|
|
4421
|
+
this.setHostAttribute('fetchpriority', this.getFetchPriority());
|
|
4422
|
+
// The `data-ng-img` attribute flags an image as using the directive, to allow
|
|
4423
|
+
// for analysis of the directive's performance.
|
|
4424
|
+
this.setHostAttribute('ng-img', 'true');
|
|
4425
|
+
// The `src` and `srcset` attributes should be set last since other attributes
|
|
4426
|
+
// could affect the image's loading behavior.
|
|
4427
|
+
const rewrittenSrc = this.getRewrittenSrc();
|
|
4428
|
+
this.setHostAttribute('src', rewrittenSrc);
|
|
4429
|
+
let rewrittenSrcset = undefined;
|
|
4430
|
+
if (this.sizes) {
|
|
4431
|
+
this.setHostAttribute('sizes', this.sizes);
|
|
4432
|
+
}
|
|
4433
|
+
if (this.ngSrcset) {
|
|
4434
|
+
rewrittenSrcset = this.getRewrittenSrcset();
|
|
4435
|
+
}
|
|
4436
|
+
else if (this.shouldGenerateAutomaticSrcset()) {
|
|
4437
|
+
rewrittenSrcset = this.getAutomaticSrcset();
|
|
4438
|
+
}
|
|
4439
|
+
if (rewrittenSrcset) {
|
|
4440
|
+
this.setHostAttribute('srcset', rewrittenSrcset);
|
|
4441
|
+
}
|
|
4442
|
+
if (isPlatformServer(this.platformId) && this.priority) {
|
|
4443
|
+
this.preloadLinkChecker.createPreloadLinkTag(this.renderer, rewrittenSrc, rewrittenSrcset, this.sizes);
|
|
4444
|
+
}
|
|
4445
|
+
}
|
|
4446
|
+
/** @nodoc */
|
|
4447
|
+
ngOnChanges(changes) {
|
|
4448
|
+
if (ngDevMode) {
|
|
4449
|
+
assertNoPostInitInputChange(this, changes, [
|
|
4450
|
+
'ngSrc',
|
|
4451
|
+
'ngSrcset',
|
|
4452
|
+
'width',
|
|
4453
|
+
'height',
|
|
4454
|
+
'priority',
|
|
4455
|
+
'fill',
|
|
4456
|
+
'loading',
|
|
4457
|
+
'sizes',
|
|
4458
|
+
'loaderParams',
|
|
4459
|
+
'disableOptimizedSrcset',
|
|
4460
|
+
]);
|
|
4461
|
+
}
|
|
4462
|
+
}
|
|
4463
|
+
callImageLoader(configWithoutCustomParams) {
|
|
4464
|
+
let augmentedConfig = configWithoutCustomParams;
|
|
4465
|
+
if (this.loaderParams) {
|
|
4466
|
+
augmentedConfig.loaderParams = this.loaderParams;
|
|
4467
|
+
}
|
|
4468
|
+
return this.imageLoader(augmentedConfig);
|
|
4469
|
+
}
|
|
4470
|
+
getLoadingBehavior() {
|
|
4471
|
+
if (!this.priority && this.loading !== undefined) {
|
|
4472
|
+
return this.loading;
|
|
4473
|
+
}
|
|
4474
|
+
return this.priority ? 'eager' : 'lazy';
|
|
4475
|
+
}
|
|
4476
|
+
getFetchPriority() {
|
|
4477
|
+
return this.priority ? 'high' : 'auto';
|
|
4478
|
+
}
|
|
4479
|
+
getRewrittenSrc() {
|
|
4480
|
+
// ImageLoaderConfig supports setting a width property. However, we're not setting width here
|
|
4481
|
+
// because if the developer uses rendered width instead of intrinsic width in the HTML width
|
|
4482
|
+
// attribute, the image requested may be too small for 2x+ screens.
|
|
4483
|
+
if (!this._renderedSrc) {
|
|
4484
|
+
const imgConfig = { src: this.ngSrc };
|
|
4485
|
+
// Cache calculated image src to reuse it later in the code.
|
|
4486
|
+
this._renderedSrc = this.callImageLoader(imgConfig);
|
|
4487
|
+
}
|
|
4488
|
+
return this._renderedSrc;
|
|
4489
|
+
}
|
|
4490
|
+
getRewrittenSrcset() {
|
|
4491
|
+
const widthSrcSet = VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset);
|
|
4492
|
+
const finalSrcs = this.ngSrcset.split(',').filter(src => src !== '').map(srcStr => {
|
|
4493
|
+
srcStr = srcStr.trim();
|
|
4494
|
+
const width = widthSrcSet ? parseFloat(srcStr) : parseFloat(srcStr) * this.width;
|
|
4495
|
+
return `${this.callImageLoader({ src: this.ngSrc, width })} ${srcStr}`;
|
|
4496
|
+
});
|
|
4497
|
+
return finalSrcs.join(', ');
|
|
4498
|
+
}
|
|
4499
|
+
getAutomaticSrcset() {
|
|
4500
|
+
if (this.sizes) {
|
|
4501
|
+
return this.getResponsiveSrcset();
|
|
4502
|
+
}
|
|
4503
|
+
else {
|
|
4504
|
+
return this.getFixedSrcset();
|
|
4505
|
+
}
|
|
4506
|
+
}
|
|
4507
|
+
getResponsiveSrcset() {
|
|
4508
|
+
const { breakpoints } = this.config;
|
|
4509
|
+
let filteredBreakpoints = breakpoints;
|
|
4510
|
+
if (this.sizes?.trim() === '100vw') {
|
|
4511
|
+
// Since this is a full-screen-width image, our srcset only needs to include
|
|
4512
|
+
// breakpoints with full viewport widths.
|
|
4513
|
+
filteredBreakpoints = breakpoints.filter(bp => bp >= VIEWPORT_BREAKPOINT_CUTOFF);
|
|
4514
|
+
}
|
|
4515
|
+
const finalSrcs = filteredBreakpoints.map(bp => `${this.callImageLoader({ src: this.ngSrc, width: bp })} ${bp}w`);
|
|
4516
|
+
return finalSrcs.join(', ');
|
|
4517
|
+
}
|
|
4518
|
+
getFixedSrcset() {
|
|
4519
|
+
const finalSrcs = DENSITY_SRCSET_MULTIPLIERS.map(multiplier => {
|
|
4520
|
+
const imgUrl = this.callImageLoader({ src: this.ngSrc, width: this.width * multiplier });
|
|
4521
|
+
return `${imgUrl} ${multiplier}x`;
|
|
4522
|
+
});
|
|
4523
|
+
return finalSrcs.join(', ');
|
|
4524
|
+
}
|
|
4525
|
+
shouldGenerateAutomaticSrcset() {
|
|
4526
|
+
return !this._disableOptimizedSrcset && !this.srcset && this.imageLoader !== noopImageLoader &&
|
|
4527
|
+
!(this.width > FIXED_SRCSET_WIDTH_LIMIT || this.height > FIXED_SRCSET_HEIGHT_LIMIT);
|
|
4528
|
+
}
|
|
4529
|
+
/** @nodoc */
|
|
4530
|
+
ngOnDestroy() {
|
|
4531
|
+
if (ngDevMode) {
|
|
4532
|
+
if (!this.priority && this._renderedSrc !== null && this.lcpObserver !== null) {
|
|
4533
|
+
this.lcpObserver.unregisterImage(this._renderedSrc);
|
|
4534
|
+
}
|
|
4535
|
+
}
|
|
4536
|
+
}
|
|
4537
|
+
setHostAttribute(name, value) {
|
|
4538
|
+
this.renderer.setAttribute(this.imgElement, name, value);
|
|
4539
|
+
}
|
|
4540
|
+
}
|
|
4541
|
+
NgOptimizedImage.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgOptimizedImage, deps: [{ token: IMAGE_LOADER }, { token: IMAGE_CONFIG }, { token: Renderer2 }, { token: ElementRef }, { token: Injector }, { token: PLATFORM_ID }, { token: PreloadLinkCreator }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4542
|
+
NgOptimizedImage.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: { ngSrc: "ngSrc", ngSrcset: "ngSrcset", sizes: "sizes", width: "width", height: "height", loading: "loading", priority: "priority", loaderParams: "loaderParams", disableOptimizedSrcset: "disableOptimizedSrcset", fill: "fill", src: "src", srcset: "srcset" }, usesOnChanges: true, ngImport: i0 });
|
|
4543
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgOptimizedImage, decorators: [{
|
|
4544
|
+
type: Directive,
|
|
4545
|
+
args: [{ selector: 'img[ngSrc]' }]
|
|
4546
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
4547
|
+
type: Inject,
|
|
4548
|
+
args: [IMAGE_LOADER]
|
|
4549
|
+
}] }, { type: undefined, decorators: [{
|
|
4550
|
+
type: Inject,
|
|
4551
|
+
args: [IMAGE_CONFIG]
|
|
4552
|
+
}] }, { type: i0.Renderer2, decorators: [{
|
|
4553
|
+
type: Inject,
|
|
4554
|
+
args: [Renderer2]
|
|
4555
|
+
}] }, { type: i0.ElementRef, decorators: [{
|
|
4556
|
+
type: Inject,
|
|
4557
|
+
args: [ElementRef]
|
|
4558
|
+
}] }, { type: i0.Injector, decorators: [{
|
|
4559
|
+
type: Inject,
|
|
4560
|
+
args: [Injector]
|
|
4561
|
+
}] }, { type: undefined, decorators: [{
|
|
4562
|
+
type: Inject,
|
|
4563
|
+
args: [PLATFORM_ID]
|
|
4564
|
+
}] }, { type: PreloadLinkCreator, decorators: [{
|
|
4565
|
+
type: Inject,
|
|
4566
|
+
args: [PreloadLinkCreator]
|
|
4567
|
+
}] }]; }, propDecorators: { ngSrc: [{
|
|
4568
|
+
type: Input
|
|
4569
|
+
}], ngSrcset: [{
|
|
4570
|
+
type: Input
|
|
4571
|
+
}], sizes: [{
|
|
4572
|
+
type: Input
|
|
4573
|
+
}], width: [{
|
|
4574
|
+
type: Input
|
|
4575
|
+
}], height: [{
|
|
4576
|
+
type: Input
|
|
4577
|
+
}], loading: [{
|
|
4578
|
+
type: Input
|
|
4579
|
+
}], priority: [{
|
|
4580
|
+
type: Input
|
|
4581
|
+
}], loaderParams: [{
|
|
4582
|
+
type: Input
|
|
4583
|
+
}], disableOptimizedSrcset: [{
|
|
4584
|
+
type: Input
|
|
4585
|
+
}], fill: [{
|
|
4586
|
+
type: Input
|
|
4587
|
+
}], src: [{
|
|
4588
|
+
type: Input
|
|
4589
|
+
}], srcset: [{
|
|
4590
|
+
type: Input
|
|
4591
|
+
}] } });
|
|
4592
|
+
/***** Helpers *****/
|
|
4593
|
+
/**
|
|
4594
|
+
* Convert input value to integer.
|
|
4595
|
+
*/
|
|
4596
|
+
function inputToInteger(value) {
|
|
4597
|
+
return typeof value === 'string' ? parseInt(value, 10) : value;
|
|
4598
|
+
}
|
|
4599
|
+
/**
|
|
4600
|
+
* Convert input value to boolean.
|
|
4601
|
+
*/
|
|
4602
|
+
function inputToBoolean(value) {
|
|
4603
|
+
return value != null && `${value}` !== 'false';
|
|
4604
|
+
}
|
|
4605
|
+
/**
|
|
4606
|
+
* Sorts provided config breakpoints and uses defaults.
|
|
4607
|
+
*/
|
|
4608
|
+
function processConfig(config) {
|
|
4609
|
+
let sortedBreakpoints = {};
|
|
4610
|
+
if (config.breakpoints) {
|
|
4611
|
+
sortedBreakpoints.breakpoints = config.breakpoints.sort((a, b) => a - b);
|
|
4612
|
+
}
|
|
4613
|
+
return Object.assign({}, defaultConfig, config, sortedBreakpoints);
|
|
4614
|
+
}
|
|
4615
|
+
/***** Assert functions *****/
|
|
4616
|
+
/**
|
|
4617
|
+
* Verifies that there is no `src` set on a host element.
|
|
4618
|
+
*/
|
|
4619
|
+
function assertNoConflictingSrc(dir) {
|
|
4620
|
+
if (dir.src) {
|
|
4621
|
+
throw new ɵRuntimeError(2950 /* UNEXPECTED_SRC_ATTR */, `${imgDirectiveDetails(dir.ngSrc)} both \`src\` and \`ngSrc\` have been set. ` +
|
|
4622
|
+
`Supplying both of these attributes breaks lazy loading. ` +
|
|
4623
|
+
`The NgOptimizedImage directive sets \`src\` itself based on the value of \`ngSrc\`. ` +
|
|
4624
|
+
`To fix this, please remove the \`src\` attribute.`);
|
|
4625
|
+
}
|
|
4626
|
+
}
|
|
4627
|
+
/**
|
|
4628
|
+
* Verifies that there is no `srcset` set on a host element.
|
|
4629
|
+
*/
|
|
4630
|
+
function assertNoConflictingSrcset(dir) {
|
|
4631
|
+
if (dir.srcset) {
|
|
4632
|
+
throw new ɵRuntimeError(2951 /* UNEXPECTED_SRCSET_ATTR */, `${imgDirectiveDetails(dir.ngSrc)} both \`srcset\` and \`ngSrcset\` have been set. ` +
|
|
4633
|
+
`Supplying both of these attributes breaks lazy loading. ` +
|
|
4634
|
+
`The NgOptimizedImage directive sets \`srcset\` itself based on the value of ` +
|
|
4635
|
+
`\`ngSrcset\`. To fix this, please remove the \`srcset\` attribute.`);
|
|
4636
|
+
}
|
|
4637
|
+
}
|
|
4638
|
+
/**
|
|
4639
|
+
* Verifies that the `ngSrc` is not a Base64-encoded image.
|
|
4640
|
+
*/
|
|
4641
|
+
function assertNotBase64Image(dir) {
|
|
4642
|
+
let ngSrc = dir.ngSrc.trim();
|
|
4643
|
+
if (ngSrc.startsWith('data:')) {
|
|
4644
|
+
if (ngSrc.length > BASE64_IMG_MAX_LENGTH_IN_ERROR) {
|
|
4645
|
+
ngSrc = ngSrc.substring(0, BASE64_IMG_MAX_LENGTH_IN_ERROR) + '...';
|
|
4646
|
+
}
|
|
4647
|
+
throw new ɵRuntimeError(2952 /* INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc, false)} \`ngSrc\` is a Base64-encoded string ` +
|
|
4648
|
+
`(${ngSrc}). NgOptimizedImage does not support Base64-encoded strings. ` +
|
|
4649
|
+
`To fix this, disable the NgOptimizedImage directive for this element ` +
|
|
4650
|
+
`by removing \`ngSrc\` and using a standard \`src\` attribute instead.`);
|
|
4651
|
+
}
|
|
4652
|
+
}
|
|
4653
|
+
/**
|
|
4654
|
+
* Verifies that the 'sizes' only includes responsive values.
|
|
4655
|
+
*/
|
|
4656
|
+
function assertNoComplexSizes(dir) {
|
|
4657
|
+
let sizes = dir.sizes;
|
|
4658
|
+
if (sizes?.match(/((\)|,)\s|^)\d+px/)) {
|
|
4659
|
+
throw new ɵRuntimeError(2952 /* INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc, false)} \`sizes\` was set to a string including ` +
|
|
4660
|
+
`pixel values. For automatic \`srcset\` generation, \`sizes\` must only include responsive ` +
|
|
4661
|
+
`values, such as \`sizes="50vw"\` or \`sizes="(min-width: 768px) 50vw, 100vw"\`. ` +
|
|
4662
|
+
`To fix this, modify the \`sizes\` attribute, or provide your own \`ngSrcset\` value directly.`);
|
|
4663
|
+
}
|
|
4664
|
+
}
|
|
4665
|
+
/**
|
|
4666
|
+
* Verifies that the `ngSrc` is not a Blob URL.
|
|
4667
|
+
*/
|
|
4668
|
+
function assertNotBlobUrl(dir) {
|
|
4669
|
+
const ngSrc = dir.ngSrc.trim();
|
|
4670
|
+
if (ngSrc.startsWith('blob:')) {
|
|
4671
|
+
throw new ɵRuntimeError(2952 /* INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrc\` was set to a blob URL (${ngSrc}). ` +
|
|
4672
|
+
`Blob URLs are not supported by the NgOptimizedImage directive. ` +
|
|
4673
|
+
`To fix this, disable the NgOptimizedImage directive for this element ` +
|
|
4674
|
+
`by removing \`ngSrc\` and using a regular \`src\` attribute instead.`);
|
|
4675
|
+
}
|
|
4676
|
+
}
|
|
4677
|
+
/**
|
|
4678
|
+
* Verifies that the input is set to a non-empty string.
|
|
4679
|
+
*/
|
|
4680
|
+
function assertNonEmptyInput(dir, name, value) {
|
|
4681
|
+
const isString = typeof value === 'string';
|
|
4682
|
+
const isEmptyString = isString && value.trim() === '';
|
|
4683
|
+
if (!isString || isEmptyString) {
|
|
4684
|
+
throw new ɵRuntimeError(2952 /* INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \`${name}\` has an invalid value ` +
|
|
4685
|
+
`(\`${value}\`). To fix this, change the value to a non-empty string.`);
|
|
4686
|
+
}
|
|
4687
|
+
}
|
|
4688
|
+
/**
|
|
4689
|
+
* Verifies that the `ngSrcset` is in a valid format, e.g. "100w, 200w" or "1x, 2x".
|
|
4690
|
+
*/
|
|
4691
|
+
function assertValidNgSrcset(dir, value) {
|
|
4692
|
+
if (value == null)
|
|
4693
|
+
return;
|
|
4694
|
+
assertNonEmptyInput(dir, 'ngSrcset', value);
|
|
4695
|
+
const stringVal = value;
|
|
4696
|
+
const isValidWidthDescriptor = VALID_WIDTH_DESCRIPTOR_SRCSET.test(stringVal);
|
|
4697
|
+
const isValidDensityDescriptor = VALID_DENSITY_DESCRIPTOR_SRCSET.test(stringVal);
|
|
4698
|
+
if (isValidDensityDescriptor) {
|
|
4699
|
+
assertUnderDensityCap(dir, stringVal);
|
|
4700
|
+
}
|
|
4701
|
+
const isValidSrcset = isValidWidthDescriptor || isValidDensityDescriptor;
|
|
4702
|
+
if (!isValidSrcset) {
|
|
4703
|
+
throw new ɵRuntimeError(2952 /* INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrcset\` has an invalid value (\`${value}\`). ` +
|
|
4704
|
+
`To fix this, supply \`ngSrcset\` using a comma-separated list of one or more width ` +
|
|
4705
|
+
`descriptors (e.g. "100w, 200w") or density descriptors (e.g. "1x, 2x").`);
|
|
4706
|
+
}
|
|
4707
|
+
}
|
|
4708
|
+
function assertUnderDensityCap(dir, value) {
|
|
4709
|
+
const underDensityCap = value.split(',').every(num => num === '' || parseFloat(num) <= ABSOLUTE_SRCSET_DENSITY_CAP);
|
|
4710
|
+
if (!underDensityCap) {
|
|
4711
|
+
throw new ɵRuntimeError(2952 /* INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` contains an unsupported image density:` +
|
|
4712
|
+
`\`${value}\`. NgOptimizedImage generally recommends a max image density of ` +
|
|
4713
|
+
`${RECOMMENDED_SRCSET_DENSITY_CAP}x but supports image densities up to ` +
|
|
4714
|
+
`${ABSOLUTE_SRCSET_DENSITY_CAP}x. The human eye cannot distinguish between image densities ` +
|
|
4715
|
+
`greater than ${RECOMMENDED_SRCSET_DENSITY_CAP}x - which makes them unnecessary for ` +
|
|
4716
|
+
`most use cases. Images that will be pinch-zoomed are typically the primary use case for ` +
|
|
4717
|
+
`${ABSOLUTE_SRCSET_DENSITY_CAP}x images. Please remove the high density descriptor and try again.`);
|
|
4718
|
+
}
|
|
4719
|
+
}
|
|
4720
|
+
/**
|
|
4721
|
+
* Creates a `RuntimeError` instance to represent a situation when an input is set after
|
|
4722
|
+
* the directive has initialized.
|
|
4723
|
+
*/
|
|
4724
|
+
function postInitInputChangeError(dir, inputName) {
|
|
4725
|
+
let reason;
|
|
4726
|
+
if (inputName === 'width' || inputName === 'height') {
|
|
4727
|
+
reason = `Changing \`${inputName}\` may result in different attribute value ` +
|
|
4728
|
+
`applied to the underlying image element and cause layout shifts on a page.`;
|
|
4729
|
+
}
|
|
4730
|
+
else {
|
|
4731
|
+
reason = `Changing the \`${inputName}\` would have no effect on the underlying ` +
|
|
4732
|
+
`image element, because the resource loading has already occurred.`;
|
|
4733
|
+
}
|
|
4734
|
+
return new ɵRuntimeError(2953 /* UNEXPECTED_INPUT_CHANGE */, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` was updated after initialization. ` +
|
|
4735
|
+
`The NgOptimizedImage directive will not react to this input change. ${reason} ` +
|
|
4736
|
+
`To fix this, either switch \`${inputName}\` to a static value ` +
|
|
4737
|
+
`or wrap the image element in an *ngIf that is gated on the necessary value.`);
|
|
4738
|
+
}
|
|
4739
|
+
/**
|
|
4740
|
+
* Verify that none of the listed inputs has changed.
|
|
4741
|
+
*/
|
|
4742
|
+
function assertNoPostInitInputChange(dir, changes, inputs) {
|
|
4743
|
+
inputs.forEach(input => {
|
|
4744
|
+
const isUpdated = changes.hasOwnProperty(input);
|
|
4745
|
+
if (isUpdated && !changes[input].isFirstChange()) {
|
|
4746
|
+
if (input === 'ngSrc') {
|
|
4747
|
+
// When the `ngSrc` input changes, we detect that only in the
|
|
4748
|
+
// `ngOnChanges` hook, thus the `ngSrc` is already set. We use
|
|
4749
|
+
// `ngSrc` in the error message, so we use a previous value, but
|
|
4750
|
+
// not the updated one in it.
|
|
4751
|
+
dir = { ngSrc: changes[input].previousValue };
|
|
4752
|
+
}
|
|
4753
|
+
throw postInitInputChangeError(dir, input);
|
|
4754
|
+
}
|
|
4755
|
+
});
|
|
4756
|
+
}
|
|
4757
|
+
/**
|
|
4758
|
+
* Verifies that a specified input is a number greater than 0.
|
|
4759
|
+
*/
|
|
4760
|
+
function assertGreaterThanZero(dir, inputValue, inputName) {
|
|
4761
|
+
const validNumber = typeof inputValue === 'number' && inputValue > 0;
|
|
4762
|
+
const validString = typeof inputValue === 'string' && /^\d+$/.test(inputValue.trim()) && parseInt(inputValue) > 0;
|
|
4763
|
+
if (!validNumber && !validString) {
|
|
4764
|
+
throw new ɵRuntimeError(2952 /* INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` has an invalid value ` +
|
|
4765
|
+
`(\`${inputValue}\`). To fix this, provide \`${inputName}\` ` +
|
|
4766
|
+
`as a number greater than 0.`);
|
|
4767
|
+
}
|
|
4768
|
+
}
|
|
4769
|
+
/**
|
|
4770
|
+
* Verifies that the rendered image is not visually distorted. Effectively this is checking:
|
|
4771
|
+
* - Whether the "width" and "height" attributes reflect the actual dimensions of the image.
|
|
4772
|
+
* - Whether image styling is "correct" (see below for a longer explanation).
|
|
4773
|
+
*/
|
|
4774
|
+
function assertNoImageDistortion(dir, img, renderer) {
|
|
4775
|
+
const removeListenerFn = renderer.listen(img, 'load', () => {
|
|
4776
|
+
removeListenerFn();
|
|
4777
|
+
const renderedWidth = img.clientWidth;
|
|
4778
|
+
const renderedHeight = img.clientHeight;
|
|
4779
|
+
const renderedAspectRatio = renderedWidth / renderedHeight;
|
|
4780
|
+
const nonZeroRenderedDimensions = renderedWidth !== 0 && renderedHeight !== 0;
|
|
4781
|
+
const intrinsicWidth = img.naturalWidth;
|
|
4782
|
+
const intrinsicHeight = img.naturalHeight;
|
|
4783
|
+
const intrinsicAspectRatio = intrinsicWidth / intrinsicHeight;
|
|
4784
|
+
const suppliedWidth = dir.width;
|
|
4785
|
+
const suppliedHeight = dir.height;
|
|
4786
|
+
const suppliedAspectRatio = suppliedWidth / suppliedHeight;
|
|
4787
|
+
// Tolerance is used to account for the impact of subpixel rendering.
|
|
4788
|
+
// Due to subpixel rendering, the rendered, intrinsic, and supplied
|
|
4789
|
+
// aspect ratios of a correctly configured image may not exactly match.
|
|
4790
|
+
// For example, a `width=4030 height=3020` image might have a rendered
|
|
4791
|
+
// size of "1062w, 796.48h". (An aspect ratio of 1.334... vs. 1.333...)
|
|
4792
|
+
const inaccurateDimensions = Math.abs(suppliedAspectRatio - intrinsicAspectRatio) > ASPECT_RATIO_TOLERANCE;
|
|
4793
|
+
const stylingDistortion = nonZeroRenderedDimensions &&
|
|
4794
|
+
Math.abs(intrinsicAspectRatio - renderedAspectRatio) > ASPECT_RATIO_TOLERANCE;
|
|
4795
|
+
if (inaccurateDimensions) {
|
|
4796
|
+
console.warn(ɵformatRuntimeError(2952 /* INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the image does not match ` +
|
|
4797
|
+
`the aspect ratio indicated by the width and height attributes. ` +
|
|
4798
|
+
`\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` +
|
|
4799
|
+
`(aspect-ratio: ${intrinsicAspectRatio}). \nSupplied width and height attributes: ` +
|
|
4800
|
+
`${suppliedWidth}w x ${suppliedHeight}h (aspect-ratio: ${suppliedAspectRatio}). ` +
|
|
4801
|
+
`\nTo fix this, update the width and height attributes.`));
|
|
4802
|
+
}
|
|
4803
|
+
else if (stylingDistortion) {
|
|
4804
|
+
console.warn(ɵformatRuntimeError(2952 /* INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the rendered image ` +
|
|
4805
|
+
`does not match the image's intrinsic aspect ratio. ` +
|
|
4806
|
+
`\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` +
|
|
4807
|
+
`(aspect-ratio: ${intrinsicAspectRatio}). \nRendered image size: ` +
|
|
4808
|
+
`${renderedWidth}w x ${renderedHeight}h (aspect-ratio: ` +
|
|
4809
|
+
`${renderedAspectRatio}). \nThis issue can occur if "width" and "height" ` +
|
|
4810
|
+
`attributes are added to an image without updating the corresponding ` +
|
|
4811
|
+
`image styling. To fix this, adjust image styling. In most cases, ` +
|
|
4812
|
+
`adding "height: auto" or "width: auto" to the image styling will fix ` +
|
|
4813
|
+
`this issue.`));
|
|
4814
|
+
}
|
|
4815
|
+
else if (!dir.ngSrcset && nonZeroRenderedDimensions) {
|
|
4816
|
+
// If `ngSrcset` hasn't been set, sanity check the intrinsic size.
|
|
4817
|
+
const recommendedWidth = RECOMMENDED_SRCSET_DENSITY_CAP * renderedWidth;
|
|
4818
|
+
const recommendedHeight = RECOMMENDED_SRCSET_DENSITY_CAP * renderedHeight;
|
|
4819
|
+
const oversizedWidth = (intrinsicWidth - recommendedWidth) >= OVERSIZED_IMAGE_TOLERANCE;
|
|
4820
|
+
const oversizedHeight = (intrinsicHeight - recommendedHeight) >= OVERSIZED_IMAGE_TOLERANCE;
|
|
4821
|
+
if (oversizedWidth || oversizedHeight) {
|
|
4822
|
+
console.warn(ɵformatRuntimeError(2960 /* OVERSIZED_IMAGE */, `${imgDirectiveDetails(dir.ngSrc)} the intrinsic image is significantly ` +
|
|
4823
|
+
`larger than necessary. ` +
|
|
4824
|
+
`\nRendered image size: ${renderedWidth}w x ${renderedHeight}h. ` +
|
|
4825
|
+
`\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h. ` +
|
|
4826
|
+
`\nRecommended intrinsic image size: ${recommendedWidth}w x ${recommendedHeight}h. ` +
|
|
4827
|
+
`\nNote: Recommended intrinsic image size is calculated assuming a maximum DPR of ` +
|
|
4828
|
+
`${RECOMMENDED_SRCSET_DENSITY_CAP}. To improve loading time, resize the image ` +
|
|
4829
|
+
`or consider using the "ngSrcset" and "sizes" attributes.`));
|
|
4830
|
+
}
|
|
4831
|
+
}
|
|
4832
|
+
});
|
|
4833
|
+
}
|
|
4834
|
+
/**
|
|
4835
|
+
* Verifies that a specified input is set.
|
|
4836
|
+
*/
|
|
4837
|
+
function assertNonEmptyWidthAndHeight(dir) {
|
|
4838
|
+
let missingAttributes = [];
|
|
4839
|
+
if (dir.width === undefined)
|
|
4840
|
+
missingAttributes.push('width');
|
|
4841
|
+
if (dir.height === undefined)
|
|
4842
|
+
missingAttributes.push('height');
|
|
4843
|
+
if (missingAttributes.length > 0) {
|
|
4844
|
+
throw new ɵRuntimeError(2954 /* REQUIRED_INPUT_MISSING */, `${imgDirectiveDetails(dir.ngSrc)} these required attributes ` +
|
|
4845
|
+
`are missing: ${missingAttributes.map(attr => `"${attr}"`).join(', ')}. ` +
|
|
4846
|
+
`Including "width" and "height" attributes will prevent image-related layout shifts. ` +
|
|
4847
|
+
`To fix this, include "width" and "height" attributes on the image tag or turn on ` +
|
|
4848
|
+
`"fill" mode with the \`fill\` attribute.`);
|
|
4849
|
+
}
|
|
4850
|
+
}
|
|
4851
|
+
/**
|
|
4852
|
+
* Verifies that width and height are not set. Used in fill mode, where those attributes don't make
|
|
4853
|
+
* sense.
|
|
4854
|
+
*/
|
|
4855
|
+
function assertEmptyWidthAndHeight(dir) {
|
|
4856
|
+
if (dir.width || dir.height) {
|
|
4857
|
+
throw new ɵRuntimeError(2952 /* INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the attributes \`height\` and/or \`width\` are present ` +
|
|
4858
|
+
`along with the \`fill\` attribute. Because \`fill\` mode causes an image to fill its containing ` +
|
|
4859
|
+
`element, the size attributes have no effect and should be removed.`);
|
|
4860
|
+
}
|
|
4861
|
+
}
|
|
4862
|
+
/**
|
|
4863
|
+
* Verifies that the rendered image has a nonzero height. If the image is in fill mode, provides
|
|
4864
|
+
* guidance that this can be caused by the containing element's CSS position property.
|
|
4865
|
+
*/
|
|
4866
|
+
function assertNonZeroRenderedHeight(dir, img, renderer) {
|
|
4867
|
+
const removeListenerFn = renderer.listen(img, 'load', () => {
|
|
4868
|
+
removeListenerFn();
|
|
4869
|
+
const renderedHeight = img.clientHeight;
|
|
4870
|
+
if (dir.fill && renderedHeight === 0) {
|
|
4871
|
+
console.warn(ɵformatRuntimeError(2952 /* INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the height of the fill-mode image is zero. ` +
|
|
4872
|
+
`This is likely because the containing element does not have the CSS 'position' ` +
|
|
4873
|
+
`property set to one of the following: "relative", "fixed", or "absolute". ` +
|
|
4874
|
+
`To fix this problem, make sure the container element has the CSS 'position' ` +
|
|
4875
|
+
`property defined and the height of the element is not zero.`));
|
|
4876
|
+
}
|
|
4877
|
+
});
|
|
4878
|
+
}
|
|
4879
|
+
/**
|
|
4880
|
+
* Verifies that the `loading` attribute is set to a valid input &
|
|
4881
|
+
* is not used on priority images.
|
|
4882
|
+
*/
|
|
4883
|
+
function assertValidLoadingInput(dir) {
|
|
4884
|
+
if (dir.loading && dir.priority) {
|
|
4885
|
+
throw new ɵRuntimeError(2952 /* INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute ` +
|
|
4886
|
+
`was used on an image that was marked "priority". ` +
|
|
4887
|
+
`Setting \`loading\` on priority images is not allowed ` +
|
|
4888
|
+
`because these images will always be eagerly loaded. ` +
|
|
4889
|
+
`To fix this, remove the “loading” attribute from the priority image.`);
|
|
4890
|
+
}
|
|
4891
|
+
const validInputs = ['auto', 'eager', 'lazy'];
|
|
4892
|
+
if (typeof dir.loading === 'string' && !validInputs.includes(dir.loading)) {
|
|
4893
|
+
throw new ɵRuntimeError(2952 /* INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute ` +
|
|
4894
|
+
`has an invalid value (\`${dir.loading}\`). ` +
|
|
4895
|
+
`To fix this, provide a valid value ("lazy", "eager", or "auto").`);
|
|
4896
|
+
}
|
|
4897
|
+
}
|
|
4898
|
+
/**
|
|
4899
|
+
* Warns if NOT using a loader (falling back to the generic loader) and
|
|
4900
|
+
* the image appears to be hosted on one of the image CDNs for which
|
|
4901
|
+
* we do have a built-in image loader. Suggests switching to the
|
|
4902
|
+
* built-in loader.
|
|
4903
|
+
*
|
|
4904
|
+
* @param ngSrc Value of the ngSrc attribute
|
|
4905
|
+
* @param imageLoader ImageLoader provided
|
|
4906
|
+
*/
|
|
4907
|
+
function assertNotMissingBuiltInLoader(ngSrc, imageLoader) {
|
|
4908
|
+
if (imageLoader === noopImageLoader) {
|
|
4909
|
+
let builtInLoaderName = '';
|
|
4910
|
+
for (const loader of BUILT_IN_LOADERS) {
|
|
4911
|
+
if (loader.testUrl(ngSrc)) {
|
|
4912
|
+
builtInLoaderName = loader.name;
|
|
4913
|
+
break;
|
|
4914
|
+
}
|
|
4915
|
+
}
|
|
4916
|
+
if (builtInLoaderName) {
|
|
4917
|
+
console.warn(ɵformatRuntimeError(2962 /* MISSING_BUILTIN_LOADER */, `NgOptimizedImage: It looks like your images may be hosted on the ` +
|
|
4918
|
+
`${builtInLoaderName} CDN, but your app is not using Angular's ` +
|
|
4919
|
+
`built-in loader for that CDN. We recommend switching to use ` +
|
|
4920
|
+
`the built-in by calling \`provide${builtInLoaderName}Loader()\` ` +
|
|
4921
|
+
`in your \`providers\` and passing it your instance's base URL. ` +
|
|
4922
|
+
`If you don't want to use the built-in loader, define a custom ` +
|
|
4923
|
+
`loader function using IMAGE_LOADER to silence this warning.`));
|
|
4924
|
+
}
|
|
4925
|
+
}
|
|
4926
|
+
}
|
|
4927
|
+
/**
|
|
4928
|
+
* Warns if ngSrcset is present and no loader is configured (i.e. the default one is being used).
|
|
4929
|
+
*/
|
|
4930
|
+
function assertNoNgSrcsetWithoutLoader(dir, imageLoader) {
|
|
4931
|
+
if (dir.ngSrcset && imageLoader === noopImageLoader) {
|
|
4932
|
+
console.warn(ɵformatRuntimeError(2963 /* MISSING_NECESSARY_LOADER */, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` attribute is present but ` +
|
|
4933
|
+
`no image loader is configured (i.e. the default one is being used), ` +
|
|
4934
|
+
`which would result in the same image being used for all configured sizes. ` +
|
|
4935
|
+
`To fix this, provide a loader or remove the \`ngSrcset\` attribute from the image.`));
|
|
4936
|
+
}
|
|
4937
|
+
}
|
|
4938
|
+
/**
|
|
4939
|
+
* Warns if loaderParams is present and no loader is configured (i.e. the default one is being
|
|
4940
|
+
* used).
|
|
4941
|
+
*/
|
|
4942
|
+
function assertNoLoaderParamsWithoutLoader(dir, imageLoader) {
|
|
4943
|
+
if (dir.loaderParams && imageLoader === noopImageLoader) {
|
|
4944
|
+
console.warn(ɵformatRuntimeError(2963 /* MISSING_NECESSARY_LOADER */, `${imgDirectiveDetails(dir.ngSrc)} the \`loaderParams\` attribute is present but ` +
|
|
4945
|
+
`no image loader is configured (i.e. the default one is being used), ` +
|
|
4946
|
+
`which means that the loaderParams data will not be consumed and will not affect the URL. ` +
|
|
4947
|
+
`To fix this, provide a custom loader or remove the \`loaderParams\` attribute from the image.`));
|
|
4948
|
+
}
|
|
4949
|
+
}
|
|
4950
|
+
/**
|
|
4951
|
+
* This NgModule exports the `NgOptimizedImage` directive.
|
|
4952
|
+
* Import this module to enable the optimized image directive in your application.
|
|
4953
|
+
*
|
|
4954
|
+
* @publicApi
|
|
4955
|
+
* @deprecated In Angular v15, this NgModule is removed in favor of the NgOptimizedImage directive,
|
|
4956
|
+
* which is annotated as standalone.
|
|
4957
|
+
*/
|
|
4958
|
+
class NgOptimizedImageModule {
|
|
4959
|
+
}
|
|
4960
|
+
NgOptimizedImageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgOptimizedImageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4961
|
+
NgOptimizedImageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgOptimizedImageModule, declarations: [NgOptimizedImage], exports: [NgOptimizedImage] });
|
|
4962
|
+
NgOptimizedImageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgOptimizedImageModule });
|
|
4963
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgOptimizedImageModule, decorators: [{
|
|
4964
|
+
type: NgModule,
|
|
4965
|
+
args: [{
|
|
4966
|
+
declarations: [NgOptimizedImage],
|
|
4967
|
+
exports: [NgOptimizedImage],
|
|
4968
|
+
}]
|
|
4969
|
+
}] });
|
|
4970
|
+
|
|
3479
4971
|
/**
|
|
3480
4972
|
* @license
|
|
3481
4973
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -3618,9 +5110,9 @@ class NgSwitch {
|
|
|
3618
5110
|
}
|
|
3619
5111
|
}
|
|
3620
5112
|
}
|
|
3621
|
-
NgSwitch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
3622
|
-
NgSwitch.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.
|
|
3623
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
5113
|
+
NgSwitch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgSwitch, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5114
|
+
NgSwitch.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: NgSwitch, selector: "[ngSwitch]", inputs: { ngSwitch: "ngSwitch" }, ngImport: i0 });
|
|
5115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgSwitch, decorators: [{
|
|
3624
5116
|
type: Directive,
|
|
3625
5117
|
args: [{ selector: '[ngSwitch]' }]
|
|
3626
5118
|
}], propDecorators: { ngSwitch: [{
|
|
@@ -3676,9 +5168,9 @@ class NgSwitchCase {
|
|
|
3676
5168
|
this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase));
|
|
3677
5169
|
}
|
|
3678
5170
|
}
|
|
3679
|
-
NgSwitchCase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
3680
|
-
NgSwitchCase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.
|
|
3681
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
5171
|
+
NgSwitchCase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgSwitchCase, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: NgSwitch, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5172
|
+
NgSwitchCase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: NgSwitchCase, selector: "[ngSwitchCase]", inputs: { ngSwitchCase: "ngSwitchCase" }, ngImport: i0 });
|
|
5173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgSwitchCase, decorators: [{
|
|
3682
5174
|
type: Directive,
|
|
3683
5175
|
args: [{ selector: '[ngSwitchCase]' }]
|
|
3684
5176
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: NgSwitch, decorators: [{
|
|
@@ -3710,9 +5202,9 @@ class NgSwitchDefault {
|
|
|
3710
5202
|
ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));
|
|
3711
5203
|
}
|
|
3712
5204
|
}
|
|
3713
|
-
NgSwitchDefault.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
3714
|
-
NgSwitchDefault.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.
|
|
3715
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
5205
|
+
NgSwitchDefault.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgSwitchDefault, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: NgSwitch, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5206
|
+
NgSwitchDefault.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: NgSwitchDefault, selector: "[ngSwitchDefault]", ngImport: i0 });
|
|
5207
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgSwitchDefault, decorators: [{
|
|
3716
5208
|
type: Directive,
|
|
3717
5209
|
args: [{ selector: '[ngSwitchDefault]' }]
|
|
3718
5210
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: NgSwitch, decorators: [{
|
|
@@ -3793,9 +5285,9 @@ class NgPlural {
|
|
|
3793
5285
|
}
|
|
3794
5286
|
}
|
|
3795
5287
|
}
|
|
3796
|
-
NgPlural.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
3797
|
-
NgPlural.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.
|
|
3798
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
5288
|
+
NgPlural.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgPlural, deps: [{ token: NgLocalization }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5289
|
+
NgPlural.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: NgPlural, selector: "[ngPlural]", inputs: { ngPlural: "ngPlural" }, ngImport: i0 });
|
|
5290
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgPlural, decorators: [{
|
|
3799
5291
|
type: Directive,
|
|
3800
5292
|
args: [{ selector: '[ngPlural]' }]
|
|
3801
5293
|
}], ctorParameters: function () { return [{ type: NgLocalization }]; }, propDecorators: { ngPlural: [{
|
|
@@ -3828,9 +5320,9 @@ class NgPluralCase {
|
|
|
3828
5320
|
ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template));
|
|
3829
5321
|
}
|
|
3830
5322
|
}
|
|
3831
|
-
NgPluralCase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
3832
|
-
NgPluralCase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.
|
|
3833
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
5323
|
+
NgPluralCase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgPluralCase, deps: [{ token: 'ngPluralCase', attribute: true }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: NgPlural, host: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5324
|
+
NgPluralCase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: NgPluralCase, selector: "[ngPluralCase]", ngImport: i0 });
|
|
5325
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgPluralCase, decorators: [{
|
|
3834
5326
|
type: Directive,
|
|
3835
5327
|
args: [{ selector: '[ngPluralCase]' }]
|
|
3836
5328
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
@@ -3921,9 +5413,9 @@ class NgStyle {
|
|
|
3921
5413
|
changes.forEachChangedItem((record) => this._setStyle(record.key, record.currentValue));
|
|
3922
5414
|
}
|
|
3923
5415
|
}
|
|
3924
|
-
NgStyle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
3925
|
-
NgStyle.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.
|
|
3926
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
5416
|
+
NgStyle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgStyle, deps: [{ token: i0.ElementRef }, { token: i0.KeyValueDiffers }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5417
|
+
NgStyle.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: NgStyle, selector: "[ngStyle]", inputs: { ngStyle: "ngStyle" }, ngImport: i0 });
|
|
5418
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgStyle, decorators: [{
|
|
3927
5419
|
type: Directive,
|
|
3928
5420
|
args: [{ selector: '[ngStyle]' }]
|
|
3929
5421
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.KeyValueDiffers }, { type: i0.Renderer2 }]; }, propDecorators: { ngStyle: [{
|
|
@@ -3994,9 +5486,9 @@ class NgTemplateOutlet {
|
|
|
3994
5486
|
}
|
|
3995
5487
|
}
|
|
3996
5488
|
}
|
|
3997
|
-
NgTemplateOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
3998
|
-
NgTemplateOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.
|
|
3999
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
5489
|
+
NgTemplateOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgTemplateOutlet, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5490
|
+
NgTemplateOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: { ngTemplateOutletContext: "ngTemplateOutletContext", ngTemplateOutlet: "ngTemplateOutlet" }, usesOnChanges: true, ngImport: i0 });
|
|
5491
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: NgTemplateOutlet, decorators: [{
|
|
4000
5492
|
type: Directive,
|
|
4001
5493
|
args: [{ selector: '[ngTemplateOutlet]' }]
|
|
4002
5494
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { ngTemplateOutletContext: [{
|
|
@@ -4159,9 +5651,9 @@ class AsyncPipe {
|
|
|
4159
5651
|
}
|
|
4160
5652
|
}
|
|
4161
5653
|
}
|
|
4162
|
-
AsyncPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
4163
|
-
AsyncPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.
|
|
4164
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
5654
|
+
AsyncPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: AsyncPipe, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5655
|
+
AsyncPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: AsyncPipe, name: "async", pure: false });
|
|
5656
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: AsyncPipe, decorators: [{
|
|
4165
5657
|
type: Pipe,
|
|
4166
5658
|
args: [{ name: 'async', pure: false }]
|
|
4167
5659
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
|
@@ -4198,9 +5690,9 @@ class LowerCasePipe {
|
|
|
4198
5690
|
return value.toLowerCase();
|
|
4199
5691
|
}
|
|
4200
5692
|
}
|
|
4201
|
-
LowerCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
4202
|
-
LowerCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.
|
|
4203
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
5693
|
+
LowerCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LowerCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5694
|
+
LowerCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LowerCasePipe, name: "lowercase" });
|
|
5695
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LowerCasePipe, decorators: [{
|
|
4204
5696
|
type: Pipe,
|
|
4205
5697
|
args: [{ name: 'lowercase' }]
|
|
4206
5698
|
}] });
|
|
@@ -4240,9 +5732,9 @@ class TitleCasePipe {
|
|
|
4240
5732
|
return value.replace(unicodeWordMatch, (txt => txt[0].toUpperCase() + txt.substr(1).toLowerCase()));
|
|
4241
5733
|
}
|
|
4242
5734
|
}
|
|
4243
|
-
TitleCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
4244
|
-
TitleCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.
|
|
4245
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
5735
|
+
TitleCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TitleCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5736
|
+
TitleCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TitleCasePipe, name: "titlecase" });
|
|
5737
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TitleCasePipe, decorators: [{
|
|
4246
5738
|
type: Pipe,
|
|
4247
5739
|
args: [{ name: 'titlecase' }]
|
|
4248
5740
|
}] });
|
|
@@ -4264,9 +5756,9 @@ class UpperCasePipe {
|
|
|
4264
5756
|
return value.toUpperCase();
|
|
4265
5757
|
}
|
|
4266
5758
|
}
|
|
4267
|
-
UpperCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
4268
|
-
UpperCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.
|
|
4269
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
5759
|
+
UpperCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: UpperCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5760
|
+
UpperCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: UpperCasePipe, name: "uppercase" });
|
|
5761
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: UpperCasePipe, decorators: [{
|
|
4270
5762
|
type: Pipe,
|
|
4271
5763
|
args: [{ name: 'uppercase' }]
|
|
4272
5764
|
}] });
|
|
@@ -4458,9 +5950,9 @@ class DatePipe {
|
|
|
4458
5950
|
}
|
|
4459
5951
|
}
|
|
4460
5952
|
}
|
|
4461
|
-
DatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
4462
|
-
DatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.
|
|
4463
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
5953
|
+
DatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DatePipe, deps: [{ token: LOCALE_ID }, { token: DATE_PIPE_DEFAULT_TIMEZONE, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5954
|
+
DatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DatePipe, name: "date" });
|
|
5955
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DatePipe, decorators: [{
|
|
4464
5956
|
type: Pipe,
|
|
4465
5957
|
args: [{ name: 'date', pure: true }]
|
|
4466
5958
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
@@ -4516,9 +6008,9 @@ class I18nPluralPipe {
|
|
|
4516
6008
|
return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());
|
|
4517
6009
|
}
|
|
4518
6010
|
}
|
|
4519
|
-
I18nPluralPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
4520
|
-
I18nPluralPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.
|
|
4521
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
6011
|
+
I18nPluralPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: I18nPluralPipe, deps: [{ token: NgLocalization }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
6012
|
+
I18nPluralPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: I18nPluralPipe, name: "i18nPlural" });
|
|
6013
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: I18nPluralPipe, decorators: [{
|
|
4522
6014
|
type: Pipe,
|
|
4523
6015
|
args: [{ name: 'i18nPlural', pure: true }]
|
|
4524
6016
|
}], ctorParameters: function () { return [{ type: NgLocalization }]; } });
|
|
@@ -4568,9 +6060,9 @@ class I18nSelectPipe {
|
|
|
4568
6060
|
return '';
|
|
4569
6061
|
}
|
|
4570
6062
|
}
|
|
4571
|
-
I18nSelectPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
4572
|
-
I18nSelectPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.
|
|
4573
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
6063
|
+
I18nSelectPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: I18nSelectPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
6064
|
+
I18nSelectPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: I18nSelectPipe, name: "i18nSelect" });
|
|
6065
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: I18nSelectPipe, decorators: [{
|
|
4574
6066
|
type: Pipe,
|
|
4575
6067
|
args: [{ name: 'i18nSelect', pure: true }]
|
|
4576
6068
|
}] });
|
|
@@ -4605,9 +6097,9 @@ class JsonPipe {
|
|
|
4605
6097
|
return JSON.stringify(value, null, 2);
|
|
4606
6098
|
}
|
|
4607
6099
|
}
|
|
4608
|
-
JsonPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
4609
|
-
JsonPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.
|
|
4610
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
6100
|
+
JsonPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: JsonPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
6101
|
+
JsonPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: JsonPipe, name: "json", pure: false });
|
|
6102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: JsonPipe, decorators: [{
|
|
4611
6103
|
type: Pipe,
|
|
4612
6104
|
args: [{ name: 'json', pure: false }]
|
|
4613
6105
|
}] });
|
|
@@ -4671,9 +6163,9 @@ class KeyValuePipe {
|
|
|
4671
6163
|
return this.keyValues;
|
|
4672
6164
|
}
|
|
4673
6165
|
}
|
|
4674
|
-
KeyValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
4675
|
-
KeyValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.
|
|
4676
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
6166
|
+
KeyValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KeyValuePipe, deps: [{ token: i0.KeyValueDiffers }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
6167
|
+
KeyValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KeyValuePipe, name: "keyvalue", pure: false });
|
|
6168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: KeyValuePipe, decorators: [{
|
|
4677
6169
|
type: Pipe,
|
|
4678
6170
|
args: [{ name: 'keyvalue', pure: false }]
|
|
4679
6171
|
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }]; } });
|
|
@@ -4802,9 +6294,9 @@ class DecimalPipe {
|
|
|
4802
6294
|
}
|
|
4803
6295
|
}
|
|
4804
6296
|
}
|
|
4805
|
-
DecimalPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
4806
|
-
DecimalPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.
|
|
4807
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
6297
|
+
DecimalPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DecimalPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
6298
|
+
DecimalPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DecimalPipe, name: "number" });
|
|
6299
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DecimalPipe, decorators: [{
|
|
4808
6300
|
type: Pipe,
|
|
4809
6301
|
args: [{ name: 'number' }]
|
|
4810
6302
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
@@ -4864,9 +6356,9 @@ class PercentPipe {
|
|
|
4864
6356
|
}
|
|
4865
6357
|
}
|
|
4866
6358
|
}
|
|
4867
|
-
PercentPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
4868
|
-
PercentPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.
|
|
4869
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
6359
|
+
PercentPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PercentPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
6360
|
+
PercentPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PercentPipe, name: "percent" });
|
|
6361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PercentPipe, decorators: [{
|
|
4870
6362
|
type: Pipe,
|
|
4871
6363
|
args: [{ name: 'percent' }]
|
|
4872
6364
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
@@ -4979,9 +6471,9 @@ class CurrencyPipe {
|
|
|
4979
6471
|
}
|
|
4980
6472
|
}
|
|
4981
6473
|
}
|
|
4982
|
-
CurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
4983
|
-
CurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.
|
|
4984
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
6474
|
+
CurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CurrencyPipe, deps: [{ token: LOCALE_ID }, { token: DEFAULT_CURRENCY_CODE }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
6475
|
+
CurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CurrencyPipe, name: "currency" });
|
|
6476
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CurrencyPipe, decorators: [{
|
|
4985
6477
|
type: Pipe,
|
|
4986
6478
|
args: [{ name: 'currency' }]
|
|
4987
6479
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
@@ -5063,9 +6555,9 @@ class SlicePipe {
|
|
|
5063
6555
|
return typeof obj === 'string' || Array.isArray(obj);
|
|
5064
6556
|
}
|
|
5065
6557
|
}
|
|
5066
|
-
SlicePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
5067
|
-
SlicePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.
|
|
5068
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
6558
|
+
SlicePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SlicePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
6559
|
+
SlicePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SlicePipe, name: "slice", pure: false });
|
|
6560
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SlicePipe, decorators: [{
|
|
5069
6561
|
type: Pipe,
|
|
5070
6562
|
args: [{ name: 'slice', pure: false }]
|
|
5071
6563
|
}] });
|
|
@@ -5120,10 +6612,10 @@ const COMMON_PIPES = [
|
|
|
5120
6612
|
*/
|
|
5121
6613
|
class CommonModule {
|
|
5122
6614
|
}
|
|
5123
|
-
CommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
5124
|
-
CommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
5125
|
-
CommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
5126
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
6615
|
+
CommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6616
|
+
CommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CommonModule, declarations: [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe], exports: [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe] });
|
|
6617
|
+
CommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CommonModule });
|
|
6618
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: CommonModule, decorators: [{
|
|
5127
6619
|
type: NgModule,
|
|
5128
6620
|
args: [{
|
|
5129
6621
|
declarations: [COMMON_DIRECTIVES, COMMON_PIPES],
|
|
@@ -5131,46 +6623,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
5131
6623
|
}]
|
|
5132
6624
|
}] });
|
|
5133
6625
|
|
|
5134
|
-
/**
|
|
5135
|
-
* @license
|
|
5136
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5137
|
-
*
|
|
5138
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
5139
|
-
* found in the LICENSE file at https://angular.io/license
|
|
5140
|
-
*/
|
|
5141
|
-
const PLATFORM_BROWSER_ID = 'browser';
|
|
5142
|
-
const PLATFORM_SERVER_ID = 'server';
|
|
5143
|
-
const PLATFORM_WORKER_APP_ID = 'browserWorkerApp';
|
|
5144
|
-
const PLATFORM_WORKER_UI_ID = 'browserWorkerUi';
|
|
5145
|
-
/**
|
|
5146
|
-
* Returns whether a platform id represents a browser platform.
|
|
5147
|
-
* @publicApi
|
|
5148
|
-
*/
|
|
5149
|
-
function isPlatformBrowser(platformId) {
|
|
5150
|
-
return platformId === PLATFORM_BROWSER_ID;
|
|
5151
|
-
}
|
|
5152
|
-
/**
|
|
5153
|
-
* Returns whether a platform id represents a server platform.
|
|
5154
|
-
* @publicApi
|
|
5155
|
-
*/
|
|
5156
|
-
function isPlatformServer(platformId) {
|
|
5157
|
-
return platformId === PLATFORM_SERVER_ID;
|
|
5158
|
-
}
|
|
5159
|
-
/**
|
|
5160
|
-
* Returns whether a platform id represents a web worker app platform.
|
|
5161
|
-
* @publicApi
|
|
5162
|
-
*/
|
|
5163
|
-
function isPlatformWorkerApp(platformId) {
|
|
5164
|
-
return platformId === PLATFORM_WORKER_APP_ID;
|
|
5165
|
-
}
|
|
5166
|
-
/**
|
|
5167
|
-
* Returns whether a platform id represents a web worker UI platform.
|
|
5168
|
-
* @publicApi
|
|
5169
|
-
*/
|
|
5170
|
-
function isPlatformWorkerUi(platformId) {
|
|
5171
|
-
return platformId === PLATFORM_WORKER_UI_ID;
|
|
5172
|
-
}
|
|
5173
|
-
|
|
5174
6626
|
/**
|
|
5175
6627
|
* @license
|
|
5176
6628
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -5181,7 +6633,7 @@ function isPlatformWorkerUi(platformId) {
|
|
|
5181
6633
|
/**
|
|
5182
6634
|
* @publicApi
|
|
5183
6635
|
*/
|
|
5184
|
-
const VERSION = new Version('13.
|
|
6636
|
+
const VERSION = new Version('13.4.0');
|
|
5185
6637
|
|
|
5186
6638
|
/**
|
|
5187
6639
|
* @license
|
|
@@ -5406,6 +6858,44 @@ class NullViewportScroller {
|
|
|
5406
6858
|
class XhrFactory {
|
|
5407
6859
|
}
|
|
5408
6860
|
|
|
6861
|
+
/**
|
|
6862
|
+
* @license
|
|
6863
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6864
|
+
*
|
|
6865
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6866
|
+
* found in the LICENSE file at https://angular.io/license
|
|
6867
|
+
*/
|
|
6868
|
+
/**
|
|
6869
|
+
* Function that generates an ImageLoader for [Cloudflare Image
|
|
6870
|
+
* Resizing](https://developers.cloudflare.com/images/image-resizing/) and turns it into an Angular
|
|
6871
|
+
* provider. Note: Cloudflare has multiple image products - this provider is specifically for
|
|
6872
|
+
* Cloudflare Image Resizing; it will not work with Cloudflare Images or Cloudflare Polish.
|
|
6873
|
+
*
|
|
6874
|
+
* @param path Your domain name, e.g. https://mysite.com
|
|
6875
|
+
* @returns Provider that provides an ImageLoader function
|
|
6876
|
+
*
|
|
6877
|
+
* @publicApi
|
|
6878
|
+
*/
|
|
6879
|
+
const provideCloudflareLoader = createImageLoader(createCloudflareUrl, ngDevMode ? ['https://<ZONE>/cdn-cgi/image/<OPTIONS>/<SOURCE-IMAGE>'] : undefined);
|
|
6880
|
+
// Exported for testing purposes in backport only. Not to be accessed except in unit tests.
|
|
6881
|
+
function createCloudflareUrl(path, config) {
|
|
6882
|
+
let params = `format=auto`;
|
|
6883
|
+
if (config.width) {
|
|
6884
|
+
params += `,width=${config.width}`;
|
|
6885
|
+
}
|
|
6886
|
+
// Cloudflare image URLs format:
|
|
6887
|
+
// https://developers.cloudflare.com/images/image-resizing/url-format/
|
|
6888
|
+
return `${path}/cdn-cgi/image/${params}/${config.src}`;
|
|
6889
|
+
}
|
|
6890
|
+
|
|
6891
|
+
/**
|
|
6892
|
+
* @license
|
|
6893
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6894
|
+
*
|
|
6895
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6896
|
+
* found in the LICENSE file at https://angular.io/license
|
|
6897
|
+
*/
|
|
6898
|
+
|
|
5409
6899
|
/**
|
|
5410
6900
|
* @license
|
|
5411
6901
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -5435,5 +6925,5 @@ class XhrFactory {
|
|
|
5435
6925
|
* Generated bundle index. Do not edit.
|
|
5436
6926
|
*/
|
|
5437
6927
|
|
|
5438
|
-
export { APP_BASE_HREF, AsyncPipe, CommonModule, CurrencyPipe, DATE_PIPE_DEFAULT_TIMEZONE, DOCUMENT, DatePipe, DecimalPipe, FormStyle, FormatWidth, HashLocationStrategy, I18nPluralPipe, I18nSelectPipe, JsonPipe, KeyValuePipe, LOCATION_INITIALIZED, Location, LocationStrategy, LowerCasePipe, NgClass, NgComponentOutlet, NgForOf, NgForOfContext, NgIf, NgIfContext, NgLocaleLocalization, NgLocalization, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NumberFormatStyle, NumberSymbol, PathLocationStrategy, PercentPipe, PlatformLocation, Plural, SlicePipe, TitleCasePipe, TranslationWidth, UpperCasePipe, VERSION, ViewportScroller, WeekDay, XhrFactory, formatCurrency, formatDate, formatNumber, formatPercent, getCurrencySymbol, getLocaleCurrencyCode, getLocaleCurrencyName, getLocaleCurrencySymbol, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleDirection, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleFirstDayOfWeek, getLocaleId, getLocaleMonthNames, getLocaleNumberFormat, getLocaleNumberSymbol, getLocalePluralCase, getLocaleTimeFormat, getLocaleWeekEndRange, getNumberOfCurrencyDigits, isPlatformBrowser, isPlatformServer, isPlatformWorkerApp, isPlatformWorkerUi, registerLocaleData, BrowserPlatformLocation as ɵBrowserPlatformLocation, DomAdapter as ɵDomAdapter, NullViewportScroller as ɵNullViewportScroller, PLATFORM_BROWSER_ID as ɵPLATFORM_BROWSER_ID, PLATFORM_SERVER_ID as ɵPLATFORM_SERVER_ID, PLATFORM_WORKER_APP_ID as ɵPLATFORM_WORKER_APP_ID, PLATFORM_WORKER_UI_ID as ɵPLATFORM_WORKER_UI_ID, getDOM as ɵgetDOM, parseCookieValue as ɵparseCookieValue, setRootDomAdapter as ɵsetRootDomAdapter };
|
|
6928
|
+
export { APP_BASE_HREF, AsyncPipe, CommonModule, CurrencyPipe, DATE_PIPE_DEFAULT_TIMEZONE, DOCUMENT, DatePipe, DecimalPipe, FormStyle, FormatWidth, HashLocationStrategy, I18nPluralPipe, I18nSelectPipe, IMAGE_CONFIG, IMAGE_LOADER, JsonPipe, KeyValuePipe, LOCATION_INITIALIZED, Location, LocationStrategy, LowerCasePipe, NgClass, NgComponentOutlet, NgForOf, NgForOfContext, NgIf, NgIfContext, NgLocaleLocalization, NgLocalization, NgOptimizedImage, NgOptimizedImageModule, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NumberFormatStyle, NumberSymbol, PRECONNECT_CHECK_BLOCKLIST, PathLocationStrategy, PercentPipe, PlatformLocation, Plural, SlicePipe, TitleCasePipe, TranslationWidth, UpperCasePipe, VERSION, ViewportScroller, WeekDay, XhrFactory, formatCurrency, formatDate, formatNumber, formatPercent, getCurrencySymbol, getLocaleCurrencyCode, getLocaleCurrencyName, getLocaleCurrencySymbol, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleDirection, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleFirstDayOfWeek, getLocaleId, getLocaleMonthNames, getLocaleNumberFormat, getLocaleNumberSymbol, getLocalePluralCase, getLocaleTimeFormat, getLocaleWeekEndRange, getNumberOfCurrencyDigits, isPlatformBrowser, isPlatformServer, isPlatformWorkerApp, isPlatformWorkerUi, provideCloudflareLoader, provideCloudinaryLoader, provideImageKitLoader, provideImgixLoader, registerLocaleData, BrowserPlatformLocation as ɵBrowserPlatformLocation, DomAdapter as ɵDomAdapter, NullViewportScroller as ɵNullViewportScroller, PLATFORM_BROWSER_ID as ɵPLATFORM_BROWSER_ID, PLATFORM_SERVER_ID as ɵPLATFORM_SERVER_ID, PLATFORM_WORKER_APP_ID as ɵPLATFORM_WORKER_APP_ID, PLATFORM_WORKER_UI_ID as ɵPLATFORM_WORKER_UI_ID, getDOM as ɵgetDOM, parseCookieValue as ɵparseCookieValue, setRootDomAdapter as ɵsetRootDomAdapter };
|
|
5439
6929
|
//# sourceMappingURL=common.mjs.map
|