@absolutejs/absolute 0.19.0-beta.1083 → 0.19.0-beta.1084

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.
Files changed (147) hide show
  1. package/dist/angular/browser.js +18 -18
  2. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  3. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  4. package/dist/angular/components/defer-slot-templates.directive.js +2 -2
  5. package/dist/angular/components/defer-slot.component.js +3 -3
  6. package/dist/angular/components/image.component.js +3 -3
  7. package/dist/angular/components/stream-slot.component.js +3 -3
  8. package/dist/angular/index.js +43 -43
  9. package/dist/angular/server.js +31 -31
  10. package/dist/build.js +42 -42
  11. package/dist/cli/config/server.js +11 -11
  12. package/dist/client/index.js +13 -13
  13. package/dist/index.js +62 -62
  14. package/dist/islands/index.js +14 -14
  15. package/dist/react/browser.js +3 -3
  16. package/dist/react/components/browser/index.js +5 -5
  17. package/dist/react/components/index.js +7 -7
  18. package/dist/react/hooks/index.js +2 -2
  19. package/dist/react/index.js +30 -30
  20. package/dist/react/jsxDevRuntimeCompat.js +1 -1
  21. package/dist/react/router/browser.js +2 -2
  22. package/dist/react/router/index.js +2 -2
  23. package/dist/react/server.js +13 -13
  24. package/dist/svelte/index.js +26 -26
  25. package/dist/svelte/router/page.js +1 -1
  26. package/dist/svelte/server.js +13 -13
  27. package/dist/vue/browser.js +3 -3
  28. package/dist/vue/components/Image.js +1 -1
  29. package/dist/vue/components/index.js +5 -5
  30. package/dist/vue/index.js +36 -36
  31. package/dist/vue/server.js +13 -13
  32. package/package.json +1 -1
  33. package/dist/.absolutejs/generated/angular/indexes/angular-example.1g23yr9r.js +0 -167
  34. package/dist/.absolutejs/generated/react/indexes/ReactExample.e6kzvjqy.js +0 -3
  35. package/dist/.absolutejs/generated/svelte/client/pages/SvelteExample.5pq2wmw6.js +0 -1
  36. package/dist/.absolutejs/generated/svelte/indexes/pages/SvelteExample.9zcw5vtg.js +0 -1
  37. package/dist/.absolutejs/generated/vue/client/pages/VueExample.q47m56s4.js +0 -1
  38. package/dist/.absolutejs/generated/vue/indexes/VueExample.6bqszcxv.js +0 -1
  39. package/dist/_prerendered/angular.html +0 -45
  40. package/dist/_prerendered/angular.meta +0 -1
  41. package/dist/_prerendered/html.html +0 -70
  42. package/dist/_prerendered/html.meta +0 -1
  43. package/dist/_prerendered/htmx.html +0 -239
  44. package/dist/_prerendered/htmx.meta +0 -1
  45. package/dist/_prerendered/index.html +0 -70
  46. package/dist/_prerendered/index.meta +0 -1
  47. package/dist/_prerendered/react.html +0 -1
  48. package/dist/_prerendered/react.meta +0 -1
  49. package/dist/_prerendered/vue.html +0 -41
  50. package/dist/_prerendered/vue.meta +0 -1
  51. package/dist/angular/example/angular/pages/angular-example.djr1v9hj.js +0 -373
  52. package/dist/angular/vendor/angular_common.js +0 -310
  53. package/dist/angular/vendor/angular_common_http.js +0 -129
  54. package/dist/angular/vendor/angular_core.js +0 -1177
  55. package/dist/angular/vendor/angular_core_primitives_di.js +0 -36
  56. package/dist/angular/vendor/angular_core_primitives_signals.js +0 -132
  57. package/dist/angular/vendor/angular_platform-browser.js +0 -117
  58. package/dist/angular/vendor/angular_router.js +0 -6410
  59. package/dist/angular/vendor/chunk-2c9evnn0.js +0 -4764
  60. package/dist/angular/vendor/chunk-3evcs0sk.js +0 -2567
  61. package/dist/angular/vendor/chunk-5h3qyvpj.js +0 -729
  62. package/dist/angular/vendor/chunk-hgg0w52m.js +0 -62
  63. package/dist/angular/vendor/chunk-n6rt7w2y.js +0 -23
  64. package/dist/angular/vendor/chunk-t4tc7c8b.js +0 -28013
  65. package/dist/angular/vendor/chunk-vqd7j0kb.js +0 -1786
  66. package/dist/angular/vendor/chunk-yqjkhk8j.js +0 -145
  67. package/dist/angular/vendor/server/angular_common.js +0 -311
  68. package/dist/angular/vendor/server/angular_common_http.js +0 -130
  69. package/dist/angular/vendor/server/angular_core.js +0 -1178
  70. package/dist/angular/vendor/server/angular_core_primitives_di.js +0 -37
  71. package/dist/angular/vendor/server/angular_core_primitives_signals.js +0 -133
  72. package/dist/angular/vendor/server/angular_platform-browser.js +0 -118
  73. package/dist/angular/vendor/server/angular_platform-server.js +0 -59
  74. package/dist/angular/vendor/server/angular_router.js +0 -261
  75. package/dist/angular/vendor/server/angular_ssr.js +0 -11669
  76. package/dist/angular/vendor/server/chunk-2akxms5e.js +0 -2566
  77. package/dist/angular/vendor/server/chunk-659a9c3p.js +0 -6218
  78. package/dist/angular/vendor/server/chunk-8eecnjd1.js +0 -16686
  79. package/dist/angular/vendor/server/chunk-9jz2apvp.js +0 -743
  80. package/dist/angular/vendor/server/chunk-dhs2bg35.js +0 -48
  81. package/dist/angular/vendor/server/chunk-hs2gc8sr.js +0 -1787
  82. package/dist/angular/vendor/server/chunk-k46n34mb.js +0 -63
  83. package/dist/angular/vendor/server/chunk-p2fdvyh1.js +0 -4767
  84. package/dist/angular/vendor/server/chunk-r0w9r4bg.js +0 -730
  85. package/dist/angular/vendor/server/chunk-vthxj7kd.js +0 -146
  86. package/dist/angular/vendor/server/chunk-xahr7f2f.js +0 -35534
  87. package/dist/assets/css/tailwind.generated.css +0 -218
  88. package/dist/assets/css/vue-example-compiled.abzaxheq.css +0 -32
  89. package/dist/assets/ico/favicon.ico +0 -0
  90. package/dist/assets/png/absolutejs-temp.png +0 -0
  91. package/dist/assets/svg/HTML5_Badge.svg +0 -7
  92. package/dist/assets/svg/angular.svg +0 -18
  93. package/dist/assets/svg/htmx-logo-black.svg +0 -9
  94. package/dist/assets/svg/htmx-logo-white.svg +0 -9
  95. package/dist/assets/svg/react.svg +0 -1
  96. package/dist/assets/svg/svelte-logo.svg +0 -1
  97. package/dist/assets/svg/vue-logo.svg +0 -4
  98. package/dist/chunk-7pp6gkg8.js +0 -2
  99. package/dist/chunk-ek2qyx2c.js +0 -11
  100. package/dist/chunk-ysr5ycdt.js +0 -2
  101. package/dist/client.tsx +0 -15
  102. package/dist/example/html/scripts/typescript-example.fqn9zkdh.js +0 -1
  103. package/dist/html/pages/HTMLExample.html +0 -70
  104. package/dist/htmx/htmx.min.js +0 -1
  105. package/dist/htmx/pages/HTMXExample.html +0 -239
  106. package/dist/htmx.min.js +0 -1
  107. package/dist/indexes/angular-example.xsx88ph0.css +0 -227
  108. package/dist/indexes/html-example.s3banzdc.css +0 -221
  109. package/dist/indexes/htmx-example.5vgssc3f.css +0 -221
  110. package/dist/indexes/react-example.bz1k8xa2.css +0 -245
  111. package/dist/indexes/svelte-example.vy3015es.css +0 -221
  112. package/dist/indexes/vue-example.q4vf2wtq.css +0 -228
  113. package/dist/manifest.json +0 -26
  114. package/dist/nested/dynamic-module.txt +0 -1
  115. package/dist/package-asset.txt +0 -1
  116. package/dist/react/vendor/chunk-2kh60w9b.js +0 -33
  117. package/dist/react/vendor/chunk-9g12fvrw.js +0 -236
  118. package/dist/react/vendor/chunk-rejbymp5.js +0 -837
  119. package/dist/react/vendor/chunk-wwy122hz.js +0 -200
  120. package/dist/react/vendor/react-dom.js +0 -44
  121. package/dist/react/vendor/react-dom_client.js +0 -15864
  122. package/dist/react/vendor/react-refresh_runtime.js +0 -304
  123. package/dist/react/vendor/react.js +0 -103
  124. package/dist/react/vendor/react_jsx-dev-runtime.js +0 -17
  125. package/dist/react/vendor/react_jsx-runtime.js +0 -22
  126. package/dist/robots.txt +0 -2
  127. package/dist/runtime/blob.txt +0 -1
  128. package/dist/runtime/dir-join.txt +0 -1
  129. package/dist/runtime/nested/binary.bin +0 -1
  130. package/dist/runtime/nested/readfile.txt +0 -1
  131. package/dist/runtime/template.html +0 -1
  132. package/dist/server.js +0 -92156
  133. package/dist/sitemap.xml +0 -48
  134. package/dist/svelte/server/pages/SvelteExample.fxs20w1b.js +0 -290
  135. package/dist/svelte/vendor/chunk-5qdxn1p3.js +0 -4586
  136. package/dist/svelte/vendor/chunk-8qdfbbez.js +0 -12
  137. package/dist/svelte/vendor/chunk-r2jyyfjt.js +0 -4495
  138. package/dist/svelte/vendor/svelte.js +0 -49
  139. package/dist/svelte/vendor/svelte_internal.js +0 -2
  140. package/dist/svelte/vendor/svelte_internal_client.js +0 -395
  141. package/dist/svelte/vendor/svelte_internal_disclose-version.js +0 -7
  142. package/dist/svelte/vendor/svelte_internal_flags_async.js +0 -6
  143. package/dist/svelte/vendor/svelte_internal_flags_legacy.js +0 -6
  144. package/dist/svelte/vendor/svelte_store.js +0 -99
  145. package/dist/vue/server/pages/VueExample.fyhmna2p.css +0 -32
  146. package/dist/vue/server/pages/VueExample.fyhmna2p.js +0 -75
  147. package/dist/vue/vendor/vue.js +0 -11011
@@ -1,4764 +0,0 @@
1
- import {
2
- BrowserPlatformLocation,
3
- DomAdapter,
4
- LOCATION_INITIALIZED,
5
- PlatformLocation,
6
- XhrFactory,
7
- getDOM,
8
- parseCookieValue,
9
- setRootDomAdapter
10
- } from "./chunk-yqjkhk8j.js";
11
- import {
12
- ApplicationRef,
13
- Attribute,
14
- ChangeDetectorRef,
15
- DEFAULT_CURRENCY_CODE,
16
- DOCUMENT,
17
- DestroyRef,
18
- Directive,
19
- ElementRef,
20
- Host,
21
- IMAGE_CONFIG,
22
- IMAGE_CONFIG_DEFAULTS,
23
- INTERNAL_APPLICATION_ERROR_HANDLER,
24
- Inject,
25
- Injectable,
26
- InjectionToken,
27
- Injector,
28
- Input,
29
- IterableDiffers,
30
- KeyValueDiffers,
31
- LOCALE_ID,
32
- LocaleDataIndex,
33
- NgModule,
34
- NgModuleRef$1,
35
- NgZone,
36
- Optional,
37
- Pipe,
38
- Renderer2,
39
- RendererStyleFlags2,
40
- RuntimeError,
41
- Subject,
42
- TemplateRef,
43
- Version,
44
- ViewContainerRef,
45
- booleanAttribute,
46
- createNgModule,
47
- findLocaleData,
48
- formatRuntimeError,
49
- getLocaleCurrencyCode,
50
- getLocalePluralCase,
51
- inject,
52
- isPromise,
53
- isSignal,
54
- isSubscribable,
55
- numberAttribute,
56
- performanceMarkFeature,
57
- registerLocaleData,
58
- setClassMetadata,
59
- stringify,
60
- untracked,
61
- unwrapSafeValue,
62
- ɵɵNgOnChangesFeature as ɵ_NgOnChangesFeature,
63
- ɵɵdefineDirective as ɵ_defineDirective,
64
- ɵɵdefineInjectable as ɵ_defineInjectable,
65
- ɵɵdefineInjector as ɵ_defineInjector,
66
- ɵɵdefineNgModule as ɵ_defineNgModule,
67
- ɵɵdefinePipe as ɵ_definePipe,
68
- ɵɵdirectiveInject as ɵ_directiveInject,
69
- ɵɵgetInheritedFactory as ɵ_getInheritedFactory,
70
- ɵɵinject as ɵ_inject,
71
- ɵɵinjectAttribute as ɵ_injectAttribute,
72
- ɵɵstyleProp as ɵ_styleProp
73
- } from "./chunk-t4tc7c8b.js";
74
- import {
75
- __export
76
- } from "./chunk-n6rt7w2y.js";
77
-
78
- // node_modules/@angular/common/fesm2022/_location-chunk.mjs
79
- function joinWithSlash(start, end) {
80
- if (!start)
81
- return end;
82
- if (!end)
83
- return start;
84
- if (start.endsWith("/")) {
85
- return end.startsWith("/") ? start + end.slice(1) : start + end;
86
- }
87
- return end.startsWith("/") ? start + end : `${start}/${end}`;
88
- }
89
- function stripTrailingSlash(url) {
90
- const pathEndIdx = url.search(/#|\?|$/);
91
- return url[pathEndIdx - 1] === "/" ? url.slice(0, pathEndIdx - 1) + url.slice(pathEndIdx) : url;
92
- }
93
- function normalizeQueryParams(params) {
94
- return params && params[0] !== "?" ? `?${params}` : params;
95
- }
96
-
97
- class LocationStrategy {
98
- historyGo(relativePosition) {
99
- throw new Error(ngDevMode ? "Not implemented" : "");
100
- }
101
- static ɵfac = function LocationStrategy_Factory(__ngFactoryType__) {
102
- return new (__ngFactoryType__ || LocationStrategy);
103
- };
104
- static ɵprov = /* @__PURE__ */ ɵ_defineInjectable({
105
- token: LocationStrategy,
106
- factory: () => (() => inject(PathLocationStrategy))(),
107
- providedIn: "root"
108
- });
109
- }
110
- (() => {
111
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LocationStrategy, [{
112
- type: Injectable,
113
- args: [{
114
- providedIn: "root",
115
- useFactory: () => inject(PathLocationStrategy)
116
- }]
117
- }], null, null);
118
- })();
119
- var APP_BASE_HREF = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "appBaseHref" : "");
120
-
121
- class PathLocationStrategy extends LocationStrategy {
122
- _platformLocation;
123
- _baseHref;
124
- _removeListenerFns = [];
125
- constructor(_platformLocation, href) {
126
- super();
127
- this._platformLocation = _platformLocation;
128
- this._baseHref = href ?? this._platformLocation.getBaseHrefFromDOM() ?? inject(DOCUMENT).location?.origin ?? "";
129
- }
130
- ngOnDestroy() {
131
- while (this._removeListenerFns.length) {
132
- this._removeListenerFns.pop()();
133
- }
134
- }
135
- onPopState(fn) {
136
- this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));
137
- }
138
- getBaseHref() {
139
- return this._baseHref;
140
- }
141
- prepareExternalUrl(internal) {
142
- return joinWithSlash(this._baseHref, internal);
143
- }
144
- path(includeHash = false) {
145
- const pathname = this._platformLocation.pathname + normalizeQueryParams(this._platformLocation.search);
146
- const hash = this._platformLocation.hash;
147
- return hash && includeHash ? `${pathname}${hash}` : pathname;
148
- }
149
- pushState(state, title, url, queryParams) {
150
- const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));
151
- this._platformLocation.pushState(state, title, externalUrl);
152
- }
153
- replaceState(state, title, url, queryParams) {
154
- const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));
155
- this._platformLocation.replaceState(state, title, externalUrl);
156
- }
157
- forward() {
158
- this._platformLocation.forward();
159
- }
160
- back() {
161
- this._platformLocation.back();
162
- }
163
- getState() {
164
- return this._platformLocation.getState();
165
- }
166
- historyGo(relativePosition = 0) {
167
- this._platformLocation.historyGo?.(relativePosition);
168
- }
169
- static ɵfac = function PathLocationStrategy_Factory(__ngFactoryType__) {
170
- return new (__ngFactoryType__ || PathLocationStrategy)(ɵ_inject(PlatformLocation), ɵ_inject(APP_BASE_HREF, 8));
171
- };
172
- static ɵprov = /* @__PURE__ */ ɵ_defineInjectable({
173
- token: PathLocationStrategy,
174
- factory: PathLocationStrategy.ɵfac,
175
- providedIn: "root"
176
- });
177
- }
178
- (() => {
179
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PathLocationStrategy, [{
180
- type: Injectable,
181
- args: [{
182
- providedIn: "root"
183
- }]
184
- }], () => [{
185
- type: PlatformLocation
186
- }, {
187
- type: undefined,
188
- decorators: [{
189
- type: Optional
190
- }, {
191
- type: Inject,
192
- args: [APP_BASE_HREF]
193
- }]
194
- }], null);
195
- })();
196
-
197
- class NoTrailingSlashPathLocationStrategy extends PathLocationStrategy {
198
- prepareExternalUrl(internal) {
199
- const path = extractUrlPath(internal);
200
- if (path.endsWith("/") && path.length > 1) {
201
- internal = path.slice(0, -1) + internal.slice(path.length);
202
- }
203
- return super.prepareExternalUrl(internal);
204
- }
205
- static ɵfac = /* @__PURE__ */ (() => {
206
- let ɵNoTrailingSlashPathLocationStrategy_BaseFactory;
207
- return function NoTrailingSlashPathLocationStrategy_Factory(__ngFactoryType__) {
208
- return (ɵNoTrailingSlashPathLocationStrategy_BaseFactory || (ɵNoTrailingSlashPathLocationStrategy_BaseFactory = ɵ_getInheritedFactory(NoTrailingSlashPathLocationStrategy)))(__ngFactoryType__ || NoTrailingSlashPathLocationStrategy);
209
- };
210
- })();
211
- static ɵprov = /* @__PURE__ */ ɵ_defineInjectable({
212
- token: NoTrailingSlashPathLocationStrategy,
213
- factory: NoTrailingSlashPathLocationStrategy.ɵfac,
214
- providedIn: "root"
215
- });
216
- }
217
- (() => {
218
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NoTrailingSlashPathLocationStrategy, [{
219
- type: Injectable,
220
- args: [{
221
- providedIn: "root"
222
- }]
223
- }], null, null);
224
- })();
225
-
226
- class TrailingSlashPathLocationStrategy extends PathLocationStrategy {
227
- prepareExternalUrl(internal) {
228
- const path = extractUrlPath(internal);
229
- if (!path.endsWith("/")) {
230
- internal = path + "/" + internal.slice(path.length);
231
- }
232
- return super.prepareExternalUrl(internal);
233
- }
234
- static ɵfac = /* @__PURE__ */ (() => {
235
- let ɵTrailingSlashPathLocationStrategy_BaseFactory;
236
- return function TrailingSlashPathLocationStrategy_Factory(__ngFactoryType__) {
237
- return (ɵTrailingSlashPathLocationStrategy_BaseFactory || (ɵTrailingSlashPathLocationStrategy_BaseFactory = ɵ_getInheritedFactory(TrailingSlashPathLocationStrategy)))(__ngFactoryType__ || TrailingSlashPathLocationStrategy);
238
- };
239
- })();
240
- static ɵprov = /* @__PURE__ */ ɵ_defineInjectable({
241
- token: TrailingSlashPathLocationStrategy,
242
- factory: TrailingSlashPathLocationStrategy.ɵfac,
243
- providedIn: "root"
244
- });
245
- }
246
- (() => {
247
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TrailingSlashPathLocationStrategy, [{
248
- type: Injectable,
249
- args: [{
250
- providedIn: "root"
251
- }]
252
- }], null, null);
253
- })();
254
- function extractUrlPath(url) {
255
- const questionMarkOrHashIndex = url.search(/[?#]/);
256
- const pathEnd = questionMarkOrHashIndex > -1 ? questionMarkOrHashIndex : url.length;
257
- return url.slice(0, pathEnd);
258
- }
259
-
260
- class Location {
261
- _subject = new Subject;
262
- _basePath;
263
- _locationStrategy;
264
- _urlChangeListeners = [];
265
- _urlChangeSubscription = null;
266
- constructor(locationStrategy) {
267
- this._locationStrategy = locationStrategy;
268
- const baseHref = this._locationStrategy.getBaseHref();
269
- this._basePath = _stripOrigin(stripTrailingSlash(_stripIndexHtml(baseHref)));
270
- this._locationStrategy.onPopState((ev) => {
271
- this._subject.next({
272
- url: this.path(true),
273
- pop: true,
274
- state: ev.state,
275
- type: ev.type
276
- });
277
- });
278
- }
279
- ngOnDestroy() {
280
- this._urlChangeSubscription?.unsubscribe();
281
- this._urlChangeListeners = [];
282
- }
283
- path(includeHash = false) {
284
- return this.normalize(this._locationStrategy.path(includeHash));
285
- }
286
- getState() {
287
- return this._locationStrategy.getState();
288
- }
289
- isCurrentPathEqualTo(path, query = "") {
290
- return this.path() == this.normalize(path + normalizeQueryParams(query));
291
- }
292
- normalize(url) {
293
- return Location.stripTrailingSlash(_stripBasePath(this._basePath, _stripIndexHtml(url)));
294
- }
295
- prepareExternalUrl(url) {
296
- if (url && url[0] !== "/") {
297
- url = "/" + url;
298
- }
299
- return this._locationStrategy.prepareExternalUrl(url);
300
- }
301
- go(path, query = "", state = null) {
302
- this._locationStrategy.pushState(state, "", path, query);
303
- this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);
304
- }
305
- replaceState(path, query = "", state = null) {
306
- this._locationStrategy.replaceState(state, "", path, query);
307
- this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);
308
- }
309
- forward() {
310
- this._locationStrategy.forward();
311
- }
312
- back() {
313
- this._locationStrategy.back();
314
- }
315
- historyGo(relativePosition = 0) {
316
- this._locationStrategy.historyGo?.(relativePosition);
317
- }
318
- onUrlChange(fn) {
319
- this._urlChangeListeners.push(fn);
320
- this._urlChangeSubscription ??= this.subscribe((v) => {
321
- this._notifyUrlChangeListeners(v.url, v.state);
322
- });
323
- return () => {
324
- const fnIndex = this._urlChangeListeners.indexOf(fn);
325
- this._urlChangeListeners.splice(fnIndex, 1);
326
- if (this._urlChangeListeners.length === 0) {
327
- this._urlChangeSubscription?.unsubscribe();
328
- this._urlChangeSubscription = null;
329
- }
330
- };
331
- }
332
- _notifyUrlChangeListeners(url = "", state) {
333
- this._urlChangeListeners.forEach((fn) => fn(url, state));
334
- }
335
- subscribe(onNext, onThrow, onReturn) {
336
- return this._subject.subscribe({
337
- next: onNext,
338
- error: onThrow ?? undefined,
339
- complete: onReturn ?? undefined
340
- });
341
- }
342
- static normalizeQueryParams = normalizeQueryParams;
343
- static joinWithSlash = joinWithSlash;
344
- static stripTrailingSlash = stripTrailingSlash;
345
- static ɵfac = function Location_Factory(__ngFactoryType__) {
346
- return new (__ngFactoryType__ || Location)(ɵ_inject(LocationStrategy));
347
- };
348
- static ɵprov = /* @__PURE__ */ ɵ_defineInjectable({
349
- token: Location,
350
- factory: () => createLocation(),
351
- providedIn: "root"
352
- });
353
- }
354
- (() => {
355
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Location, [{
356
- type: Injectable,
357
- args: [{
358
- providedIn: "root",
359
- useFactory: createLocation
360
- }]
361
- }], () => [{
362
- type: LocationStrategy
363
- }], null);
364
- })();
365
- function createLocation() {
366
- return new Location(ɵ_inject(LocationStrategy));
367
- }
368
- function _stripBasePath(basePath, url) {
369
- if (!basePath || !url.startsWith(basePath)) {
370
- return url;
371
- }
372
- const strippedUrl = url.substring(basePath.length);
373
- if (strippedUrl === "" || ["/", ";", "?", "#"].includes(strippedUrl[0])) {
374
- return strippedUrl;
375
- }
376
- return url;
377
- }
378
- function _stripIndexHtml(url) {
379
- return url.replace(/\/index.html$/, "");
380
- }
381
- function _stripOrigin(baseHref) {
382
- const isAbsoluteUrl = new RegExp("^(https?:)?//").test(baseHref);
383
- if (isAbsoluteUrl) {
384
- const [, pathname] = baseHref.split(/\/\/[^\/]+/);
385
- return pathname;
386
- }
387
- return baseHref;
388
- }
389
-
390
- // node_modules/@angular/common/fesm2022/_common_module-chunk.mjs
391
- class HashLocationStrategy extends LocationStrategy {
392
- _platformLocation;
393
- _baseHref = "";
394
- _removeListenerFns = [];
395
- constructor(_platformLocation, _baseHref) {
396
- super();
397
- this._platformLocation = _platformLocation;
398
- if (_baseHref != null) {
399
- this._baseHref = _baseHref;
400
- }
401
- }
402
- ngOnDestroy() {
403
- while (this._removeListenerFns.length) {
404
- this._removeListenerFns.pop()();
405
- }
406
- }
407
- onPopState(fn) {
408
- this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));
409
- }
410
- getBaseHref() {
411
- return this._baseHref;
412
- }
413
- path(includeHash = false) {
414
- const path = this._platformLocation.hash ?? "#";
415
- return path.length > 0 ? path.substring(1) : path;
416
- }
417
- prepareExternalUrl(internal) {
418
- const url = joinWithSlash(this._baseHref, internal);
419
- return url.length > 0 ? "#" + url : url;
420
- }
421
- pushState(state, title, path, queryParams) {
422
- const url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)) || this._platformLocation.pathname;
423
- this._platformLocation.pushState(state, title, url);
424
- }
425
- replaceState(state, title, path, queryParams) {
426
- const url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)) || this._platformLocation.pathname;
427
- this._platformLocation.replaceState(state, title, url);
428
- }
429
- forward() {
430
- this._platformLocation.forward();
431
- }
432
- back() {
433
- this._platformLocation.back();
434
- }
435
- getState() {
436
- return this._platformLocation.getState();
437
- }
438
- historyGo(relativePosition = 0) {
439
- this._platformLocation.historyGo?.(relativePosition);
440
- }
441
- static ɵfac = function HashLocationStrategy_Factory(__ngFactoryType__) {
442
- return new (__ngFactoryType__ || HashLocationStrategy)(ɵ_inject(PlatformLocation), ɵ_inject(APP_BASE_HREF, 8));
443
- };
444
- static ɵprov = /* @__PURE__ */ ɵ_defineInjectable({
445
- token: HashLocationStrategy,
446
- factory: HashLocationStrategy.ɵfac
447
- });
448
- }
449
- (() => {
450
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HashLocationStrategy, [{
451
- type: Injectable
452
- }], () => [{
453
- type: PlatformLocation
454
- }, {
455
- type: undefined,
456
- decorators: [{
457
- type: Optional
458
- }, {
459
- type: Inject,
460
- args: [APP_BASE_HREF]
461
- }]
462
- }], null);
463
- })();
464
- var CURRENCIES_EN = {
465
- ADP: [undefined, undefined, 0],
466
- AFN: [undefined, "؋", 0],
467
- ALL: [undefined, undefined, 0],
468
- AMD: [undefined, "֏", 2],
469
- AOA: [undefined, "Kz"],
470
- ARS: [undefined, "$"],
471
- AUD: ["A$", "$"],
472
- AZN: [undefined, "₼"],
473
- BAM: [undefined, "KM"],
474
- BBD: [undefined, "$"],
475
- BDT: [undefined, "৳"],
476
- BHD: [undefined, undefined, 3],
477
- BIF: [undefined, undefined, 0],
478
- BMD: [undefined, "$"],
479
- BND: [undefined, "$"],
480
- BOB: [undefined, "Bs"],
481
- BRL: ["R$"],
482
- BSD: [undefined, "$"],
483
- BWP: [undefined, "P"],
484
- BYN: [undefined, undefined, 2],
485
- BYR: [undefined, undefined, 0],
486
- BZD: [undefined, "$"],
487
- CAD: ["CA$", "$", 2],
488
- CHF: [undefined, undefined, 2],
489
- CLF: [undefined, undefined, 4],
490
- CLP: [undefined, "$", 0],
491
- CNY: ["CN¥", "¥"],
492
- COP: [undefined, "$", 2],
493
- CRC: [undefined, "₡", 2],
494
- CUC: [undefined, "$"],
495
- CUP: [undefined, "$"],
496
- CZK: [undefined, "Kč", 2],
497
- DJF: [undefined, undefined, 0],
498
- DKK: [undefined, "kr", 2],
499
- DOP: [undefined, "$"],
500
- EGP: [undefined, "E£"],
501
- ESP: [undefined, "₧", 0],
502
- EUR: ["€"],
503
- FJD: [undefined, "$"],
504
- FKP: [undefined, "£"],
505
- GBP: ["£"],
506
- GEL: [undefined, "₾"],
507
- GHS: [undefined, "GH₵"],
508
- GIP: [undefined, "£"],
509
- GNF: [undefined, "FG", 0],
510
- GTQ: [undefined, "Q"],
511
- GYD: [undefined, "$", 2],
512
- HKD: ["HK$", "$"],
513
- HNL: [undefined, "L"],
514
- HRK: [undefined, "kn"],
515
- HUF: [undefined, "Ft", 2],
516
- IDR: [undefined, "Rp", 2],
517
- ILS: ["₪"],
518
- INR: ["₹"],
519
- IQD: [undefined, undefined, 0],
520
- IRR: [undefined, undefined, 0],
521
- ISK: [undefined, "kr", 0],
522
- ITL: [undefined, undefined, 0],
523
- JMD: [undefined, "$"],
524
- JOD: [undefined, undefined, 3],
525
- JPY: ["¥", undefined, 0],
526
- KGS: [undefined, "⃀"],
527
- KHR: [undefined, "៛"],
528
- KMF: [undefined, "CF", 0],
529
- KPW: [undefined, "₩", 0],
530
- KRW: ["₩", undefined, 0],
531
- KWD: [undefined, undefined, 3],
532
- KYD: [undefined, "$"],
533
- KZT: [undefined, "₸"],
534
- LAK: [undefined, "₭", 0],
535
- LBP: [undefined, "L£", 0],
536
- LKR: [undefined, "Rs"],
537
- LRD: [undefined, "$"],
538
- LTL: [undefined, "Lt"],
539
- LUF: [undefined, undefined, 0],
540
- LVL: [undefined, "Ls"],
541
- LYD: [undefined, undefined, 3],
542
- MGA: [undefined, "Ar", 0],
543
- MGF: [undefined, undefined, 0],
544
- MMK: [undefined, "K", 0],
545
- MNT: [undefined, "₮", 2],
546
- MRO: [undefined, undefined, 0],
547
- MUR: [undefined, "Rs", 2],
548
- MXN: ["MX$", "$"],
549
- MYR: [undefined, "RM"],
550
- NAD: [undefined, "$"],
551
- NGN: [undefined, "₦"],
552
- NIO: [undefined, "C$"],
553
- NOK: [undefined, "kr", 2],
554
- NPR: [undefined, "Rs"],
555
- NZD: ["NZ$", "$"],
556
- OMR: [undefined, undefined, 3],
557
- PHP: ["₱"],
558
- PKR: [undefined, "Rs", 2],
559
- PLN: [undefined, "zł"],
560
- PYG: [undefined, "₲", 0],
561
- RON: [undefined, "lei"],
562
- RSD: [undefined, undefined, 0],
563
- RUB: [undefined, "₽"],
564
- RWF: [undefined, "RF", 0],
565
- SBD: [undefined, "$"],
566
- SEK: [undefined, "kr", 2],
567
- SGD: [undefined, "$"],
568
- SHP: [undefined, "£"],
569
- SLE: [undefined, undefined, 2],
570
- SLL: [undefined, undefined, 0],
571
- SOS: [undefined, undefined, 0],
572
- SRD: [undefined, "$"],
573
- SSP: [undefined, "£"],
574
- STD: [undefined, undefined, 0],
575
- STN: [undefined, "Db"],
576
- SYP: [undefined, "£", 0],
577
- THB: [undefined, "฿"],
578
- TMM: [undefined, undefined, 0],
579
- TND: [undefined, undefined, 3],
580
- TOP: [undefined, "T$"],
581
- TRL: [undefined, undefined, 0],
582
- TRY: [undefined, "₺"],
583
- TTD: [undefined, "$"],
584
- TWD: ["NT$", "$", 2],
585
- TZS: [undefined, undefined, 2],
586
- UAH: [undefined, "₴"],
587
- UGX: [undefined, undefined, 0],
588
- USD: ["$"],
589
- UYI: [undefined, undefined, 0],
590
- UYU: [undefined, "$"],
591
- UYW: [undefined, undefined, 4],
592
- UZS: [undefined, undefined, 2],
593
- VEF: [undefined, "Bs", 2],
594
- VND: ["₫", undefined, 0],
595
- VUV: [undefined, undefined, 0],
596
- XAF: ["FCFA", undefined, 0],
597
- XCD: ["EC$", "$"],
598
- XCG: ["Cg."],
599
- XOF: ["F CFA", undefined, 0],
600
- XPF: ["CFPF", undefined, 0],
601
- XXX: ["¤"],
602
- YER: [undefined, undefined, 0],
603
- ZAR: [undefined, "R"],
604
- ZMK: [undefined, undefined, 0],
605
- ZMW: [undefined, "ZK"],
606
- ZWD: [undefined, undefined, 0]
607
- };
608
- var NumberFormatStyle;
609
- (function(NumberFormatStyle2) {
610
- NumberFormatStyle2[NumberFormatStyle2["Decimal"] = 0] = "Decimal";
611
- NumberFormatStyle2[NumberFormatStyle2["Percent"] = 1] = "Percent";
612
- NumberFormatStyle2[NumberFormatStyle2["Currency"] = 2] = "Currency";
613
- NumberFormatStyle2[NumberFormatStyle2["Scientific"] = 3] = "Scientific";
614
- })(NumberFormatStyle || (NumberFormatStyle = {}));
615
- var Plural;
616
- (function(Plural2) {
617
- Plural2[Plural2["Zero"] = 0] = "Zero";
618
- Plural2[Plural2["One"] = 1] = "One";
619
- Plural2[Plural2["Two"] = 2] = "Two";
620
- Plural2[Plural2["Few"] = 3] = "Few";
621
- Plural2[Plural2["Many"] = 4] = "Many";
622
- Plural2[Plural2["Other"] = 5] = "Other";
623
- })(Plural || (Plural = {}));
624
- var FormStyle;
625
- (function(FormStyle2) {
626
- FormStyle2[FormStyle2["Format"] = 0] = "Format";
627
- FormStyle2[FormStyle2["Standalone"] = 1] = "Standalone";
628
- })(FormStyle || (FormStyle = {}));
629
- var TranslationWidth;
630
- (function(TranslationWidth2) {
631
- TranslationWidth2[TranslationWidth2["Narrow"] = 0] = "Narrow";
632
- TranslationWidth2[TranslationWidth2["Abbreviated"] = 1] = "Abbreviated";
633
- TranslationWidth2[TranslationWidth2["Wide"] = 2] = "Wide";
634
- TranslationWidth2[TranslationWidth2["Short"] = 3] = "Short";
635
- })(TranslationWidth || (TranslationWidth = {}));
636
- var FormatWidth;
637
- (function(FormatWidth2) {
638
- FormatWidth2[FormatWidth2["Short"] = 0] = "Short";
639
- FormatWidth2[FormatWidth2["Medium"] = 1] = "Medium";
640
- FormatWidth2[FormatWidth2["Long"] = 2] = "Long";
641
- FormatWidth2[FormatWidth2["Full"] = 3] = "Full";
642
- })(FormatWidth || (FormatWidth = {}));
643
- var NumberSymbol = {
644
- Decimal: 0,
645
- Group: 1,
646
- List: 2,
647
- PercentSign: 3,
648
- PlusSign: 4,
649
- MinusSign: 5,
650
- Exponential: 6,
651
- SuperscriptingExponent: 7,
652
- PerMille: 8,
653
- Infinity: 9,
654
- NaN: 10,
655
- TimeSeparator: 11,
656
- CurrencyDecimal: 12,
657
- CurrencyGroup: 13
658
- };
659
- var WeekDay;
660
- (function(WeekDay2) {
661
- WeekDay2[WeekDay2["Sunday"] = 0] = "Sunday";
662
- WeekDay2[WeekDay2["Monday"] = 1] = "Monday";
663
- WeekDay2[WeekDay2["Tuesday"] = 2] = "Tuesday";
664
- WeekDay2[WeekDay2["Wednesday"] = 3] = "Wednesday";
665
- WeekDay2[WeekDay2["Thursday"] = 4] = "Thursday";
666
- WeekDay2[WeekDay2["Friday"] = 5] = "Friday";
667
- WeekDay2[WeekDay2["Saturday"] = 6] = "Saturday";
668
- })(WeekDay || (WeekDay = {}));
669
- function getLocaleId(locale) {
670
- return findLocaleData(locale)[LocaleDataIndex.LocaleId];
671
- }
672
- function getLocaleDayPeriods(locale, formStyle, width) {
673
- const data = findLocaleData(locale);
674
- const amPmData = [data[LocaleDataIndex.DayPeriodsFormat], data[LocaleDataIndex.DayPeriodsStandalone]];
675
- const amPm = getLastDefinedValue(amPmData, formStyle);
676
- return getLastDefinedValue(amPm, width);
677
- }
678
- function getLocaleDayNames(locale, formStyle, width) {
679
- const data = findLocaleData(locale);
680
- const daysData = [data[LocaleDataIndex.DaysFormat], data[LocaleDataIndex.DaysStandalone]];
681
- const days = getLastDefinedValue(daysData, formStyle);
682
- return getLastDefinedValue(days, width);
683
- }
684
- function getLocaleMonthNames(locale, formStyle, width) {
685
- const data = findLocaleData(locale);
686
- const monthsData = [data[LocaleDataIndex.MonthsFormat], data[LocaleDataIndex.MonthsStandalone]];
687
- const months = getLastDefinedValue(monthsData, formStyle);
688
- return getLastDefinedValue(months, width);
689
- }
690
- function getLocaleEraNames(locale, width) {
691
- const data = findLocaleData(locale);
692
- const erasData = data[LocaleDataIndex.Eras];
693
- return getLastDefinedValue(erasData, width);
694
- }
695
- function getLocaleFirstDayOfWeek(locale) {
696
- const data = findLocaleData(locale);
697
- return data[LocaleDataIndex.FirstDayOfWeek];
698
- }
699
- function getLocaleWeekEndRange(locale) {
700
- const data = findLocaleData(locale);
701
- return data[LocaleDataIndex.WeekendRange];
702
- }
703
- function getLocaleDateFormat(locale, width) {
704
- const data = findLocaleData(locale);
705
- return getLastDefinedValue(data[LocaleDataIndex.DateFormat], width);
706
- }
707
- function getLocaleTimeFormat(locale, width) {
708
- const data = findLocaleData(locale);
709
- return getLastDefinedValue(data[LocaleDataIndex.TimeFormat], width);
710
- }
711
- function getLocaleDateTimeFormat(locale, width) {
712
- const data = findLocaleData(locale);
713
- const dateTimeFormatData = data[LocaleDataIndex.DateTimeFormat];
714
- return getLastDefinedValue(dateTimeFormatData, width);
715
- }
716
- function getLocaleNumberSymbol(locale, symbol) {
717
- const data = findLocaleData(locale);
718
- const res = data[LocaleDataIndex.NumberSymbols][symbol];
719
- if (typeof res === "undefined") {
720
- if (symbol === NumberSymbol.CurrencyDecimal) {
721
- return data[LocaleDataIndex.NumberSymbols][NumberSymbol.Decimal];
722
- } else if (symbol === NumberSymbol.CurrencyGroup) {
723
- return data[LocaleDataIndex.NumberSymbols][NumberSymbol.Group];
724
- }
725
- }
726
- return res;
727
- }
728
- function getLocaleNumberFormat(locale, type) {
729
- const data = findLocaleData(locale);
730
- return data[LocaleDataIndex.NumberFormats][type];
731
- }
732
- function getLocaleCurrencySymbol(locale) {
733
- const data = findLocaleData(locale);
734
- return data[LocaleDataIndex.CurrencySymbol] || null;
735
- }
736
- function getLocaleCurrencyName(locale) {
737
- const data = findLocaleData(locale);
738
- return data[LocaleDataIndex.CurrencyName] || null;
739
- }
740
- function getLocaleCurrencyCode2(locale) {
741
- return getLocaleCurrencyCode(locale);
742
- }
743
- function getLocaleCurrencies(locale) {
744
- const data = findLocaleData(locale);
745
- return data[LocaleDataIndex.Currencies];
746
- }
747
- var getLocalePluralCase2 = getLocalePluralCase;
748
- function checkFullData(data) {
749
- if (!data[LocaleDataIndex.ExtraData]) {
750
- throw new RuntimeError(2303, ngDevMode && `Missing extra locale data for the locale "${data[LocaleDataIndex.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`);
751
- }
752
- }
753
- function getLocaleExtraDayPeriodRules(locale) {
754
- const data = findLocaleData(locale);
755
- checkFullData(data);
756
- const rules = data[LocaleDataIndex.ExtraData][2] || [];
757
- return rules.map((rule) => {
758
- if (typeof rule === "string") {
759
- return extractTime(rule);
760
- }
761
- return [extractTime(rule[0]), extractTime(rule[1])];
762
- });
763
- }
764
- function getLocaleExtraDayPeriods(locale, formStyle, width) {
765
- const data = findLocaleData(locale);
766
- checkFullData(data);
767
- const dayPeriodsData = [data[LocaleDataIndex.ExtraData][0], data[LocaleDataIndex.ExtraData][1]];
768
- const dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];
769
- return getLastDefinedValue(dayPeriods, width) || [];
770
- }
771
- function getLocaleDirection(locale) {
772
- const data = findLocaleData(locale);
773
- return data[LocaleDataIndex.Directionality];
774
- }
775
- function getLastDefinedValue(data, index) {
776
- for (let i = index;i > -1; i--) {
777
- if (typeof data[i] !== "undefined") {
778
- return data[i];
779
- }
780
- }
781
- throw new RuntimeError(2304, ngDevMode && "Locale data API: locale data undefined");
782
- }
783
- function extractTime(time) {
784
- const [h, m] = time.split(":");
785
- return {
786
- hours: +h,
787
- minutes: +m
788
- };
789
- }
790
- function getCurrencySymbol(code, format, locale = "en") {
791
- const currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];
792
- const symbolNarrow = currency[1];
793
- if (format === "narrow" && typeof symbolNarrow === "string") {
794
- return symbolNarrow;
795
- }
796
- return currency[0] || code;
797
- }
798
- var DEFAULT_NB_OF_CURRENCY_DIGITS = 2;
799
- function getNumberOfCurrencyDigits(code) {
800
- let digits;
801
- const currency = CURRENCIES_EN[code];
802
- if (currency) {
803
- digits = currency[2];
804
- }
805
- return typeof digits === "number" ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;
806
- }
807
- var ISO8601_DATE_REGEX = /^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
808
- var NAMED_FORMATS = {};
809
- var DATE_FORMATS_SPLIT = /((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;
810
- function formatDate(value, format, locale, timezone) {
811
- let date = toDate(value);
812
- const namedFormat = getNamedFormat(locale, format);
813
- format = namedFormat || format;
814
- let parts = [];
815
- let match;
816
- while (format) {
817
- match = DATE_FORMATS_SPLIT.exec(format);
818
- if (match) {
819
- parts = parts.concat(match.slice(1));
820
- const part = parts.pop();
821
- if (!part) {
822
- break;
823
- }
824
- format = part;
825
- } else {
826
- parts.push(format);
827
- break;
828
- }
829
- }
830
- if (typeof ngDevMode === "undefined" || ngDevMode) {
831
- assertValidDateFormat(parts);
832
- }
833
- let dateTimezoneOffset = date.getTimezoneOffset();
834
- if (timezone) {
835
- dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
836
- date = convertTimezoneToLocal(date, timezone);
837
- }
838
- let text = "";
839
- parts.forEach((value2) => {
840
- const dateFormatter = getDateFormatter(value2);
841
- text += dateFormatter ? dateFormatter(date, locale, dateTimezoneOffset) : value2 === "''" ? "'" : value2.replace(/(^'|'$)/g, "").replace(/''/g, "'");
842
- });
843
- return text;
844
- }
845
- function assertValidDateFormat(parts) {
846
- if (parts.some((part) => /^Y+$/.test(part)) && !parts.some((part) => /^w+$/.test(part))) {
847
- const message = `Suspicious use of week-based year "Y" in date pattern "${parts.join("")}". Did you mean to use calendar year "y" instead?`;
848
- if (parts.length === 1) {
849
- console.error(formatRuntimeError(2300, message));
850
- } else {
851
- throw new RuntimeError(2300, message);
852
- }
853
- }
854
- }
855
- function createDate(year, month, date) {
856
- const newDate = new Date(0);
857
- newDate.setFullYear(year, month, date);
858
- newDate.setHours(0, 0, 0);
859
- return newDate;
860
- }
861
- function getNamedFormat(locale, format) {
862
- const localeId = getLocaleId(locale);
863
- NAMED_FORMATS[localeId] ??= {};
864
- if (NAMED_FORMATS[localeId][format]) {
865
- return NAMED_FORMATS[localeId][format];
866
- }
867
- let formatValue = "";
868
- switch (format) {
869
- case "shortDate":
870
- formatValue = getLocaleDateFormat(locale, FormatWidth.Short);
871
- break;
872
- case "mediumDate":
873
- formatValue = getLocaleDateFormat(locale, FormatWidth.Medium);
874
- break;
875
- case "longDate":
876
- formatValue = getLocaleDateFormat(locale, FormatWidth.Long);
877
- break;
878
- case "fullDate":
879
- formatValue = getLocaleDateFormat(locale, FormatWidth.Full);
880
- break;
881
- case "shortTime":
882
- formatValue = getLocaleTimeFormat(locale, FormatWidth.Short);
883
- break;
884
- case "mediumTime":
885
- formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium);
886
- break;
887
- case "longTime":
888
- formatValue = getLocaleTimeFormat(locale, FormatWidth.Long);
889
- break;
890
- case "fullTime":
891
- formatValue = getLocaleTimeFormat(locale, FormatWidth.Full);
892
- break;
893
- case "short":
894
- const shortTime = getNamedFormat(locale, "shortTime");
895
- const shortDate = getNamedFormat(locale, "shortDate");
896
- formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]);
897
- break;
898
- case "medium":
899
- const mediumTime = getNamedFormat(locale, "mediumTime");
900
- const mediumDate = getNamedFormat(locale, "mediumDate");
901
- formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]);
902
- break;
903
- case "long":
904
- const longTime = getNamedFormat(locale, "longTime");
905
- const longDate = getNamedFormat(locale, "longDate");
906
- formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]);
907
- break;
908
- case "full":
909
- const fullTime = getNamedFormat(locale, "fullTime");
910
- const fullDate = getNamedFormat(locale, "fullDate");
911
- formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]);
912
- break;
913
- }
914
- if (formatValue) {
915
- NAMED_FORMATS[localeId][format] = formatValue;
916
- }
917
- return formatValue;
918
- }
919
- function formatDateTime(str, opt_values) {
920
- if (opt_values) {
921
- str = str.replace(/\{([^}]+)}/g, function(match, key) {
922
- return opt_values != null && key in opt_values ? opt_values[key] : match;
923
- });
924
- }
925
- return str;
926
- }
927
- function padNumber(num, digits, minusSign = "-", trim, negWrap) {
928
- let neg = "";
929
- if (num < 0 || negWrap && num <= 0) {
930
- if (negWrap) {
931
- num = -num + 1;
932
- } else {
933
- num = -num;
934
- neg = minusSign;
935
- }
936
- }
937
- let strNum = String(num);
938
- while (strNum.length < digits) {
939
- strNum = "0" + strNum;
940
- }
941
- if (trim) {
942
- strNum = strNum.slice(strNum.length - digits);
943
- }
944
- return neg + strNum;
945
- }
946
- function formatFractionalSeconds(milliseconds, digits) {
947
- const strMs = padNumber(milliseconds, 3);
948
- return strMs.substring(0, digits);
949
- }
950
- function dateGetter(name, size, offset = 0, trim = false, negWrap = false) {
951
- return function(date, locale) {
952
- let part = getDatePart(name, date);
953
- if (offset > 0 || part > -offset) {
954
- part += offset;
955
- }
956
- if (name === 3) {
957
- if (part === 0 && offset === -12) {
958
- part = 12;
959
- }
960
- } else if (name === 6) {
961
- return formatFractionalSeconds(part, size);
962
- }
963
- const localeMinus = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
964
- return padNumber(part, size, localeMinus, trim, negWrap);
965
- };
966
- }
967
- function getDatePart(part, date) {
968
- switch (part) {
969
- case 0:
970
- return date.getFullYear();
971
- case 1:
972
- return date.getMonth();
973
- case 2:
974
- return date.getDate();
975
- case 3:
976
- return date.getHours();
977
- case 4:
978
- return date.getMinutes();
979
- case 5:
980
- return date.getSeconds();
981
- case 6:
982
- return date.getMilliseconds();
983
- case 7:
984
- return date.getDay();
985
- default:
986
- throw new RuntimeError(2301, ngDevMode && `Unknown DateType value "${part}".`);
987
- }
988
- }
989
- function dateStrGetter(name, width, form = FormStyle.Format, extended = false) {
990
- return function(date, locale) {
991
- return getDateTranslation(date, locale, name, width, form, extended);
992
- };
993
- }
994
- function getDateTranslation(date, locale, name, width, form, extended) {
995
- switch (name) {
996
- case 2:
997
- return getLocaleMonthNames(locale, form, width)[date.getMonth()];
998
- case 1:
999
- return getLocaleDayNames(locale, form, width)[date.getDay()];
1000
- case 0:
1001
- const currentHours = date.getHours();
1002
- const currentMinutes = date.getMinutes();
1003
- if (extended) {
1004
- const rules = getLocaleExtraDayPeriodRules(locale);
1005
- const dayPeriods = getLocaleExtraDayPeriods(locale, form, width);
1006
- const index = rules.findIndex((rule) => {
1007
- if (Array.isArray(rule)) {
1008
- const [from, to] = rule;
1009
- const afterFrom = currentHours >= from.hours && currentMinutes >= from.minutes;
1010
- const beforeTo = currentHours < to.hours || currentHours === to.hours && currentMinutes < to.minutes;
1011
- if (from.hours < to.hours) {
1012
- if (afterFrom && beforeTo) {
1013
- return true;
1014
- }
1015
- } else if (afterFrom || beforeTo) {
1016
- return true;
1017
- }
1018
- } else {
1019
- if (rule.hours === currentHours && rule.minutes === currentMinutes) {
1020
- return true;
1021
- }
1022
- }
1023
- return false;
1024
- });
1025
- if (index !== -1) {
1026
- return dayPeriods[index];
1027
- }
1028
- }
1029
- return getLocaleDayPeriods(locale, form, width)[currentHours < 12 ? 0 : 1];
1030
- case 3:
1031
- return getLocaleEraNames(locale, width)[date.getFullYear() <= 0 ? 0 : 1];
1032
- default:
1033
- const unexpected = name;
1034
- throw new RuntimeError(2302, ngDevMode && `unexpected translation type ${unexpected}`);
1035
- }
1036
- }
1037
- function timeZoneGetter(width) {
1038
- return function(date, locale, offset) {
1039
- const zone = -1 * offset;
1040
- const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
1041
- const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);
1042
- switch (width) {
1043
- case 0:
1044
- return (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + padNumber(Math.abs(zone % 60), 2, minusSign);
1045
- case 1:
1046
- return "GMT" + (zone >= 0 ? "+" : "") + padNumber(hours, 1, minusSign);
1047
- case 2:
1048
- return "GMT" + (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + ":" + padNumber(Math.abs(zone % 60), 2, minusSign);
1049
- case 3:
1050
- if (offset === 0) {
1051
- return "Z";
1052
- } else {
1053
- return (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + ":" + padNumber(Math.abs(zone % 60), 2, minusSign);
1054
- }
1055
- default:
1056
- throw new RuntimeError(2310, ngDevMode && `Unknown zone width "${width}"`);
1057
- }
1058
- };
1059
- }
1060
- var JANUARY = 0;
1061
- var THURSDAY = 4;
1062
- function getFirstThursdayOfYear(year) {
1063
- const firstDayOfYear = createDate(year, JANUARY, 1).getDay();
1064
- return createDate(year, 0, 1 + (firstDayOfYear <= THURSDAY ? THURSDAY : THURSDAY + 7) - firstDayOfYear);
1065
- }
1066
- function getThursdayThisIsoWeek(datetime) {
1067
- const currentDay = datetime.getDay();
1068
- const deltaToThursday = currentDay === 0 ? -3 : THURSDAY - currentDay;
1069
- return createDate(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + deltaToThursday);
1070
- }
1071
- function weekGetter(size, monthBased = false) {
1072
- return function(date, locale) {
1073
- let result;
1074
- if (monthBased) {
1075
- const nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;
1076
- const today = date.getDate();
1077
- result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);
1078
- } else {
1079
- const thisThurs = getThursdayThisIsoWeek(date);
1080
- const firstThurs = getFirstThursdayOfYear(thisThurs.getFullYear());
1081
- const diff = thisThurs.getTime() - firstThurs.getTime();
1082
- result = 1 + Math.round(diff / 604800000);
1083
- }
1084
- return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
1085
- };
1086
- }
1087
- function weekNumberingYearGetter(size, trim = false) {
1088
- return function(date, locale) {
1089
- const thisThurs = getThursdayThisIsoWeek(date);
1090
- const weekNumberingYear = thisThurs.getFullYear();
1091
- return padNumber(weekNumberingYear, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim);
1092
- };
1093
- }
1094
- var DATE_FORMATS = {};
1095
- function getDateFormatter(format) {
1096
- if (DATE_FORMATS[format]) {
1097
- return DATE_FORMATS[format];
1098
- }
1099
- let formatter;
1100
- switch (format) {
1101
- case "G":
1102
- case "GG":
1103
- case "GGG":
1104
- formatter = dateStrGetter(3, TranslationWidth.Abbreviated);
1105
- break;
1106
- case "GGGG":
1107
- formatter = dateStrGetter(3, TranslationWidth.Wide);
1108
- break;
1109
- case "GGGGG":
1110
- formatter = dateStrGetter(3, TranslationWidth.Narrow);
1111
- break;
1112
- case "y":
1113
- formatter = dateGetter(0, 1, 0, false, true);
1114
- break;
1115
- case "yy":
1116
- formatter = dateGetter(0, 2, 0, true, true);
1117
- break;
1118
- case "yyy":
1119
- formatter = dateGetter(0, 3, 0, false, true);
1120
- break;
1121
- case "yyyy":
1122
- formatter = dateGetter(0, 4, 0, false, true);
1123
- break;
1124
- case "Y":
1125
- formatter = weekNumberingYearGetter(1);
1126
- break;
1127
- case "YY":
1128
- formatter = weekNumberingYearGetter(2, true);
1129
- break;
1130
- case "YYY":
1131
- formatter = weekNumberingYearGetter(3);
1132
- break;
1133
- case "YYYY":
1134
- formatter = weekNumberingYearGetter(4);
1135
- break;
1136
- case "M":
1137
- case "L":
1138
- formatter = dateGetter(1, 1, 1);
1139
- break;
1140
- case "MM":
1141
- case "LL":
1142
- formatter = dateGetter(1, 2, 1);
1143
- break;
1144
- case "MMM":
1145
- formatter = dateStrGetter(2, TranslationWidth.Abbreviated);
1146
- break;
1147
- case "MMMM":
1148
- formatter = dateStrGetter(2, TranslationWidth.Wide);
1149
- break;
1150
- case "MMMMM":
1151
- formatter = dateStrGetter(2, TranslationWidth.Narrow);
1152
- break;
1153
- case "LLL":
1154
- formatter = dateStrGetter(2, TranslationWidth.Abbreviated, FormStyle.Standalone);
1155
- break;
1156
- case "LLLL":
1157
- formatter = dateStrGetter(2, TranslationWidth.Wide, FormStyle.Standalone);
1158
- break;
1159
- case "LLLLL":
1160
- formatter = dateStrGetter(2, TranslationWidth.Narrow, FormStyle.Standalone);
1161
- break;
1162
- case "w":
1163
- formatter = weekGetter(1);
1164
- break;
1165
- case "ww":
1166
- formatter = weekGetter(2);
1167
- break;
1168
- case "W":
1169
- formatter = weekGetter(1, true);
1170
- break;
1171
- case "d":
1172
- formatter = dateGetter(2, 1);
1173
- break;
1174
- case "dd":
1175
- formatter = dateGetter(2, 2);
1176
- break;
1177
- case "c":
1178
- case "cc":
1179
- formatter = dateGetter(7, 1);
1180
- break;
1181
- case "ccc":
1182
- formatter = dateStrGetter(1, TranslationWidth.Abbreviated, FormStyle.Standalone);
1183
- break;
1184
- case "cccc":
1185
- formatter = dateStrGetter(1, TranslationWidth.Wide, FormStyle.Standalone);
1186
- break;
1187
- case "ccccc":
1188
- formatter = dateStrGetter(1, TranslationWidth.Narrow, FormStyle.Standalone);
1189
- break;
1190
- case "cccccc":
1191
- formatter = dateStrGetter(1, TranslationWidth.Short, FormStyle.Standalone);
1192
- break;
1193
- case "E":
1194
- case "EE":
1195
- case "EEE":
1196
- formatter = dateStrGetter(1, TranslationWidth.Abbreviated);
1197
- break;
1198
- case "EEEE":
1199
- formatter = dateStrGetter(1, TranslationWidth.Wide);
1200
- break;
1201
- case "EEEEE":
1202
- formatter = dateStrGetter(1, TranslationWidth.Narrow);
1203
- break;
1204
- case "EEEEEE":
1205
- formatter = dateStrGetter(1, TranslationWidth.Short);
1206
- break;
1207
- case "a":
1208
- case "aa":
1209
- case "aaa":
1210
- formatter = dateStrGetter(0, TranslationWidth.Abbreviated);
1211
- break;
1212
- case "aaaa":
1213
- formatter = dateStrGetter(0, TranslationWidth.Wide);
1214
- break;
1215
- case "aaaaa":
1216
- formatter = dateStrGetter(0, TranslationWidth.Narrow);
1217
- break;
1218
- case "b":
1219
- case "bb":
1220
- case "bbb":
1221
- formatter = dateStrGetter(0, TranslationWidth.Abbreviated, FormStyle.Standalone, true);
1222
- break;
1223
- case "bbbb":
1224
- formatter = dateStrGetter(0, TranslationWidth.Wide, FormStyle.Standalone, true);
1225
- break;
1226
- case "bbbbb":
1227
- formatter = dateStrGetter(0, TranslationWidth.Narrow, FormStyle.Standalone, true);
1228
- break;
1229
- case "B":
1230
- case "BB":
1231
- case "BBB":
1232
- formatter = dateStrGetter(0, TranslationWidth.Abbreviated, FormStyle.Format, true);
1233
- break;
1234
- case "BBBB":
1235
- formatter = dateStrGetter(0, TranslationWidth.Wide, FormStyle.Format, true);
1236
- break;
1237
- case "BBBBB":
1238
- formatter = dateStrGetter(0, TranslationWidth.Narrow, FormStyle.Format, true);
1239
- break;
1240
- case "h":
1241
- formatter = dateGetter(3, 1, -12);
1242
- break;
1243
- case "hh":
1244
- formatter = dateGetter(3, 2, -12);
1245
- break;
1246
- case "H":
1247
- formatter = dateGetter(3, 1);
1248
- break;
1249
- case "HH":
1250
- formatter = dateGetter(3, 2);
1251
- break;
1252
- case "m":
1253
- formatter = dateGetter(4, 1);
1254
- break;
1255
- case "mm":
1256
- formatter = dateGetter(4, 2);
1257
- break;
1258
- case "s":
1259
- formatter = dateGetter(5, 1);
1260
- break;
1261
- case "ss":
1262
- formatter = dateGetter(5, 2);
1263
- break;
1264
- case "S":
1265
- formatter = dateGetter(6, 1);
1266
- break;
1267
- case "SS":
1268
- formatter = dateGetter(6, 2);
1269
- break;
1270
- case "SSS":
1271
- formatter = dateGetter(6, 3);
1272
- break;
1273
- case "Z":
1274
- case "ZZ":
1275
- case "ZZZ":
1276
- formatter = timeZoneGetter(0);
1277
- break;
1278
- case "ZZZZZ":
1279
- formatter = timeZoneGetter(3);
1280
- break;
1281
- case "O":
1282
- case "OO":
1283
- case "OOO":
1284
- case "z":
1285
- case "zz":
1286
- case "zzz":
1287
- formatter = timeZoneGetter(1);
1288
- break;
1289
- case "OOOO":
1290
- case "ZZZZ":
1291
- case "zzzz":
1292
- formatter = timeZoneGetter(2);
1293
- break;
1294
- default:
1295
- return null;
1296
- }
1297
- DATE_FORMATS[format] = formatter;
1298
- return formatter;
1299
- }
1300
- function timezoneToOffset(timezone, fallback) {
1301
- timezone = timezone.replace(/:/g, "");
1302
- const requestedTimezoneOffset = Date.parse("Jan 01, 1970 00:00:00 " + timezone) / 60000;
1303
- return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
1304
- }
1305
- function addDateMinutes(date, minutes) {
1306
- date = new Date(date.getTime());
1307
- date.setMinutes(date.getMinutes() + minutes);
1308
- return date;
1309
- }
1310
- function convertTimezoneToLocal(date, timezone, reverse) {
1311
- const reverseValue = -1;
1312
- const dateTimezoneOffset = date.getTimezoneOffset();
1313
- const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
1314
- return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));
1315
- }
1316
- function toDate(value) {
1317
- if (isDate(value)) {
1318
- return value;
1319
- }
1320
- if (typeof value === "number" && !isNaN(value)) {
1321
- return new Date(value);
1322
- }
1323
- if (typeof value === "string") {
1324
- value = value.trim();
1325
- if (/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(value)) {
1326
- const [y, m = 1, d = 1] = value.split("-").map((val) => +val);
1327
- return createDate(y, m - 1, d);
1328
- }
1329
- const parsedNb = parseFloat(value);
1330
- if (!isNaN(value - parsedNb)) {
1331
- return new Date(parsedNb);
1332
- }
1333
- let match;
1334
- if (match = value.match(ISO8601_DATE_REGEX)) {
1335
- return isoStringToDate(match);
1336
- }
1337
- }
1338
- const date = new Date(value);
1339
- if (!isDate(date)) {
1340
- throw new RuntimeError(2311, ngDevMode && `Unable to convert "${value}" into a date`);
1341
- }
1342
- return date;
1343
- }
1344
- function isoStringToDate(match) {
1345
- const date = new Date(0);
1346
- let tzHour = 0;
1347
- let tzMin = 0;
1348
- const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;
1349
- const timeSetter = match[8] ? date.setUTCHours : date.setHours;
1350
- if (match[9]) {
1351
- tzHour = Number(match[9] + match[10]);
1352
- tzMin = Number(match[9] + match[11]);
1353
- }
1354
- dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));
1355
- const h = Number(match[4] || 0) - tzHour;
1356
- const m = Number(match[5] || 0) - tzMin;
1357
- const s = Number(match[6] || 0);
1358
- const ms = Math.floor(parseFloat("0." + (match[7] || 0)) * 1000);
1359
- timeSetter.call(date, h, m, s, ms);
1360
- return date;
1361
- }
1362
- function isDate(value) {
1363
- return value instanceof Date && !isNaN(value.valueOf());
1364
- }
1365
- var NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/;
1366
- var MAX_DIGITS = 22;
1367
- var DECIMAL_SEP = ".";
1368
- var ZERO_CHAR = "0";
1369
- var PATTERN_SEP = ";";
1370
- var GROUP_SEP = ",";
1371
- var DIGIT_CHAR = "#";
1372
- var CURRENCY_CHAR = "¤";
1373
- var PERCENT_CHAR = "%";
1374
- function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent = false) {
1375
- let formattedText = "";
1376
- let isZero = false;
1377
- if (!isFinite(value)) {
1378
- formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity);
1379
- } else {
1380
- let parsedNumber = parseNumber(value);
1381
- if (isPercent) {
1382
- parsedNumber = toPercent(parsedNumber);
1383
- }
1384
- let minInt = pattern.minInt;
1385
- let minFraction = pattern.minFrac;
1386
- let maxFraction = pattern.maxFrac;
1387
- if (digitsInfo) {
1388
- const parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);
1389
- if (parts === null) {
1390
- throw new RuntimeError(2306, ngDevMode && `${digitsInfo} is not a valid digit info`);
1391
- }
1392
- const minIntPart = parts[1];
1393
- const minFractionPart = parts[3];
1394
- const maxFractionPart = parts[5];
1395
- if (minIntPart != null) {
1396
- minInt = parseIntAutoRadix(minIntPart);
1397
- }
1398
- if (minFractionPart != null) {
1399
- minFraction = parseIntAutoRadix(minFractionPart);
1400
- }
1401
- if (maxFractionPart != null) {
1402
- maxFraction = parseIntAutoRadix(maxFractionPart);
1403
- } else if (minFractionPart != null && minFraction > maxFraction) {
1404
- maxFraction = minFraction;
1405
- }
1406
- }
1407
- roundNumber(parsedNumber, minFraction, maxFraction);
1408
- let digits = parsedNumber.digits;
1409
- let integerLen = parsedNumber.integerLen;
1410
- const exponent = parsedNumber.exponent;
1411
- let decimals = [];
1412
- isZero = digits.every((d) => !d);
1413
- for (;integerLen < minInt; integerLen++) {
1414
- digits.unshift(0);
1415
- }
1416
- for (;integerLen < 0; integerLen++) {
1417
- digits.unshift(0);
1418
- }
1419
- if (integerLen > 0) {
1420
- decimals = digits.splice(integerLen, digits.length);
1421
- } else {
1422
- decimals = digits;
1423
- digits = [0];
1424
- }
1425
- const groups = [];
1426
- if (digits.length >= pattern.lgSize) {
1427
- groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(""));
1428
- }
1429
- while (digits.length > pattern.gSize) {
1430
- groups.unshift(digits.splice(-pattern.gSize, digits.length).join(""));
1431
- }
1432
- if (digits.length) {
1433
- groups.unshift(digits.join(""));
1434
- }
1435
- formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));
1436
- if (decimals.length) {
1437
- formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join("");
1438
- }
1439
- if (exponent) {
1440
- formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + "+" + exponent;
1441
- }
1442
- }
1443
- if (value < 0 && !isZero) {
1444
- formattedText = pattern.negPre + formattedText + pattern.negSuf;
1445
- } else {
1446
- formattedText = pattern.posPre + formattedText + pattern.posSuf;
1447
- }
1448
- return formattedText;
1449
- }
1450
- function formatCurrency(value, locale, currency, currencyCode, digitsInfo) {
1451
- const format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency);
1452
- const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
1453
- pattern.minFrac = getNumberOfCurrencyDigits(currencyCode);
1454
- pattern.maxFrac = pattern.minFrac;
1455
- const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo);
1456
- return res.replace(CURRENCY_CHAR, currency).replace(CURRENCY_CHAR, "").trim();
1457
- }
1458
- function formatPercent(value, locale, digitsInfo) {
1459
- const format = getLocaleNumberFormat(locale, NumberFormatStyle.Percent);
1460
- const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
1461
- const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo, true);
1462
- return res.replace(new RegExp(PERCENT_CHAR, "g"), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign));
1463
- }
1464
- function formatNumber(value, locale, digitsInfo) {
1465
- const format = getLocaleNumberFormat(locale, NumberFormatStyle.Decimal);
1466
- const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
1467
- return formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo);
1468
- }
1469
- function parseNumberFormat(format, minusSign = "-") {
1470
- const p = {
1471
- minInt: 1,
1472
- minFrac: 0,
1473
- maxFrac: 0,
1474
- posPre: "",
1475
- posSuf: "",
1476
- negPre: "",
1477
- negSuf: "",
1478
- gSize: 0,
1479
- lgSize: 0
1480
- };
1481
- const patternParts = format.split(PATTERN_SEP);
1482
- const positive = patternParts[0];
1483
- const negative = patternParts[1];
1484
- const positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ? positive.split(DECIMAL_SEP) : [positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1), positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)], integer = positiveParts[0], fraction = positiveParts[1] || "";
1485
- p.posPre = integer.substring(0, integer.indexOf(DIGIT_CHAR));
1486
- for (let i = 0;i < fraction.length; i++) {
1487
- const ch = fraction.charAt(i);
1488
- if (ch === ZERO_CHAR) {
1489
- p.minFrac = p.maxFrac = i + 1;
1490
- } else if (ch === DIGIT_CHAR) {
1491
- p.maxFrac = i + 1;
1492
- } else {
1493
- p.posSuf += ch;
1494
- }
1495
- }
1496
- const groups = integer.split(GROUP_SEP);
1497
- p.gSize = groups[1] ? groups[1].length : 0;
1498
- p.lgSize = groups[2] || groups[1] ? (groups[2] || groups[1]).length : 0;
1499
- if (negative) {
1500
- const trunkLen = positive.length - p.posPre.length - p.posSuf.length, pos = negative.indexOf(DIGIT_CHAR);
1501
- p.negPre = negative.substring(0, pos).replace(/'/g, "");
1502
- p.negSuf = negative.slice(pos + trunkLen).replace(/'/g, "");
1503
- } else {
1504
- p.negPre = minusSign + p.posPre;
1505
- p.negSuf = p.posSuf;
1506
- }
1507
- return p;
1508
- }
1509
- function toPercent(parsedNumber) {
1510
- if (parsedNumber.digits[0] === 0) {
1511
- return parsedNumber;
1512
- }
1513
- const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;
1514
- if (parsedNumber.exponent) {
1515
- parsedNumber.exponent += 2;
1516
- } else {
1517
- if (fractionLen === 0) {
1518
- parsedNumber.digits.push(0, 0);
1519
- } else if (fractionLen === 1) {
1520
- parsedNumber.digits.push(0);
1521
- }
1522
- parsedNumber.integerLen += 2;
1523
- }
1524
- return parsedNumber;
1525
- }
1526
- function parseNumber(num) {
1527
- let numStr = Math.abs(num) + "";
1528
- let exponent = 0, digits, integerLen;
1529
- let i, j, zeros;
1530
- if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {
1531
- numStr = numStr.replace(DECIMAL_SEP, "");
1532
- }
1533
- if ((i = numStr.search(/e/i)) > 0) {
1534
- if (integerLen < 0)
1535
- integerLen = i;
1536
- integerLen += +numStr.slice(i + 1);
1537
- numStr = numStr.substring(0, i);
1538
- } else if (integerLen < 0) {
1539
- integerLen = numStr.length;
1540
- }
1541
- for (i = 0;numStr.charAt(i) === ZERO_CHAR; i++) {}
1542
- if (i === (zeros = numStr.length)) {
1543
- digits = [0];
1544
- integerLen = 1;
1545
- } else {
1546
- zeros--;
1547
- while (numStr.charAt(zeros) === ZERO_CHAR)
1548
- zeros--;
1549
- integerLen -= i;
1550
- digits = [];
1551
- for (j = 0;i <= zeros; i++, j++) {
1552
- digits[j] = Number(numStr.charAt(i));
1553
- }
1554
- }
1555
- if (integerLen > MAX_DIGITS) {
1556
- digits = digits.splice(0, MAX_DIGITS - 1);
1557
- exponent = integerLen - 1;
1558
- integerLen = 1;
1559
- }
1560
- return {
1561
- digits,
1562
- exponent,
1563
- integerLen
1564
- };
1565
- }
1566
- function roundNumber(parsedNumber, minFrac, maxFrac) {
1567
- if (minFrac > maxFrac) {
1568
- throw new RuntimeError(2307, ngDevMode && `The minimum number of digits after fraction (${minFrac}) is higher than the maximum (${maxFrac}).`);
1569
- }
1570
- let digits = parsedNumber.digits;
1571
- let fractionLen = digits.length - parsedNumber.integerLen;
1572
- const fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac);
1573
- let roundAt = fractionSize + parsedNumber.integerLen;
1574
- let digit = digits[roundAt];
1575
- if (roundAt > 0) {
1576
- digits.splice(Math.max(parsedNumber.integerLen, roundAt));
1577
- for (let j = roundAt;j < digits.length; j++) {
1578
- digits[j] = 0;
1579
- }
1580
- } else {
1581
- fractionLen = Math.max(0, fractionLen);
1582
- parsedNumber.integerLen = 1;
1583
- digits.length = Math.max(1, roundAt = fractionSize + 1);
1584
- digits[0] = 0;
1585
- for (let i = 1;i < roundAt; i++)
1586
- digits[i] = 0;
1587
- }
1588
- if (digit >= 5) {
1589
- if (roundAt - 1 < 0) {
1590
- for (let k = 0;k > roundAt; k--) {
1591
- digits.unshift(0);
1592
- parsedNumber.integerLen++;
1593
- }
1594
- digits.unshift(1);
1595
- parsedNumber.integerLen++;
1596
- } else {
1597
- digits[roundAt - 1]++;
1598
- }
1599
- }
1600
- for (;fractionLen < Math.max(0, fractionSize); fractionLen++)
1601
- digits.push(0);
1602
- let dropTrailingZeros = fractionSize !== 0;
1603
- const minLen = minFrac + parsedNumber.integerLen;
1604
- const carry = digits.reduceRight(function(carry2, d, i, digits2) {
1605
- d = d + carry2;
1606
- digits2[i] = d < 10 ? d : d - 10;
1607
- if (dropTrailingZeros) {
1608
- if (digits2[i] === 0 && i >= minLen) {
1609
- digits2.pop();
1610
- } else {
1611
- dropTrailingZeros = false;
1612
- }
1613
- }
1614
- return d >= 10 ? 1 : 0;
1615
- }, 0);
1616
- if (carry) {
1617
- digits.unshift(carry);
1618
- parsedNumber.integerLen++;
1619
- }
1620
- }
1621
- function parseIntAutoRadix(text) {
1622
- const result = parseInt(text);
1623
- if (isNaN(result)) {
1624
- throw new RuntimeError(2305, ngDevMode && "Invalid integer literal when parsing " + text);
1625
- }
1626
- return result;
1627
- }
1628
-
1629
- class NgLocalization {
1630
- static ɵfac = function NgLocalization_Factory(__ngFactoryType__) {
1631
- return new (__ngFactoryType__ || NgLocalization);
1632
- };
1633
- static ɵprov = /* @__PURE__ */ ɵ_defineInjectable({
1634
- token: NgLocalization,
1635
- factory: () => (() => new NgLocaleLocalization(inject(LOCALE_ID)))(),
1636
- providedIn: "root"
1637
- });
1638
- }
1639
- (() => {
1640
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgLocalization, [{
1641
- type: Injectable,
1642
- args: [{
1643
- providedIn: "root",
1644
- useFactory: () => new NgLocaleLocalization(inject(LOCALE_ID))
1645
- }]
1646
- }], null, null);
1647
- })();
1648
- function getPluralCategory(value, cases, ngLocalization, locale) {
1649
- let key = `=${value}`;
1650
- if (cases.indexOf(key) > -1) {
1651
- return key;
1652
- }
1653
- key = ngLocalization.getPluralCategory(value, locale);
1654
- if (cases.indexOf(key) > -1) {
1655
- return key;
1656
- }
1657
- if (cases.indexOf("other") > -1) {
1658
- return "other";
1659
- }
1660
- throw new RuntimeError(2308, ngDevMode && `No plural message found for value "${value}"`);
1661
- }
1662
-
1663
- class NgLocaleLocalization extends NgLocalization {
1664
- locale;
1665
- constructor(locale) {
1666
- super();
1667
- this.locale = locale;
1668
- }
1669
- getPluralCategory(value, locale) {
1670
- const plural = getLocalePluralCase2(locale || this.locale)(value);
1671
- switch (plural) {
1672
- case Plural.Zero:
1673
- return "zero";
1674
- case Plural.One:
1675
- return "one";
1676
- case Plural.Two:
1677
- return "two";
1678
- case Plural.Few:
1679
- return "few";
1680
- case Plural.Many:
1681
- return "many";
1682
- default:
1683
- return "other";
1684
- }
1685
- }
1686
- static ɵfac = function NgLocaleLocalization_Factory(__ngFactoryType__) {
1687
- return new (__ngFactoryType__ || NgLocaleLocalization)(ɵ_inject(LOCALE_ID));
1688
- };
1689
- static ɵprov = /* @__PURE__ */ ɵ_defineInjectable({
1690
- token: NgLocaleLocalization,
1691
- factory: NgLocaleLocalization.ɵfac
1692
- });
1693
- }
1694
- (() => {
1695
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgLocaleLocalization, [{
1696
- type: Injectable
1697
- }], () => [{
1698
- type: undefined,
1699
- decorators: [{
1700
- type: Inject,
1701
- args: [LOCALE_ID]
1702
- }]
1703
- }], null);
1704
- })();
1705
- var WS_REGEXP = /\s+/;
1706
- var EMPTY_ARRAY = [];
1707
-
1708
- class NgClass {
1709
- _ngEl;
1710
- _renderer;
1711
- initialClasses = EMPTY_ARRAY;
1712
- rawClass;
1713
- stateMap = new Map;
1714
- constructor(_ngEl, _renderer) {
1715
- this._ngEl = _ngEl;
1716
- this._renderer = _renderer;
1717
- }
1718
- set klass(value) {
1719
- this.initialClasses = value != null ? value.trim().split(WS_REGEXP) : EMPTY_ARRAY;
1720
- }
1721
- set ngClass(value) {
1722
- this.rawClass = typeof value === "string" ? value.trim().split(WS_REGEXP) : value;
1723
- }
1724
- ngDoCheck() {
1725
- for (const klass of this.initialClasses) {
1726
- this._updateState(klass, true);
1727
- }
1728
- const rawClass = this.rawClass;
1729
- if (Array.isArray(rawClass) || rawClass instanceof Set) {
1730
- for (const klass of rawClass) {
1731
- this._updateState(klass, true);
1732
- }
1733
- } else if (rawClass != null) {
1734
- for (const klass of Object.keys(rawClass)) {
1735
- this._updateState(klass, Boolean(rawClass[klass]));
1736
- }
1737
- }
1738
- this._applyStateDiff();
1739
- }
1740
- _updateState(klass, nextEnabled) {
1741
- const state = this.stateMap.get(klass);
1742
- if (state !== undefined) {
1743
- if (state.enabled !== nextEnabled) {
1744
- state.changed = true;
1745
- state.enabled = nextEnabled;
1746
- }
1747
- state.touched = true;
1748
- } else {
1749
- this.stateMap.set(klass, {
1750
- enabled: nextEnabled,
1751
- changed: true,
1752
- touched: true
1753
- });
1754
- }
1755
- }
1756
- _applyStateDiff() {
1757
- for (const stateEntry of this.stateMap) {
1758
- const klass = stateEntry[0];
1759
- const state = stateEntry[1];
1760
- if (state.changed) {
1761
- this._toggleClass(klass, state.enabled);
1762
- state.changed = false;
1763
- } else if (!state.touched) {
1764
- if (state.enabled) {
1765
- this._toggleClass(klass, false);
1766
- }
1767
- this.stateMap.delete(klass);
1768
- }
1769
- state.touched = false;
1770
- }
1771
- }
1772
- _toggleClass(klass, enabled) {
1773
- if (ngDevMode) {
1774
- if (typeof klass !== "string") {
1775
- throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${stringify(klass)}`);
1776
- }
1777
- }
1778
- klass = klass.trim();
1779
- if (klass.length > 0) {
1780
- klass.split(WS_REGEXP).forEach((klass2) => {
1781
- if (enabled) {
1782
- this._renderer.addClass(this._ngEl.nativeElement, klass2);
1783
- } else {
1784
- this._renderer.removeClass(this._ngEl.nativeElement, klass2);
1785
- }
1786
- });
1787
- }
1788
- }
1789
- static ɵfac = function NgClass_Factory(__ngFactoryType__) {
1790
- return new (__ngFactoryType__ || NgClass)(ɵ_directiveInject(ElementRef), ɵ_directiveInject(Renderer2));
1791
- };
1792
- static ɵdir = /* @__PURE__ */ ɵ_defineDirective({
1793
- type: NgClass,
1794
- selectors: [["", "ngClass", ""]],
1795
- inputs: {
1796
- klass: [0, "class", "klass"],
1797
- ngClass: "ngClass"
1798
- }
1799
- });
1800
- }
1801
- (() => {
1802
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgClass, [{
1803
- type: Directive,
1804
- args: [{
1805
- selector: "[ngClass]"
1806
- }]
1807
- }], () => [{
1808
- type: ElementRef
1809
- }, {
1810
- type: Renderer2
1811
- }], {
1812
- klass: [{
1813
- type: Input,
1814
- args: ["class"]
1815
- }],
1816
- ngClass: [{
1817
- type: Input,
1818
- args: ["ngClass"]
1819
- }]
1820
- });
1821
- })();
1822
-
1823
- class NgComponentOutlet {
1824
- _viewContainerRef;
1825
- ngComponentOutlet = null;
1826
- ngComponentOutletInputs;
1827
- ngComponentOutletInjector;
1828
- ngComponentOutletEnvironmentInjector;
1829
- ngComponentOutletContent;
1830
- ngComponentOutletNgModule;
1831
- _componentRef;
1832
- _moduleRef;
1833
- _inputsUsed = new Map;
1834
- get componentInstance() {
1835
- return this._componentRef?.instance ?? null;
1836
- }
1837
- constructor(_viewContainerRef) {
1838
- this._viewContainerRef = _viewContainerRef;
1839
- }
1840
- _needToReCreateNgModuleInstance(changes) {
1841
- return changes["ngComponentOutletNgModule"] !== undefined;
1842
- }
1843
- _needToReCreateComponentInstance(changes) {
1844
- return changes["ngComponentOutlet"] !== undefined || changes["ngComponentOutletContent"] !== undefined || changes["ngComponentOutletInjector"] !== undefined || changes["ngComponentOutletEnvironmentInjector"] !== undefined || this._needToReCreateNgModuleInstance(changes);
1845
- }
1846
- ngOnChanges(changes) {
1847
- if (this._needToReCreateComponentInstance(changes)) {
1848
- this._viewContainerRef.clear();
1849
- this._inputsUsed.clear();
1850
- this._componentRef = undefined;
1851
- if (this.ngComponentOutlet) {
1852
- const injector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;
1853
- if (this._needToReCreateNgModuleInstance(changes)) {
1854
- this._moduleRef?.destroy();
1855
- if (this.ngComponentOutletNgModule) {
1856
- this._moduleRef = createNgModule(this.ngComponentOutletNgModule, getParentInjector(injector));
1857
- } else {
1858
- this._moduleRef = undefined;
1859
- }
1860
- }
1861
- this._componentRef = this._viewContainerRef.createComponent(this.ngComponentOutlet, {
1862
- injector,
1863
- ngModuleRef: this._moduleRef,
1864
- projectableNodes: this.ngComponentOutletContent,
1865
- environmentInjector: this.ngComponentOutletEnvironmentInjector
1866
- });
1867
- }
1868
- }
1869
- }
1870
- ngDoCheck() {
1871
- if (this._componentRef) {
1872
- if (this.ngComponentOutletInputs) {
1873
- for (const inputName of Object.keys(this.ngComponentOutletInputs)) {
1874
- this._inputsUsed.set(inputName, true);
1875
- }
1876
- }
1877
- this._applyInputStateDiff(this._componentRef);
1878
- }
1879
- }
1880
- ngOnDestroy() {
1881
- this._moduleRef?.destroy();
1882
- }
1883
- _applyInputStateDiff(componentRef) {
1884
- for (const [inputName, touched] of this._inputsUsed) {
1885
- if (!touched) {
1886
- componentRef.setInput(inputName, undefined);
1887
- this._inputsUsed.delete(inputName);
1888
- } else {
1889
- componentRef.setInput(inputName, this.ngComponentOutletInputs[inputName]);
1890
- this._inputsUsed.set(inputName, false);
1891
- }
1892
- }
1893
- }
1894
- static ɵfac = function NgComponentOutlet_Factory(__ngFactoryType__) {
1895
- return new (__ngFactoryType__ || NgComponentOutlet)(ɵ_directiveInject(ViewContainerRef));
1896
- };
1897
- static ɵdir = /* @__PURE__ */ ɵ_defineDirective({
1898
- type: NgComponentOutlet,
1899
- selectors: [["", "ngComponentOutlet", ""]],
1900
- inputs: {
1901
- ngComponentOutlet: "ngComponentOutlet",
1902
- ngComponentOutletInputs: "ngComponentOutletInputs",
1903
- ngComponentOutletInjector: "ngComponentOutletInjector",
1904
- ngComponentOutletEnvironmentInjector: "ngComponentOutletEnvironmentInjector",
1905
- ngComponentOutletContent: "ngComponentOutletContent",
1906
- ngComponentOutletNgModule: "ngComponentOutletNgModule"
1907
- },
1908
- exportAs: ["ngComponentOutlet"],
1909
- features: [ɵ_NgOnChangesFeature]
1910
- });
1911
- }
1912
- (() => {
1913
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgComponentOutlet, [{
1914
- type: Directive,
1915
- args: [{
1916
- selector: "[ngComponentOutlet]",
1917
- exportAs: "ngComponentOutlet"
1918
- }]
1919
- }], () => [{
1920
- type: ViewContainerRef
1921
- }], {
1922
- ngComponentOutlet: [{
1923
- type: Input
1924
- }],
1925
- ngComponentOutletInputs: [{
1926
- type: Input
1927
- }],
1928
- ngComponentOutletInjector: [{
1929
- type: Input
1930
- }],
1931
- ngComponentOutletEnvironmentInjector: [{
1932
- type: Input
1933
- }],
1934
- ngComponentOutletContent: [{
1935
- type: Input
1936
- }],
1937
- ngComponentOutletNgModule: [{
1938
- type: Input
1939
- }]
1940
- });
1941
- })();
1942
- function getParentInjector(injector) {
1943
- const parentNgModule = injector.get(NgModuleRef$1);
1944
- return parentNgModule.injector;
1945
- }
1946
-
1947
- class NgForOfContext {
1948
- $implicit;
1949
- ngForOf;
1950
- index;
1951
- count;
1952
- constructor($implicit, ngForOf, index, count) {
1953
- this.$implicit = $implicit;
1954
- this.ngForOf = ngForOf;
1955
- this.index = index;
1956
- this.count = count;
1957
- }
1958
- get first() {
1959
- return this.index === 0;
1960
- }
1961
- get last() {
1962
- return this.index === this.count - 1;
1963
- }
1964
- get even() {
1965
- return this.index % 2 === 0;
1966
- }
1967
- get odd() {
1968
- return !this.even;
1969
- }
1970
- }
1971
-
1972
- class NgForOf {
1973
- _viewContainer;
1974
- _template;
1975
- _differs;
1976
- set ngForOf(ngForOf) {
1977
- this._ngForOf = ngForOf;
1978
- this._ngForOfDirty = true;
1979
- }
1980
- set ngForTrackBy(fn) {
1981
- if ((typeof ngDevMode === "undefined" || ngDevMode) && fn != null && typeof fn !== "function") {
1982
- console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}. ` + `See https://angular.dev/api/common/NgForOf#change-propagation for more information.`);
1983
- }
1984
- this._trackByFn = fn;
1985
- }
1986
- get ngForTrackBy() {
1987
- return this._trackByFn;
1988
- }
1989
- _ngForOf = null;
1990
- _ngForOfDirty = true;
1991
- _differ = null;
1992
- _trackByFn;
1993
- constructor(_viewContainer, _template, _differs) {
1994
- this._viewContainer = _viewContainer;
1995
- this._template = _template;
1996
- this._differs = _differs;
1997
- }
1998
- set ngForTemplate(value) {
1999
- if (value) {
2000
- this._template = value;
2001
- }
2002
- }
2003
- ngDoCheck() {
2004
- if (this._ngForOfDirty) {
2005
- this._ngForOfDirty = false;
2006
- const value = this._ngForOf;
2007
- if (!this._differ && value) {
2008
- if (typeof ngDevMode === "undefined" || ngDevMode) {
2009
- try {
2010
- this._differ = this._differs.find(value).create(this.ngForTrackBy);
2011
- } catch {
2012
- let errorMessage = `Cannot find a differ supporting object '${value}' of type '` + `${getTypeName(value)}'. NgFor only supports binding to Iterables, such as Arrays.`;
2013
- if (typeof value === "object") {
2014
- errorMessage += " Did you mean to use the keyvalue pipe?";
2015
- }
2016
- throw new RuntimeError(-2200, errorMessage);
2017
- }
2018
- } else {
2019
- this._differ = this._differs.find(value).create(this.ngForTrackBy);
2020
- }
2021
- }
2022
- }
2023
- if (this._differ) {
2024
- const changes = this._differ.diff(this._ngForOf);
2025
- if (changes)
2026
- this._applyChanges(changes);
2027
- }
2028
- }
2029
- _applyChanges(changes) {
2030
- const viewContainer = this._viewContainer;
2031
- changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => {
2032
- if (item.previousIndex == null) {
2033
- viewContainer.createEmbeddedView(this._template, new NgForOfContext(item.item, this._ngForOf, -1, -1), currentIndex === null ? undefined : currentIndex);
2034
- } else if (currentIndex == null) {
2035
- viewContainer.remove(adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex);
2036
- } else if (adjustedPreviousIndex !== null) {
2037
- const view = viewContainer.get(adjustedPreviousIndex);
2038
- viewContainer.move(view, currentIndex);
2039
- applyViewChange(view, item);
2040
- }
2041
- });
2042
- for (let i = 0, ilen = viewContainer.length;i < ilen; i++) {
2043
- const viewRef = viewContainer.get(i);
2044
- const context = viewRef.context;
2045
- context.index = i;
2046
- context.count = ilen;
2047
- context.ngForOf = this._ngForOf;
2048
- }
2049
- changes.forEachIdentityChange((record) => {
2050
- const viewRef = viewContainer.get(record.currentIndex);
2051
- applyViewChange(viewRef, record);
2052
- });
2053
- }
2054
- static ngTemplateContextGuard(dir, ctx) {
2055
- return true;
2056
- }
2057
- static ɵfac = function NgForOf_Factory(__ngFactoryType__) {
2058
- return new (__ngFactoryType__ || NgForOf)(ɵ_directiveInject(ViewContainerRef), ɵ_directiveInject(TemplateRef), ɵ_directiveInject(IterableDiffers));
2059
- };
2060
- static ɵdir = /* @__PURE__ */ ɵ_defineDirective({
2061
- type: NgForOf,
2062
- selectors: [["", "ngFor", "", "ngForOf", ""]],
2063
- inputs: {
2064
- ngForOf: "ngForOf",
2065
- ngForTrackBy: "ngForTrackBy",
2066
- ngForTemplate: "ngForTemplate"
2067
- }
2068
- });
2069
- }
2070
- (() => {
2071
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgForOf, [{
2072
- type: Directive,
2073
- args: [{
2074
- selector: "[ngFor][ngForOf]"
2075
- }]
2076
- }], () => [{
2077
- type: ViewContainerRef
2078
- }, {
2079
- type: TemplateRef
2080
- }, {
2081
- type: IterableDiffers
2082
- }], {
2083
- ngForOf: [{
2084
- type: Input
2085
- }],
2086
- ngForTrackBy: [{
2087
- type: Input
2088
- }],
2089
- ngForTemplate: [{
2090
- type: Input
2091
- }]
2092
- });
2093
- })();
2094
- function applyViewChange(view, record) {
2095
- view.context.$implicit = record.item;
2096
- }
2097
- function getTypeName(type) {
2098
- return type["name"] || typeof type;
2099
- }
2100
-
2101
- class NgIf {
2102
- _viewContainer;
2103
- _context = new NgIfContext;
2104
- _thenTemplateRef = null;
2105
- _elseTemplateRef = null;
2106
- _thenViewRef = null;
2107
- _elseViewRef = null;
2108
- constructor(_viewContainer, templateRef) {
2109
- this._viewContainer = _viewContainer;
2110
- this._thenTemplateRef = templateRef;
2111
- }
2112
- set ngIf(condition) {
2113
- this._context.$implicit = this._context.ngIf = condition;
2114
- this._updateView();
2115
- }
2116
- set ngIfThen(templateRef) {
2117
- assertTemplate(templateRef, (typeof ngDevMode === "undefined" || ngDevMode) && "ngIfThen");
2118
- this._thenTemplateRef = templateRef;
2119
- this._thenViewRef = null;
2120
- this._updateView();
2121
- }
2122
- set ngIfElse(templateRef) {
2123
- assertTemplate(templateRef, (typeof ngDevMode === "undefined" || ngDevMode) && "ngIfElse");
2124
- this._elseTemplateRef = templateRef;
2125
- this._elseViewRef = null;
2126
- this._updateView();
2127
- }
2128
- _updateView() {
2129
- if (this._context.$implicit) {
2130
- if (!this._thenViewRef) {
2131
- this._viewContainer.clear();
2132
- this._elseViewRef = null;
2133
- if (this._thenTemplateRef) {
2134
- this._thenViewRef = this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);
2135
- }
2136
- }
2137
- } else {
2138
- if (!this._elseViewRef) {
2139
- this._viewContainer.clear();
2140
- this._thenViewRef = null;
2141
- if (this._elseTemplateRef) {
2142
- this._elseViewRef = this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);
2143
- }
2144
- }
2145
- }
2146
- }
2147
- static ngIfUseIfTypeGuard;
2148
- static ngTemplateGuard_ngIf;
2149
- static ngTemplateContextGuard(dir, ctx) {
2150
- return true;
2151
- }
2152
- static ɵfac = function NgIf_Factory(__ngFactoryType__) {
2153
- return new (__ngFactoryType__ || NgIf)(ɵ_directiveInject(ViewContainerRef), ɵ_directiveInject(TemplateRef));
2154
- };
2155
- static ɵdir = /* @__PURE__ */ ɵ_defineDirective({
2156
- type: NgIf,
2157
- selectors: [["", "ngIf", ""]],
2158
- inputs: {
2159
- ngIf: "ngIf",
2160
- ngIfThen: "ngIfThen",
2161
- ngIfElse: "ngIfElse"
2162
- }
2163
- });
2164
- }
2165
- (() => {
2166
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgIf, [{
2167
- type: Directive,
2168
- args: [{
2169
- selector: "[ngIf]"
2170
- }]
2171
- }], () => [{
2172
- type: ViewContainerRef
2173
- }, {
2174
- type: TemplateRef
2175
- }], {
2176
- ngIf: [{
2177
- type: Input
2178
- }],
2179
- ngIfThen: [{
2180
- type: Input
2181
- }],
2182
- ngIfElse: [{
2183
- type: Input
2184
- }]
2185
- });
2186
- })();
2187
-
2188
- class NgIfContext {
2189
- $implicit = null;
2190
- ngIf = null;
2191
- }
2192
- function assertTemplate(templateRef, property) {
2193
- if (templateRef && !templateRef.createEmbeddedView) {
2194
- throw new RuntimeError(2020, (typeof ngDevMode === "undefined" || ngDevMode) && `${property} must be a TemplateRef, but received '${stringify(templateRef)}'.`);
2195
- }
2196
- }
2197
-
2198
- class SwitchView {
2199
- _viewContainerRef;
2200
- _templateRef;
2201
- _created = false;
2202
- constructor(_viewContainerRef, _templateRef) {
2203
- this._viewContainerRef = _viewContainerRef;
2204
- this._templateRef = _templateRef;
2205
- }
2206
- create() {
2207
- this._created = true;
2208
- this._viewContainerRef.createEmbeddedView(this._templateRef);
2209
- }
2210
- destroy() {
2211
- this._created = false;
2212
- this._viewContainerRef.clear();
2213
- }
2214
- enforceState(created) {
2215
- if (created && !this._created) {
2216
- this.create();
2217
- } else if (!created && this._created) {
2218
- this.destroy();
2219
- }
2220
- }
2221
- }
2222
-
2223
- class NgSwitch {
2224
- _defaultViews = [];
2225
- _defaultUsed = false;
2226
- _caseCount = 0;
2227
- _lastCaseCheckIndex = 0;
2228
- _lastCasesMatched = false;
2229
- _ngSwitch;
2230
- set ngSwitch(newValue) {
2231
- this._ngSwitch = newValue;
2232
- if (this._caseCount === 0) {
2233
- this._updateDefaultCases(true);
2234
- }
2235
- }
2236
- _addCase() {
2237
- return this._caseCount++;
2238
- }
2239
- _addDefault(view) {
2240
- this._defaultViews.push(view);
2241
- }
2242
- _matchCase(value) {
2243
- const matched = value === this._ngSwitch;
2244
- this._lastCasesMatched ||= matched;
2245
- this._lastCaseCheckIndex++;
2246
- if (this._lastCaseCheckIndex === this._caseCount) {
2247
- this._updateDefaultCases(!this._lastCasesMatched);
2248
- this._lastCaseCheckIndex = 0;
2249
- this._lastCasesMatched = false;
2250
- }
2251
- return matched;
2252
- }
2253
- _updateDefaultCases(useDefault) {
2254
- if (this._defaultViews.length > 0 && useDefault !== this._defaultUsed) {
2255
- this._defaultUsed = useDefault;
2256
- for (const defaultView of this._defaultViews) {
2257
- defaultView.enforceState(useDefault);
2258
- }
2259
- }
2260
- }
2261
- static ɵfac = function NgSwitch_Factory(__ngFactoryType__) {
2262
- return new (__ngFactoryType__ || NgSwitch);
2263
- };
2264
- static ɵdir = /* @__PURE__ */ ɵ_defineDirective({
2265
- type: NgSwitch,
2266
- selectors: [["", "ngSwitch", ""]],
2267
- inputs: {
2268
- ngSwitch: "ngSwitch"
2269
- }
2270
- });
2271
- }
2272
- (() => {
2273
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitch, [{
2274
- type: Directive,
2275
- args: [{
2276
- selector: "[ngSwitch]"
2277
- }]
2278
- }], null, {
2279
- ngSwitch: [{
2280
- type: Input
2281
- }]
2282
- });
2283
- })();
2284
-
2285
- class NgSwitchCase {
2286
- ngSwitch;
2287
- _view;
2288
- ngSwitchCase;
2289
- constructor(viewContainer, templateRef, ngSwitch) {
2290
- this.ngSwitch = ngSwitch;
2291
- if ((typeof ngDevMode === "undefined" || ngDevMode) && !ngSwitch) {
2292
- throwNgSwitchProviderNotFoundError("ngSwitchCase", "NgSwitchCase");
2293
- }
2294
- ngSwitch._addCase();
2295
- this._view = new SwitchView(viewContainer, templateRef);
2296
- }
2297
- ngDoCheck() {
2298
- this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase));
2299
- }
2300
- static ɵfac = function NgSwitchCase_Factory(__ngFactoryType__) {
2301
- return new (__ngFactoryType__ || NgSwitchCase)(ɵ_directiveInject(ViewContainerRef), ɵ_directiveInject(TemplateRef), ɵ_directiveInject(NgSwitch, 9));
2302
- };
2303
- static ɵdir = /* @__PURE__ */ ɵ_defineDirective({
2304
- type: NgSwitchCase,
2305
- selectors: [["", "ngSwitchCase", ""]],
2306
- inputs: {
2307
- ngSwitchCase: "ngSwitchCase"
2308
- }
2309
- });
2310
- }
2311
- (() => {
2312
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitchCase, [{
2313
- type: Directive,
2314
- args: [{
2315
- selector: "[ngSwitchCase]"
2316
- }]
2317
- }], () => [{
2318
- type: ViewContainerRef
2319
- }, {
2320
- type: TemplateRef
2321
- }, {
2322
- type: NgSwitch,
2323
- decorators: [{
2324
- type: Optional
2325
- }, {
2326
- type: Host
2327
- }]
2328
- }], {
2329
- ngSwitchCase: [{
2330
- type: Input
2331
- }]
2332
- });
2333
- })();
2334
-
2335
- class NgSwitchDefault {
2336
- constructor(viewContainer, templateRef, ngSwitch) {
2337
- if ((typeof ngDevMode === "undefined" || ngDevMode) && !ngSwitch) {
2338
- throwNgSwitchProviderNotFoundError("ngSwitchDefault", "NgSwitchDefault");
2339
- }
2340
- ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));
2341
- }
2342
- static ɵfac = function NgSwitchDefault_Factory(__ngFactoryType__) {
2343
- return new (__ngFactoryType__ || NgSwitchDefault)(ɵ_directiveInject(ViewContainerRef), ɵ_directiveInject(TemplateRef), ɵ_directiveInject(NgSwitch, 9));
2344
- };
2345
- static ɵdir = /* @__PURE__ */ ɵ_defineDirective({
2346
- type: NgSwitchDefault,
2347
- selectors: [["", "ngSwitchDefault", ""]]
2348
- });
2349
- }
2350
- (() => {
2351
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitchDefault, [{
2352
- type: Directive,
2353
- args: [{
2354
- selector: "[ngSwitchDefault]"
2355
- }]
2356
- }], () => [{
2357
- type: ViewContainerRef
2358
- }, {
2359
- type: TemplateRef
2360
- }, {
2361
- type: NgSwitch,
2362
- decorators: [{
2363
- type: Optional
2364
- }, {
2365
- type: Host
2366
- }]
2367
- }], null);
2368
- })();
2369
- function throwNgSwitchProviderNotFoundError(attrName, directiveName) {
2370
- throw new RuntimeError(2000, `An element with the "${attrName}" attribute ` + `(matching the "${directiveName}" directive) must be located inside an element with the "ngSwitch" attribute ` + `(matching "NgSwitch" directive)`);
2371
- }
2372
-
2373
- class NgPlural {
2374
- _localization;
2375
- _activeView;
2376
- _caseViews = {};
2377
- constructor(_localization) {
2378
- this._localization = _localization;
2379
- }
2380
- set ngPlural(value) {
2381
- this._updateView(value);
2382
- }
2383
- addCase(value, switchView) {
2384
- this._caseViews[value] = switchView;
2385
- }
2386
- _updateView(switchValue) {
2387
- this._clearViews();
2388
- const cases = Object.keys(this._caseViews);
2389
- const key = getPluralCategory(switchValue, cases, this._localization);
2390
- this._activateView(this._caseViews[key]);
2391
- }
2392
- _clearViews() {
2393
- if (this._activeView)
2394
- this._activeView.destroy();
2395
- }
2396
- _activateView(view) {
2397
- if (view) {
2398
- this._activeView = view;
2399
- this._activeView.create();
2400
- }
2401
- }
2402
- static ɵfac = function NgPlural_Factory(__ngFactoryType__) {
2403
- return new (__ngFactoryType__ || NgPlural)(ɵ_directiveInject(NgLocalization));
2404
- };
2405
- static ɵdir = /* @__PURE__ */ ɵ_defineDirective({
2406
- type: NgPlural,
2407
- selectors: [["", "ngPlural", ""]],
2408
- inputs: {
2409
- ngPlural: "ngPlural"
2410
- }
2411
- });
2412
- }
2413
- (() => {
2414
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgPlural, [{
2415
- type: Directive,
2416
- args: [{
2417
- selector: "[ngPlural]"
2418
- }]
2419
- }], () => [{
2420
- type: NgLocalization
2421
- }], {
2422
- ngPlural: [{
2423
- type: Input
2424
- }]
2425
- });
2426
- })();
2427
-
2428
- class NgPluralCase {
2429
- value;
2430
- constructor(value, template, viewContainer, ngPlural) {
2431
- this.value = value;
2432
- const isANumber = !isNaN(Number(value));
2433
- ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template));
2434
- }
2435
- static ɵfac = function NgPluralCase_Factory(__ngFactoryType__) {
2436
- return new (__ngFactoryType__ || NgPluralCase)(ɵ_injectAttribute("ngPluralCase"), ɵ_directiveInject(TemplateRef), ɵ_directiveInject(ViewContainerRef), ɵ_directiveInject(NgPlural, 1));
2437
- };
2438
- static ɵdir = /* @__PURE__ */ ɵ_defineDirective({
2439
- type: NgPluralCase,
2440
- selectors: [["", "ngPluralCase", ""]]
2441
- });
2442
- }
2443
- (() => {
2444
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgPluralCase, [{
2445
- type: Directive,
2446
- args: [{
2447
- selector: "[ngPluralCase]"
2448
- }]
2449
- }], () => [{
2450
- type: undefined,
2451
- decorators: [{
2452
- type: Attribute,
2453
- args: ["ngPluralCase"]
2454
- }]
2455
- }, {
2456
- type: TemplateRef
2457
- }, {
2458
- type: ViewContainerRef
2459
- }, {
2460
- type: NgPlural,
2461
- decorators: [{
2462
- type: Host
2463
- }]
2464
- }], null);
2465
- })();
2466
-
2467
- class NgStyle {
2468
- _ngEl;
2469
- _differs;
2470
- _renderer;
2471
- _ngStyle = null;
2472
- _differ = null;
2473
- constructor(_ngEl, _differs, _renderer) {
2474
- this._ngEl = _ngEl;
2475
- this._differs = _differs;
2476
- this._renderer = _renderer;
2477
- }
2478
- set ngStyle(values) {
2479
- this._ngStyle = values;
2480
- if (!this._differ && values) {
2481
- this._differ = this._differs.find(values).create();
2482
- }
2483
- }
2484
- ngDoCheck() {
2485
- if (this._differ) {
2486
- const changes = this._differ.diff(this._ngStyle);
2487
- if (changes) {
2488
- this._applyChanges(changes);
2489
- }
2490
- }
2491
- }
2492
- _setStyle(nameAndUnit, value) {
2493
- const [name, unit] = nameAndUnit.split(".");
2494
- const flags = name.indexOf("-") === -1 ? undefined : RendererStyleFlags2.DashCase;
2495
- if (value != null) {
2496
- this._renderer.setStyle(this._ngEl.nativeElement, name, unit ? `${value}${unit}` : value, flags);
2497
- } else {
2498
- this._renderer.removeStyle(this._ngEl.nativeElement, name, flags);
2499
- }
2500
- }
2501
- _applyChanges(changes) {
2502
- changes.forEachRemovedItem((record) => this._setStyle(record.key, null));
2503
- changes.forEachAddedItem((record) => this._setStyle(record.key, record.currentValue));
2504
- changes.forEachChangedItem((record) => this._setStyle(record.key, record.currentValue));
2505
- }
2506
- static ɵfac = function NgStyle_Factory(__ngFactoryType__) {
2507
- return new (__ngFactoryType__ || NgStyle)(ɵ_directiveInject(ElementRef), ɵ_directiveInject(KeyValueDiffers), ɵ_directiveInject(Renderer2));
2508
- };
2509
- static ɵdir = /* @__PURE__ */ ɵ_defineDirective({
2510
- type: NgStyle,
2511
- selectors: [["", "ngStyle", ""]],
2512
- inputs: {
2513
- ngStyle: "ngStyle"
2514
- }
2515
- });
2516
- }
2517
- (() => {
2518
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgStyle, [{
2519
- type: Directive,
2520
- args: [{
2521
- selector: "[ngStyle]"
2522
- }]
2523
- }], () => [{
2524
- type: ElementRef
2525
- }, {
2526
- type: KeyValueDiffers
2527
- }, {
2528
- type: Renderer2
2529
- }], {
2530
- ngStyle: [{
2531
- type: Input,
2532
- args: ["ngStyle"]
2533
- }]
2534
- });
2535
- })();
2536
-
2537
- class NgTemplateOutlet {
2538
- _viewContainerRef;
2539
- _viewRef = null;
2540
- ngTemplateOutletContext = null;
2541
- ngTemplateOutlet = null;
2542
- ngTemplateOutletInjector = null;
2543
- injector = inject(Injector);
2544
- constructor(_viewContainerRef) {
2545
- this._viewContainerRef = _viewContainerRef;
2546
- }
2547
- ngOnChanges(changes) {
2548
- if (this._shouldRecreateView(changes)) {
2549
- const viewContainerRef = this._viewContainerRef;
2550
- if (this._viewRef) {
2551
- viewContainerRef.remove(viewContainerRef.indexOf(this._viewRef));
2552
- }
2553
- if (!this.ngTemplateOutlet) {
2554
- this._viewRef = null;
2555
- return;
2556
- }
2557
- const viewContext = this._createContextForwardProxy();
2558
- this._viewRef = viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, viewContext, {
2559
- injector: this._getInjector()
2560
- });
2561
- }
2562
- }
2563
- _getInjector() {
2564
- if (this.ngTemplateOutletInjector === "outlet") {
2565
- return this.injector;
2566
- }
2567
- return this.ngTemplateOutletInjector ?? undefined;
2568
- }
2569
- _shouldRecreateView(changes) {
2570
- return !!changes["ngTemplateOutlet"] || !!changes["ngTemplateOutletInjector"];
2571
- }
2572
- _createContextForwardProxy() {
2573
- return new Proxy({}, {
2574
- set: (_target, prop, newValue) => {
2575
- if (!this.ngTemplateOutletContext) {
2576
- return false;
2577
- }
2578
- return Reflect.set(this.ngTemplateOutletContext, prop, newValue);
2579
- },
2580
- get: (_target, prop, receiver) => {
2581
- if (!this.ngTemplateOutletContext) {
2582
- return;
2583
- }
2584
- return Reflect.get(this.ngTemplateOutletContext, prop, receiver);
2585
- }
2586
- });
2587
- }
2588
- static ɵfac = function NgTemplateOutlet_Factory(__ngFactoryType__) {
2589
- return new (__ngFactoryType__ || NgTemplateOutlet)(ɵ_directiveInject(ViewContainerRef));
2590
- };
2591
- static ɵdir = /* @__PURE__ */ ɵ_defineDirective({
2592
- type: NgTemplateOutlet,
2593
- selectors: [["", "ngTemplateOutlet", ""]],
2594
- inputs: {
2595
- ngTemplateOutletContext: "ngTemplateOutletContext",
2596
- ngTemplateOutlet: "ngTemplateOutlet",
2597
- ngTemplateOutletInjector: "ngTemplateOutletInjector"
2598
- },
2599
- features: [ɵ_NgOnChangesFeature]
2600
- });
2601
- }
2602
- (() => {
2603
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgTemplateOutlet, [{
2604
- type: Directive,
2605
- args: [{
2606
- selector: "[ngTemplateOutlet]"
2607
- }]
2608
- }], () => [{
2609
- type: ViewContainerRef
2610
- }], {
2611
- ngTemplateOutletContext: [{
2612
- type: Input
2613
- }],
2614
- ngTemplateOutlet: [{
2615
- type: Input
2616
- }],
2617
- ngTemplateOutletInjector: [{
2618
- type: Input
2619
- }]
2620
- });
2621
- })();
2622
- var COMMON_DIRECTIVES = [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase];
2623
- function invalidPipeArgumentError(type, value) {
2624
- return new RuntimeError(2100, ngDevMode && `InvalidPipeArgument: '${value}' for pipe '${stringify(type)}'`);
2625
- }
2626
- function warnIfSignal(pipeName, value) {
2627
- if (isSignal(value)) {
2628
- console.warn(`The ${pipeName} does not unwrap signals. Received a signal with value:`, value());
2629
- }
2630
- }
2631
-
2632
- class SubscribableStrategy {
2633
- createSubscription(async, updateLatestValue, onError) {
2634
- return untracked(() => async.subscribe({
2635
- next: updateLatestValue,
2636
- error: onError
2637
- }));
2638
- }
2639
- dispose(subscription) {
2640
- untracked(() => subscription.unsubscribe());
2641
- }
2642
- }
2643
-
2644
- class PromiseStrategy {
2645
- createSubscription(async, updateLatestValue, onError) {
2646
- async.then((v) => updateLatestValue?.(v), (e) => onError?.(e));
2647
- return {
2648
- unsubscribe: () => {
2649
- updateLatestValue = null;
2650
- onError = null;
2651
- }
2652
- };
2653
- }
2654
- dispose(subscription) {
2655
- subscription.unsubscribe();
2656
- }
2657
- }
2658
- var _promiseStrategy = new PromiseStrategy;
2659
- var _subscribableStrategy = new SubscribableStrategy;
2660
-
2661
- class AsyncPipe {
2662
- _ref;
2663
- _latestValue = null;
2664
- markForCheckOnValueUpdate = true;
2665
- _subscription = null;
2666
- _obj = null;
2667
- _strategy = null;
2668
- applicationErrorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);
2669
- constructor(ref) {
2670
- this._ref = ref;
2671
- }
2672
- ngOnDestroy() {
2673
- if (this._subscription) {
2674
- this._dispose();
2675
- }
2676
- this._ref = null;
2677
- }
2678
- transform(obj) {
2679
- if (!this._obj) {
2680
- if (obj) {
2681
- try {
2682
- this.markForCheckOnValueUpdate = false;
2683
- this._subscribe(obj);
2684
- } finally {
2685
- this.markForCheckOnValueUpdate = true;
2686
- }
2687
- }
2688
- return this._latestValue;
2689
- }
2690
- if (obj !== this._obj) {
2691
- this._dispose();
2692
- return this.transform(obj);
2693
- }
2694
- return this._latestValue;
2695
- }
2696
- _subscribe(obj) {
2697
- this._obj = obj;
2698
- this._strategy = this._selectStrategy(obj);
2699
- this._subscription = this._strategy.createSubscription(obj, (value) => this._updateLatestValue(obj, value), (e) => this.applicationErrorHandler(e));
2700
- }
2701
- _selectStrategy(obj) {
2702
- if (isPromise(obj)) {
2703
- return _promiseStrategy;
2704
- }
2705
- if (isSubscribable(obj)) {
2706
- return _subscribableStrategy;
2707
- }
2708
- throw invalidPipeArgumentError(AsyncPipe, obj);
2709
- }
2710
- _dispose() {
2711
- this._strategy.dispose(this._subscription);
2712
- this._latestValue = null;
2713
- this._subscription = null;
2714
- this._obj = null;
2715
- }
2716
- _updateLatestValue(async, value) {
2717
- if (async === this._obj) {
2718
- this._latestValue = value;
2719
- if (this.markForCheckOnValueUpdate) {
2720
- this._ref?.markForCheck();
2721
- }
2722
- }
2723
- }
2724
- static ɵfac = function AsyncPipe_Factory(__ngFactoryType__) {
2725
- return new (__ngFactoryType__ || AsyncPipe)(ɵ_directiveInject(ChangeDetectorRef, 16));
2726
- };
2727
- static ɵpipe = /* @__PURE__ */ ɵ_definePipe({
2728
- name: "async",
2729
- type: AsyncPipe,
2730
- pure: false
2731
- });
2732
- }
2733
- (() => {
2734
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AsyncPipe, [{
2735
- type: Pipe,
2736
- args: [{
2737
- name: "async",
2738
- pure: false
2739
- }]
2740
- }], () => [{
2741
- type: ChangeDetectorRef
2742
- }], null);
2743
- })();
2744
-
2745
- class LowerCasePipe {
2746
- transform(value) {
2747
- if (value == null)
2748
- return null;
2749
- assertPipeArgument(LowerCasePipe, value);
2750
- return value.toLowerCase();
2751
- }
2752
- static ɵfac = function LowerCasePipe_Factory(__ngFactoryType__) {
2753
- return new (__ngFactoryType__ || LowerCasePipe);
2754
- };
2755
- static ɵpipe = /* @__PURE__ */ ɵ_definePipe({
2756
- name: "lowercase",
2757
- type: LowerCasePipe,
2758
- pure: true
2759
- });
2760
- }
2761
- (() => {
2762
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LowerCasePipe, [{
2763
- type: Pipe,
2764
- args: [{
2765
- name: "lowercase"
2766
- }]
2767
- }], null, null);
2768
- })();
2769
- var unicodeWordMatch = /(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g;
2770
-
2771
- class TitleCasePipe {
2772
- transform(value) {
2773
- if (value == null)
2774
- return null;
2775
- assertPipeArgument(TitleCasePipe, value);
2776
- return value.replace(unicodeWordMatch, (txt) => txt[0].toUpperCase() + txt.slice(1).toLowerCase());
2777
- }
2778
- static ɵfac = function TitleCasePipe_Factory(__ngFactoryType__) {
2779
- return new (__ngFactoryType__ || TitleCasePipe);
2780
- };
2781
- static ɵpipe = /* @__PURE__ */ ɵ_definePipe({
2782
- name: "titlecase",
2783
- type: TitleCasePipe,
2784
- pure: true
2785
- });
2786
- }
2787
- (() => {
2788
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TitleCasePipe, [{
2789
- type: Pipe,
2790
- args: [{
2791
- name: "titlecase"
2792
- }]
2793
- }], null, null);
2794
- })();
2795
-
2796
- class UpperCasePipe {
2797
- transform(value) {
2798
- if (value == null)
2799
- return null;
2800
- assertPipeArgument(UpperCasePipe, value);
2801
- return value.toUpperCase();
2802
- }
2803
- static ɵfac = function UpperCasePipe_Factory(__ngFactoryType__) {
2804
- return new (__ngFactoryType__ || UpperCasePipe);
2805
- };
2806
- static ɵpipe = /* @__PURE__ */ ɵ_definePipe({
2807
- name: "uppercase",
2808
- type: UpperCasePipe,
2809
- pure: true
2810
- });
2811
- }
2812
- (() => {
2813
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(UpperCasePipe, [{
2814
- type: Pipe,
2815
- args: [{
2816
- name: "uppercase"
2817
- }]
2818
- }], null, null);
2819
- })();
2820
- function assertPipeArgument(pipe, value) {
2821
- if (typeof value !== "string") {
2822
- throw invalidPipeArgumentError(pipe, value);
2823
- }
2824
- }
2825
- var DEFAULT_DATE_FORMAT = "mediumDate";
2826
- var DATE_PIPE_DEFAULT_TIMEZONE = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "DATE_PIPE_DEFAULT_TIMEZONE" : "");
2827
- var DATE_PIPE_DEFAULT_OPTIONS = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "DATE_PIPE_DEFAULT_OPTIONS" : "");
2828
-
2829
- class DatePipe {
2830
- locale;
2831
- defaultTimezone;
2832
- defaultOptions;
2833
- constructor(locale, defaultTimezone, defaultOptions) {
2834
- this.locale = locale;
2835
- this.defaultTimezone = defaultTimezone;
2836
- this.defaultOptions = defaultOptions;
2837
- }
2838
- transform(value, format, timezone, locale) {
2839
- if (value == null || value === "" || value !== value)
2840
- return null;
2841
- try {
2842
- const _format = format ?? this.defaultOptions?.dateFormat ?? DEFAULT_DATE_FORMAT;
2843
- const _timezone = timezone ?? this.defaultOptions?.timezone ?? this.defaultTimezone ?? undefined;
2844
- return formatDate(value, _format, locale || this.locale, _timezone);
2845
- } catch (error) {
2846
- throw invalidPipeArgumentError(DatePipe, error.message);
2847
- }
2848
- }
2849
- static ɵfac = function DatePipe_Factory(__ngFactoryType__) {
2850
- return new (__ngFactoryType__ || DatePipe)(ɵ_directiveInject(LOCALE_ID, 16), ɵ_directiveInject(DATE_PIPE_DEFAULT_TIMEZONE, 24), ɵ_directiveInject(DATE_PIPE_DEFAULT_OPTIONS, 24));
2851
- };
2852
- static ɵpipe = /* @__PURE__ */ ɵ_definePipe({
2853
- name: "date",
2854
- type: DatePipe,
2855
- pure: true
2856
- });
2857
- }
2858
- (() => {
2859
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DatePipe, [{
2860
- type: Pipe,
2861
- args: [{
2862
- name: "date"
2863
- }]
2864
- }], () => [{
2865
- type: undefined,
2866
- decorators: [{
2867
- type: Inject,
2868
- args: [LOCALE_ID]
2869
- }]
2870
- }, {
2871
- type: undefined,
2872
- decorators: [{
2873
- type: Inject,
2874
- args: [DATE_PIPE_DEFAULT_TIMEZONE]
2875
- }, {
2876
- type: Optional
2877
- }]
2878
- }, {
2879
- type: undefined,
2880
- decorators: [{
2881
- type: Inject,
2882
- args: [DATE_PIPE_DEFAULT_OPTIONS]
2883
- }, {
2884
- type: Optional
2885
- }]
2886
- }], null);
2887
- })();
2888
- var _INTERPOLATION_REGEXP = /#/g;
2889
-
2890
- class I18nPluralPipe {
2891
- _localization;
2892
- constructor(_localization) {
2893
- this._localization = _localization;
2894
- }
2895
- transform(value, pluralMap, locale) {
2896
- if (value == null)
2897
- return "";
2898
- if (typeof pluralMap !== "object" || pluralMap === null) {
2899
- throw invalidPipeArgumentError(I18nPluralPipe, pluralMap);
2900
- }
2901
- const key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale);
2902
- return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());
2903
- }
2904
- static ɵfac = function I18nPluralPipe_Factory(__ngFactoryType__) {
2905
- return new (__ngFactoryType__ || I18nPluralPipe)(ɵ_directiveInject(NgLocalization, 16));
2906
- };
2907
- static ɵpipe = /* @__PURE__ */ ɵ_definePipe({
2908
- name: "i18nPlural",
2909
- type: I18nPluralPipe,
2910
- pure: true
2911
- });
2912
- }
2913
- (() => {
2914
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(I18nPluralPipe, [{
2915
- type: Pipe,
2916
- args: [{
2917
- name: "i18nPlural"
2918
- }]
2919
- }], () => [{
2920
- type: NgLocalization
2921
- }], null);
2922
- })();
2923
-
2924
- class I18nSelectPipe {
2925
- transform(value, mapping) {
2926
- if (value == null)
2927
- return "";
2928
- if (typeof mapping !== "object" || typeof value !== "string") {
2929
- throw invalidPipeArgumentError(I18nSelectPipe, mapping);
2930
- }
2931
- if (mapping.hasOwnProperty(value)) {
2932
- return mapping[value];
2933
- }
2934
- if (mapping.hasOwnProperty("other")) {
2935
- return mapping["other"];
2936
- }
2937
- return "";
2938
- }
2939
- static ɵfac = function I18nSelectPipe_Factory(__ngFactoryType__) {
2940
- return new (__ngFactoryType__ || I18nSelectPipe);
2941
- };
2942
- static ɵpipe = /* @__PURE__ */ ɵ_definePipe({
2943
- name: "i18nSelect",
2944
- type: I18nSelectPipe,
2945
- pure: true
2946
- });
2947
- }
2948
- (() => {
2949
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(I18nSelectPipe, [{
2950
- type: Pipe,
2951
- args: [{
2952
- name: "i18nSelect"
2953
- }]
2954
- }], null, null);
2955
- })();
2956
-
2957
- class JsonPipe {
2958
- transform(value) {
2959
- ngDevMode && warnIfSignal("JsonPipe", value);
2960
- return JSON.stringify(value, null, 2);
2961
- }
2962
- static ɵfac = function JsonPipe_Factory(__ngFactoryType__) {
2963
- return new (__ngFactoryType__ || JsonPipe);
2964
- };
2965
- static ɵpipe = /* @__PURE__ */ ɵ_definePipe({
2966
- name: "json",
2967
- type: JsonPipe,
2968
- pure: false
2969
- });
2970
- }
2971
- (() => {
2972
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(JsonPipe, [{
2973
- type: Pipe,
2974
- args: [{
2975
- name: "json",
2976
- pure: false
2977
- }]
2978
- }], null, null);
2979
- })();
2980
- function makeKeyValuePair(key, value) {
2981
- return {
2982
- key,
2983
- value
2984
- };
2985
- }
2986
-
2987
- class KeyValuePipe {
2988
- differs;
2989
- constructor(differs) {
2990
- this.differs = differs;
2991
- }
2992
- differ;
2993
- keyValues = [];
2994
- compareFn = defaultComparator;
2995
- transform(input, compareFn = defaultComparator) {
2996
- ngDevMode && warnIfSignal("KeyValuePipe", input);
2997
- if (!input || !(input instanceof Map) && typeof input !== "object") {
2998
- return null;
2999
- }
3000
- this.differ ??= this.differs.find(input).create();
3001
- const differChanges = this.differ.diff(input);
3002
- const compareFnChanged = compareFn !== this.compareFn;
3003
- if (differChanges) {
3004
- this.keyValues = [];
3005
- differChanges.forEachItem((r) => {
3006
- this.keyValues.push(makeKeyValuePair(r.key, r.currentValue));
3007
- });
3008
- }
3009
- if (differChanges || compareFnChanged) {
3010
- if (compareFn) {
3011
- this.keyValues.sort(compareFn);
3012
- }
3013
- this.compareFn = compareFn;
3014
- }
3015
- return this.keyValues;
3016
- }
3017
- static ɵfac = function KeyValuePipe_Factory(__ngFactoryType__) {
3018
- return new (__ngFactoryType__ || KeyValuePipe)(ɵ_directiveInject(KeyValueDiffers, 16));
3019
- };
3020
- static ɵpipe = /* @__PURE__ */ ɵ_definePipe({
3021
- name: "keyvalue",
3022
- type: KeyValuePipe,
3023
- pure: false
3024
- });
3025
- }
3026
- (() => {
3027
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(KeyValuePipe, [{
3028
- type: Pipe,
3029
- args: [{
3030
- name: "keyvalue",
3031
- pure: false
3032
- }]
3033
- }], () => [{
3034
- type: KeyValueDiffers
3035
- }], null);
3036
- })();
3037
- function defaultComparator(keyValueA, keyValueB) {
3038
- const a = keyValueA.key;
3039
- const b = keyValueB.key;
3040
- if (a === b)
3041
- return 0;
3042
- if (a == null)
3043
- return 1;
3044
- if (b == null)
3045
- return -1;
3046
- if (typeof a == "string" && typeof b == "string") {
3047
- return a < b ? -1 : 1;
3048
- }
3049
- if (typeof a == "number" && typeof b == "number") {
3050
- return a - b;
3051
- }
3052
- if (typeof a == "boolean" && typeof b == "boolean") {
3053
- return a < b ? -1 : 1;
3054
- }
3055
- const aString = String(a);
3056
- const bString = String(b);
3057
- return aString == bString ? 0 : aString < bString ? -1 : 1;
3058
- }
3059
-
3060
- class DecimalPipe {
3061
- _locale;
3062
- constructor(_locale) {
3063
- this._locale = _locale;
3064
- }
3065
- transform(value, digitsInfo, locale) {
3066
- if (!isValue(value))
3067
- return null;
3068
- locale ||= this._locale;
3069
- try {
3070
- const num = strToNumber(value);
3071
- return formatNumber(num, locale, digitsInfo);
3072
- } catch (error) {
3073
- throw invalidPipeArgumentError(DecimalPipe, error.message);
3074
- }
3075
- }
3076
- static ɵfac = function DecimalPipe_Factory(__ngFactoryType__) {
3077
- return new (__ngFactoryType__ || DecimalPipe)(ɵ_directiveInject(LOCALE_ID, 16));
3078
- };
3079
- static ɵpipe = /* @__PURE__ */ ɵ_definePipe({
3080
- name: "number",
3081
- type: DecimalPipe,
3082
- pure: true
3083
- });
3084
- }
3085
- (() => {
3086
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DecimalPipe, [{
3087
- type: Pipe,
3088
- args: [{
3089
- name: "number"
3090
- }]
3091
- }], () => [{
3092
- type: undefined,
3093
- decorators: [{
3094
- type: Inject,
3095
- args: [LOCALE_ID]
3096
- }]
3097
- }], null);
3098
- })();
3099
-
3100
- class PercentPipe {
3101
- _locale;
3102
- constructor(_locale) {
3103
- this._locale = _locale;
3104
- }
3105
- transform(value, digitsInfo, locale) {
3106
- if (!isValue(value))
3107
- return null;
3108
- locale ||= this._locale;
3109
- try {
3110
- const num = strToNumber(value);
3111
- return formatPercent(num, locale, digitsInfo);
3112
- } catch (error) {
3113
- throw invalidPipeArgumentError(PercentPipe, error.message);
3114
- }
3115
- }
3116
- static ɵfac = function PercentPipe_Factory(__ngFactoryType__) {
3117
- return new (__ngFactoryType__ || PercentPipe)(ɵ_directiveInject(LOCALE_ID, 16));
3118
- };
3119
- static ɵpipe = /* @__PURE__ */ ɵ_definePipe({
3120
- name: "percent",
3121
- type: PercentPipe,
3122
- pure: true
3123
- });
3124
- }
3125
- (() => {
3126
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PercentPipe, [{
3127
- type: Pipe,
3128
- args: [{
3129
- name: "percent"
3130
- }]
3131
- }], () => [{
3132
- type: undefined,
3133
- decorators: [{
3134
- type: Inject,
3135
- args: [LOCALE_ID]
3136
- }]
3137
- }], null);
3138
- })();
3139
-
3140
- class CurrencyPipe {
3141
- _locale;
3142
- _defaultCurrencyCode;
3143
- constructor(_locale, _defaultCurrencyCode = "USD") {
3144
- this._locale = _locale;
3145
- this._defaultCurrencyCode = _defaultCurrencyCode;
3146
- }
3147
- transform(value, currencyCode = this._defaultCurrencyCode, display = "symbol", digitsInfo, locale) {
3148
- if (!isValue(value))
3149
- return null;
3150
- locale ||= this._locale;
3151
- if (typeof display === "boolean") {
3152
- if (typeof ngDevMode === "undefined" || ngDevMode) {
3153
- console.warn(`Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are "code", "symbol" or "symbol-narrow".`);
3154
- }
3155
- display = display ? "symbol" : "code";
3156
- }
3157
- let currency = currencyCode || this._defaultCurrencyCode;
3158
- if (display !== "code") {
3159
- if (display === "symbol" || display === "symbol-narrow") {
3160
- currency = getCurrencySymbol(currency, display === "symbol" ? "wide" : "narrow", locale);
3161
- } else {
3162
- currency = display;
3163
- }
3164
- }
3165
- try {
3166
- const num = strToNumber(value);
3167
- return formatCurrency(num, locale, currency, currencyCode, digitsInfo);
3168
- } catch (error) {
3169
- throw invalidPipeArgumentError(CurrencyPipe, error.message);
3170
- }
3171
- }
3172
- static ɵfac = function CurrencyPipe_Factory(__ngFactoryType__) {
3173
- return new (__ngFactoryType__ || CurrencyPipe)(ɵ_directiveInject(LOCALE_ID, 16), ɵ_directiveInject(DEFAULT_CURRENCY_CODE, 16));
3174
- };
3175
- static ɵpipe = /* @__PURE__ */ ɵ_definePipe({
3176
- name: "currency",
3177
- type: CurrencyPipe,
3178
- pure: true
3179
- });
3180
- }
3181
- (() => {
3182
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CurrencyPipe, [{
3183
- type: Pipe,
3184
- args: [{
3185
- name: "currency"
3186
- }]
3187
- }], () => [{
3188
- type: undefined,
3189
- decorators: [{
3190
- type: Inject,
3191
- args: [LOCALE_ID]
3192
- }]
3193
- }, {
3194
- type: undefined,
3195
- decorators: [{
3196
- type: Inject,
3197
- args: [DEFAULT_CURRENCY_CODE]
3198
- }]
3199
- }], null);
3200
- })();
3201
- function isValue(value) {
3202
- return !(value == null || value === "" || value !== value);
3203
- }
3204
- function strToNumber(value) {
3205
- if (typeof value === "string" && !isNaN(Number(value) - parseFloat(value))) {
3206
- return Number(value);
3207
- }
3208
- if (typeof value !== "number") {
3209
- throw new RuntimeError(2309, ngDevMode && `${value} is not a number`);
3210
- }
3211
- return value;
3212
- }
3213
-
3214
- class SlicePipe {
3215
- transform(value, start, end) {
3216
- if (value == null)
3217
- return null;
3218
- const supports = typeof value === "string" || Array.isArray(value);
3219
- if (!supports) {
3220
- throw invalidPipeArgumentError(SlicePipe, value);
3221
- }
3222
- return value.slice(start, end);
3223
- }
3224
- static ɵfac = function SlicePipe_Factory(__ngFactoryType__) {
3225
- return new (__ngFactoryType__ || SlicePipe);
3226
- };
3227
- static ɵpipe = /* @__PURE__ */ ɵ_definePipe({
3228
- name: "slice",
3229
- type: SlicePipe,
3230
- pure: false
3231
- });
3232
- }
3233
- (() => {
3234
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SlicePipe, [{
3235
- type: Pipe,
3236
- args: [{
3237
- name: "slice",
3238
- pure: false
3239
- }]
3240
- }], null, null);
3241
- })();
3242
- var COMMON_PIPES = [AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe];
3243
-
3244
- class CommonModule {
3245
- static ɵfac = function CommonModule_Factory(__ngFactoryType__) {
3246
- return new (__ngFactoryType__ || CommonModule);
3247
- };
3248
- static ɵmod = /* @__PURE__ */ ɵ_defineNgModule({
3249
- type: CommonModule
3250
- });
3251
- static ɵinj = /* @__PURE__ */ ɵ_defineInjector({});
3252
- }
3253
- (() => {
3254
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CommonModule, [{
3255
- type: NgModule,
3256
- args: [{
3257
- imports: [COMMON_DIRECTIVES, COMMON_PIPES],
3258
- exports: [COMMON_DIRECTIVES, COMMON_PIPES]
3259
- }]
3260
- }], null, null);
3261
- })();
3262
-
3263
- // node_modules/@angular/common/fesm2022/_platform_navigation-chunk.mjs
3264
- var PRECOMMIT_HANDLER_SUPPORTED = new InjectionToken("", {
3265
- factory: () => {
3266
- return typeof window !== "undefined" && typeof window.NavigationPrecommitController !== "undefined";
3267
- }
3268
- });
3269
-
3270
- class PlatformNavigation {
3271
- static ɵfac = function PlatformNavigation_Factory(__ngFactoryType__) {
3272
- return new (__ngFactoryType__ || PlatformNavigation);
3273
- };
3274
- static ɵprov = /* @__PURE__ */ ɵ_defineInjectable({
3275
- token: PlatformNavigation,
3276
- factory: () => (() => window.navigation)(),
3277
- providedIn: "platform"
3278
- });
3279
- }
3280
- (() => {
3281
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformNavigation, [{
3282
- type: Injectable,
3283
- args: [{
3284
- providedIn: "platform",
3285
- useFactory: () => window.navigation
3286
- }]
3287
- }], null, null);
3288
- })();
3289
-
3290
- // node_modules/@angular/common/fesm2022/common.mjs
3291
- var exports_common = {};
3292
- __export(exports_common, {
3293
- ɵsetRootDomAdapter: () => setRootDomAdapter,
3294
- ɵparseCookieValue: () => parseCookieValue,
3295
- ɵnormalizeQueryParams: () => normalizeQueryParams,
3296
- ɵgetDOM: () => getDOM,
3297
- ɵPRECOMMIT_HANDLER_SUPPORTED: () => PRECOMMIT_HANDLER_SUPPORTED,
3298
- ɵPLATFORM_SERVER_ID: () => PLATFORM_SERVER_ID,
3299
- ɵPLATFORM_BROWSER_ID: () => PLATFORM_BROWSER_ID,
3300
- ɵNullViewportScroller: () => NullViewportScroller,
3301
- ɵNavigationAdapterForLocation: () => NavigationAdapterForLocation,
3302
- ɵDomAdapter: () => DomAdapter,
3303
- registerLocaleData: () => registerLocaleData2,
3304
- provideNetlifyLoader: () => provideNetlifyLoader,
3305
- provideImgixLoader: () => provideImgixLoader,
3306
- provideImageKitLoader: () => provideImageKitLoader,
3307
- provideCloudinaryLoader: () => provideCloudinaryLoader,
3308
- provideCloudflareLoader: () => provideCloudflareLoader,
3309
- isPlatformServer: () => isPlatformServer,
3310
- isPlatformBrowser: () => isPlatformBrowser,
3311
- getNumberOfCurrencyDigits: () => getNumberOfCurrencyDigits,
3312
- getLocaleWeekEndRange: () => getLocaleWeekEndRange,
3313
- getLocaleTimeFormat: () => getLocaleTimeFormat,
3314
- getLocalePluralCase: () => getLocalePluralCase2,
3315
- getLocaleNumberSymbol: () => getLocaleNumberSymbol,
3316
- getLocaleNumberFormat: () => getLocaleNumberFormat,
3317
- getLocaleMonthNames: () => getLocaleMonthNames,
3318
- getLocaleId: () => getLocaleId,
3319
- getLocaleFirstDayOfWeek: () => getLocaleFirstDayOfWeek,
3320
- getLocaleExtraDayPeriods: () => getLocaleExtraDayPeriods,
3321
- getLocaleExtraDayPeriodRules: () => getLocaleExtraDayPeriodRules,
3322
- getLocaleEraNames: () => getLocaleEraNames,
3323
- getLocaleDirection: () => getLocaleDirection,
3324
- getLocaleDayPeriods: () => getLocaleDayPeriods,
3325
- getLocaleDayNames: () => getLocaleDayNames,
3326
- getLocaleDateTimeFormat: () => getLocaleDateTimeFormat,
3327
- getLocaleDateFormat: () => getLocaleDateFormat,
3328
- getLocaleCurrencySymbol: () => getLocaleCurrencySymbol,
3329
- getLocaleCurrencyName: () => getLocaleCurrencyName,
3330
- getLocaleCurrencyCode: () => getLocaleCurrencyCode2,
3331
- getCurrencySymbol: () => getCurrencySymbol,
3332
- formatPercent: () => formatPercent,
3333
- formatNumber: () => formatNumber,
3334
- formatDate: () => formatDate,
3335
- formatCurrency: () => formatCurrency,
3336
- XhrFactory: () => XhrFactory,
3337
- WeekDay: () => WeekDay,
3338
- ViewportScroller: () => ViewportScroller,
3339
- VERSION: () => VERSION,
3340
- UpperCasePipe: () => UpperCasePipe,
3341
- TranslationWidth: () => TranslationWidth,
3342
- TrailingSlashPathLocationStrategy: () => TrailingSlashPathLocationStrategy,
3343
- TitleCasePipe: () => TitleCasePipe,
3344
- SlicePipe: () => SlicePipe,
3345
- Plural: () => Plural,
3346
- PlatformNavigation: () => PlatformNavigation,
3347
- PlatformLocation: () => PlatformLocation,
3348
- PercentPipe: () => PercentPipe,
3349
- PathLocationStrategy: () => PathLocationStrategy,
3350
- PRECONNECT_CHECK_BLOCKLIST: () => PRECONNECT_CHECK_BLOCKLIST,
3351
- NumberSymbol: () => NumberSymbol,
3352
- NumberFormatStyle: () => NumberFormatStyle,
3353
- NoTrailingSlashPathLocationStrategy: () => NoTrailingSlashPathLocationStrategy,
3354
- NgTemplateOutlet: () => NgTemplateOutlet,
3355
- NgSwitchDefault: () => NgSwitchDefault,
3356
- NgSwitchCase: () => NgSwitchCase,
3357
- NgSwitch: () => NgSwitch,
3358
- NgStyle: () => NgStyle,
3359
- NgPluralCase: () => NgPluralCase,
3360
- NgPlural: () => NgPlural,
3361
- NgOptimizedImage: () => NgOptimizedImage,
3362
- NgLocalization: () => NgLocalization,
3363
- NgLocaleLocalization: () => NgLocaleLocalization,
3364
- NgIfContext: () => NgIfContext,
3365
- NgIf: () => NgIf,
3366
- NgForOfContext: () => NgForOfContext,
3367
- NgForOf: () => NgForOf,
3368
- NgFor: () => NgForOf,
3369
- NgComponentOutlet: () => NgComponentOutlet,
3370
- NgClass: () => NgClass,
3371
- LowerCasePipe: () => LowerCasePipe,
3372
- LocationStrategy: () => LocationStrategy,
3373
- Location: () => Location,
3374
- LOCATION_INITIALIZED: () => LOCATION_INITIALIZED,
3375
- KeyValuePipe: () => KeyValuePipe,
3376
- JsonPipe: () => JsonPipe,
3377
- IMAGE_LOADER: () => IMAGE_LOADER,
3378
- IMAGE_CONFIG: () => IMAGE_CONFIG,
3379
- I18nSelectPipe: () => I18nSelectPipe,
3380
- I18nPluralPipe: () => I18nPluralPipe,
3381
- HashLocationStrategy: () => HashLocationStrategy,
3382
- FormatWidth: () => FormatWidth,
3383
- FormStyle: () => FormStyle,
3384
- DecimalPipe: () => DecimalPipe,
3385
- DatePipe: () => DatePipe,
3386
- DOCUMENT: () => DOCUMENT,
3387
- DATE_PIPE_DEFAULT_TIMEZONE: () => DATE_PIPE_DEFAULT_TIMEZONE,
3388
- DATE_PIPE_DEFAULT_OPTIONS: () => DATE_PIPE_DEFAULT_OPTIONS,
3389
- CurrencyPipe: () => CurrencyPipe,
3390
- CommonModule: () => CommonModule,
3391
- BrowserPlatformLocation: () => BrowserPlatformLocation,
3392
- AsyncPipe: () => AsyncPipe,
3393
- APP_BASE_HREF: () => APP_BASE_HREF
3394
- });
3395
- class NavigationAdapterForLocation extends Location {
3396
- navigation = inject(PlatformNavigation);
3397
- destroyRef = inject(DestroyRef);
3398
- constructor() {
3399
- super(inject(LocationStrategy));
3400
- this.registerNavigationListeners();
3401
- }
3402
- registerNavigationListeners() {
3403
- const currentEntryChangeListener = () => {
3404
- this._notifyUrlChangeListeners(this.path(true), this.getState());
3405
- };
3406
- this.navigation.addEventListener("currententrychange", currentEntryChangeListener);
3407
- this.destroyRef.onDestroy(() => {
3408
- this.navigation.removeEventListener("currententrychange", currentEntryChangeListener);
3409
- });
3410
- }
3411
- getState() {
3412
- return this.navigation.currentEntry?.getState();
3413
- }
3414
- replaceState(path, query = "", state = null) {
3415
- const url = this.prepareExternalUrl(path + normalizeQueryParams(query));
3416
- this.navigation.navigate(url, {
3417
- state,
3418
- history: "replace"
3419
- });
3420
- }
3421
- go(path, query = "", state = null) {
3422
- const url = this.prepareExternalUrl(path + normalizeQueryParams(query));
3423
- this.navigation.navigate(url, {
3424
- state,
3425
- history: "push"
3426
- });
3427
- }
3428
- back() {
3429
- this.navigation.back();
3430
- }
3431
- forward() {
3432
- this.navigation.forward();
3433
- }
3434
- onUrlChange(fn) {
3435
- this._urlChangeListeners.push(fn);
3436
- return () => {
3437
- const fnIndex = this._urlChangeListeners.indexOf(fn);
3438
- this._urlChangeListeners.splice(fnIndex, 1);
3439
- };
3440
- }
3441
- static ɵfac = function NavigationAdapterForLocation_Factory(__ngFactoryType__) {
3442
- return new (__ngFactoryType__ || NavigationAdapterForLocation);
3443
- };
3444
- static ɵprov = /* @__PURE__ */ ɵ_defineInjectable({
3445
- token: NavigationAdapterForLocation,
3446
- factory: NavigationAdapterForLocation.ɵfac
3447
- });
3448
- }
3449
- (() => {
3450
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NavigationAdapterForLocation, [{
3451
- type: Injectable
3452
- }], () => [], null);
3453
- })();
3454
- function registerLocaleData2(data, localeId, extraData) {
3455
- return registerLocaleData(data, localeId, extraData);
3456
- }
3457
- var PLATFORM_BROWSER_ID = "browser";
3458
- var PLATFORM_SERVER_ID = "server";
3459
- function isPlatformBrowser(platformId) {
3460
- return platformId === PLATFORM_BROWSER_ID;
3461
- }
3462
- function isPlatformServer(platformId) {
3463
- return platformId === PLATFORM_SERVER_ID;
3464
- }
3465
- var VERSION = /* @__PURE__ */ new Version("21.2.6");
3466
-
3467
- class ViewportScroller {
3468
- static ɵprov = /* @__PURE__ */ ɵ_defineInjectable({
3469
- token: ViewportScroller,
3470
- providedIn: "root",
3471
- factory: () => typeof ngServerMode !== "undefined" && ngServerMode ? new NullViewportScroller : new BrowserViewportScroller(inject(DOCUMENT), window)
3472
- });
3473
- }
3474
-
3475
- class BrowserViewportScroller {
3476
- document;
3477
- window;
3478
- offset = () => [0, 0];
3479
- constructor(document, window2) {
3480
- this.document = document;
3481
- this.window = window2;
3482
- }
3483
- setOffset(offset) {
3484
- if (Array.isArray(offset)) {
3485
- this.offset = () => offset;
3486
- } else {
3487
- this.offset = offset;
3488
- }
3489
- }
3490
- getScrollPosition() {
3491
- return [this.window.scrollX, this.window.scrollY];
3492
- }
3493
- scrollToPosition(position, options) {
3494
- this.window.scrollTo({
3495
- ...options,
3496
- left: position[0],
3497
- top: position[1]
3498
- });
3499
- }
3500
- scrollToAnchor(target, options) {
3501
- const elSelected = findAnchorFromDocument(this.document, target);
3502
- if (elSelected) {
3503
- this.scrollToElement(elSelected, options);
3504
- elSelected.focus();
3505
- }
3506
- }
3507
- setHistoryScrollRestoration(scrollRestoration) {
3508
- try {
3509
- this.window.history.scrollRestoration = scrollRestoration;
3510
- } catch {
3511
- console.warn(formatRuntimeError(2400, ngDevMode && "Failed to set `window.history.scrollRestoration`. " + `This may occur when:
3512
- ` + `• The script is running inside a sandboxed iframe
3513
- ` + `• The window is partially navigated or inactive
3514
- ` + `• The script is executed in an untrusted or special context (e.g., test runners, browser extensions, or content previews)
3515
- ` + "Scroll position may not be preserved across navigation."));
3516
- }
3517
- }
3518
- scrollToElement(el, options) {
3519
- const rect = el.getBoundingClientRect();
3520
- const left = rect.left + this.window.pageXOffset;
3521
- const top = rect.top + this.window.pageYOffset;
3522
- const offset = this.offset();
3523
- this.window.scrollTo({
3524
- ...options,
3525
- left: left - offset[0],
3526
- top: top - offset[1]
3527
- });
3528
- }
3529
- }
3530
- function findAnchorFromDocument(document, target) {
3531
- const documentResult = document.getElementById(target) || document.getElementsByName(target)[0];
3532
- if (documentResult) {
3533
- return documentResult;
3534
- }
3535
- if (typeof document.createTreeWalker === "function" && document.body && typeof document.body.attachShadow === "function") {
3536
- const treeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT);
3537
- let currentNode = treeWalker.currentNode;
3538
- while (currentNode) {
3539
- const shadowRoot = currentNode.shadowRoot;
3540
- if (shadowRoot) {
3541
- const result = shadowRoot.getElementById(target) || shadowRoot.querySelector(`[name="${target}"]`);
3542
- if (result) {
3543
- return result;
3544
- }
3545
- }
3546
- currentNode = treeWalker.nextNode();
3547
- }
3548
- }
3549
- return null;
3550
- }
3551
-
3552
- class NullViewportScroller {
3553
- setOffset(offset) {}
3554
- getScrollPosition() {
3555
- return [0, 0];
3556
- }
3557
- scrollToPosition(position) {}
3558
- scrollToAnchor(anchor) {}
3559
- setHistoryScrollRestoration(scrollRestoration) {}
3560
- }
3561
- var PLACEHOLDER_QUALITY = "20";
3562
- function getUrl(src, win) {
3563
- return isAbsoluteUrl(src) ? new URL(src) : new URL(src, win.location.href);
3564
- }
3565
- function isAbsoluteUrl(src) {
3566
- return /^https?:\/\//.test(src);
3567
- }
3568
- function extractHostname(url) {
3569
- return isAbsoluteUrl(url) ? new URL(url).hostname : url;
3570
- }
3571
- function isValidPath(path) {
3572
- const isString = typeof path === "string";
3573
- if (!isString || path.trim() === "") {
3574
- return false;
3575
- }
3576
- try {
3577
- const url = new URL(path);
3578
- return true;
3579
- } catch {
3580
- return false;
3581
- }
3582
- }
3583
- function normalizePath(path) {
3584
- return path.endsWith("/") ? path.slice(0, -1) : path;
3585
- }
3586
- function normalizeSrc(src) {
3587
- return src.startsWith("/") ? src.slice(1) : src;
3588
- }
3589
- var noopImageLoader = (config) => config.src;
3590
- var IMAGE_LOADER = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "ImageLoader" : "", {
3591
- factory: () => noopImageLoader
3592
- });
3593
- function createImageLoader(buildUrlFn, exampleUrls) {
3594
- return function provideImageLoader(path) {
3595
- if (!isValidPath(path)) {
3596
- throwInvalidPathError(path, exampleUrls || []);
3597
- }
3598
- path = normalizePath(path);
3599
- const loaderFn = (config) => {
3600
- if (isAbsoluteUrl(config.src)) {
3601
- throwUnexpectedAbsoluteUrlError(path, config.src);
3602
- }
3603
- return buildUrlFn(path, {
3604
- ...config,
3605
- src: normalizeSrc(config.src)
3606
- });
3607
- };
3608
- const providers = [{
3609
- provide: IMAGE_LOADER,
3610
- useValue: loaderFn
3611
- }];
3612
- return providers;
3613
- };
3614
- }
3615
- function throwInvalidPathError(path, exampleUrls) {
3616
- throw new RuntimeError(2959, ngDevMode && `Image loader has detected an invalid path (\`${path}\`). ` + `To fix this, supply a path using one of the following formats: ${exampleUrls.join(" or ")}`);
3617
- }
3618
- function throwUnexpectedAbsoluteUrlError(path, url) {
3619
- throw new RuntimeError(2959, ngDevMode && `Image loader has detected a \`<img>\` tag with an invalid \`ngSrc\` attribute: ${url}. ` + `This image loader expects \`ngSrc\` to be a relative URL - ` + `however the provided value is an absolute URL. ` + `To fix this, provide \`ngSrc\` as a path relative to the base URL ` + `configured for this loader (\`${path}\`).`);
3620
- }
3621
- function normalizeLoaderTransform(transform, separator) {
3622
- if (typeof transform === "string") {
3623
- return transform;
3624
- }
3625
- return Object.entries(transform).map(([key, value]) => `${key}${separator}${value}`).join(",");
3626
- }
3627
- var provideCloudflareLoader = createImageLoader(createCloudflareUrl, ngDevMode ? ["https://<ZONE>/cdn-cgi/image/<OPTIONS>/<SOURCE-IMAGE>"] : undefined);
3628
- function createCloudflareUrl(path, config) {
3629
- let params = `format=auto`;
3630
- if (config.width) {
3631
- params += `,width=${config.width}`;
3632
- }
3633
- if (config.height) {
3634
- params += `,height=${config.height}`;
3635
- }
3636
- if (config.isPlaceholder) {
3637
- params += `,quality=${PLACEHOLDER_QUALITY}`;
3638
- }
3639
- if (config.loaderParams?.["transform"]) {
3640
- const transformStr = normalizeLoaderTransform(config.loaderParams["transform"], "=");
3641
- params += `,${transformStr}`;
3642
- }
3643
- return `${path}/cdn-cgi/image/${params}/${config.src}`;
3644
- }
3645
- var cloudinaryLoaderInfo = {
3646
- name: "Cloudinary",
3647
- testUrl: isCloudinaryUrl
3648
- };
3649
- var CLOUDINARY_LOADER_REGEX = /https?\:\/\/[^\/]+\.cloudinary\.com\/.+/;
3650
- function isCloudinaryUrl(url) {
3651
- return CLOUDINARY_LOADER_REGEX.test(url);
3652
- }
3653
- var provideCloudinaryLoader = createImageLoader(createCloudinaryUrl, ngDevMode ? ["https://res.cloudinary.com/mysite", "https://mysite.cloudinary.com", "https://subdomain.mysite.com"] : undefined);
3654
- function createCloudinaryUrl(path, config) {
3655
- const quality = config.isPlaceholder ? "q_auto:low" : "q_auto";
3656
- let params = `f_auto,${quality}`;
3657
- if (config.width) {
3658
- params += `,w_${config.width}`;
3659
- }
3660
- if (config.height) {
3661
- params += `,h_${config.height}`;
3662
- }
3663
- if (config.loaderParams?.["rounded"]) {
3664
- params += `,r_max`;
3665
- }
3666
- if (config.loaderParams?.["transform"]) {
3667
- const transformStr = normalizeLoaderTransform(config.loaderParams["transform"], "_");
3668
- params += `,${transformStr}`;
3669
- }
3670
- return `${path}/image/upload/${params}/${config.src}`;
3671
- }
3672
- var imageKitLoaderInfo = {
3673
- name: "ImageKit",
3674
- testUrl: isImageKitUrl
3675
- };
3676
- var IMAGE_KIT_LOADER_REGEX = /https?\:\/\/[^\/]+\.imagekit\.io\/.+/;
3677
- function isImageKitUrl(url) {
3678
- return IMAGE_KIT_LOADER_REGEX.test(url);
3679
- }
3680
- var provideImageKitLoader = createImageLoader(createImagekitUrl, ngDevMode ? ["https://ik.imagekit.io/mysite", "https://subdomain.mysite.com"] : undefined);
3681
- function createImagekitUrl(path, config) {
3682
- const {
3683
- src,
3684
- width
3685
- } = config;
3686
- const params = [];
3687
- if (width) {
3688
- params.push(`w-${width}`);
3689
- }
3690
- if (config.height) {
3691
- params.push(`h-${config.height}`);
3692
- }
3693
- if (config.isPlaceholder) {
3694
- params.push(`q-${PLACEHOLDER_QUALITY}`);
3695
- }
3696
- if (config.loaderParams?.["transform"]) {
3697
- const transformStr = normalizeLoaderTransform(config.loaderParams["transform"], "-");
3698
- params.push(transformStr);
3699
- }
3700
- const urlSegments = params.length ? [path, `tr:${params.join(",")}`, src] : [path, src];
3701
- const url = new URL(urlSegments.join("/"));
3702
- return url.href;
3703
- }
3704
- var imgixLoaderInfo = {
3705
- name: "Imgix",
3706
- testUrl: isImgixUrl
3707
- };
3708
- var IMGIX_LOADER_REGEX = /https?\:\/\/[^\/]+\.imgix\.net\/.+/;
3709
- function isImgixUrl(url) {
3710
- return IMGIX_LOADER_REGEX.test(url);
3711
- }
3712
- var provideImgixLoader = createImageLoader(createImgixUrl, ngDevMode ? ["https://somepath.imgix.net/"] : undefined);
3713
- function createImgixUrl(path, config) {
3714
- const params = [];
3715
- params.push("auto=format");
3716
- if (config.width) {
3717
- params.push(`w=${config.width}`);
3718
- }
3719
- if (config.height) {
3720
- params.push(`h=${config.height}`);
3721
- }
3722
- if (config.isPlaceholder) {
3723
- params.push(`q=${PLACEHOLDER_QUALITY}`);
3724
- }
3725
- if (config.loaderParams?.["transform"]) {
3726
- const transform = normalizeLoaderTransform(config.loaderParams["transform"], "=").split(",");
3727
- params.push(...transform);
3728
- }
3729
- const url = new URL(`${path}/${config.src}`);
3730
- url.search = params.join("&");
3731
- return url.href;
3732
- }
3733
- var netlifyLoaderInfo = {
3734
- name: "Netlify",
3735
- testUrl: isNetlifyUrl
3736
- };
3737
- var NETLIFY_LOADER_REGEX = /https?\:\/\/[^\/]+\.netlify\.app\/.+/;
3738
- function isNetlifyUrl(url) {
3739
- return NETLIFY_LOADER_REGEX.test(url);
3740
- }
3741
- function provideNetlifyLoader(path) {
3742
- if (path && !isValidPath(path)) {
3743
- throw new RuntimeError(2959, ngDevMode && `Image loader has detected an invalid path (\`${path}\`). ` + `To fix this, supply either the full URL to the Netlify site, or leave it empty to use the current site.`);
3744
- }
3745
- if (path) {
3746
- const url = new URL(path);
3747
- path = url.origin;
3748
- }
3749
- const loaderFn = (config) => {
3750
- return createNetlifyUrl(config, path);
3751
- };
3752
- const providers = [{
3753
- provide: IMAGE_LOADER,
3754
- useValue: loaderFn
3755
- }];
3756
- return providers;
3757
- }
3758
- var validParams = new Map([["height", "h"], ["fit", "fit"], ["quality", "q"], ["q", "q"], ["position", "position"]]);
3759
- function createNetlifyUrl(config, path) {
3760
- const url = new URL(path ?? "https://a/");
3761
- url.pathname = "/.netlify/images";
3762
- if (!isAbsoluteUrl(config.src) && !config.src.startsWith("/")) {
3763
- config.src = "/" + config.src;
3764
- }
3765
- url.searchParams.set("url", config.src);
3766
- if (config.width) {
3767
- url.searchParams.set("w", config.width.toString());
3768
- }
3769
- if (config.height) {
3770
- url.searchParams.set("h", config.height.toString());
3771
- }
3772
- const configQuality = config.loaderParams?.["quality"] ?? config.loaderParams?.["q"];
3773
- if (config.isPlaceholder && !configQuality) {
3774
- url.searchParams.set("q", PLACEHOLDER_QUALITY);
3775
- }
3776
- for (const [param, value] of Object.entries(config.loaderParams ?? {})) {
3777
- if (validParams.has(param)) {
3778
- url.searchParams.set(validParams.get(param), value.toString());
3779
- } else {
3780
- if (ngDevMode) {
3781
- console.warn(formatRuntimeError(2959, `The Netlify image loader has detected an \`<img>\` tag with the unsupported attribute "\`${param}\`".`));
3782
- }
3783
- }
3784
- }
3785
- return url.hostname === "a" ? url.href.replace(url.origin, "") : url.href;
3786
- }
3787
- function imgDirectiveDetails(ngSrc, includeNgSrc = true) {
3788
- const ngSrcInfo = includeNgSrc ? `(activated on an <img> element with the \`ngSrc="${ngSrc}"\`) ` : "";
3789
- return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`;
3790
- }
3791
- function assertDevMode(checkName) {
3792
- if (!ngDevMode) {
3793
- throw new RuntimeError(2958, `Unexpected invocation of the ${checkName} in the prod mode. ` + `Please make sure that the prod mode is enabled for production builds.`);
3794
- }
3795
- }
3796
-
3797
- class LCPImageObserver {
3798
- images = new Map;
3799
- window = inject(DOCUMENT).defaultView;
3800
- observer = null;
3801
- constructor() {
3802
- assertDevMode("LCP checker");
3803
- if ((typeof ngServerMode === "undefined" || !ngServerMode) && typeof PerformanceObserver !== "undefined") {
3804
- this.observer = this.initPerformanceObserver();
3805
- }
3806
- }
3807
- initPerformanceObserver() {
3808
- const observer = new PerformanceObserver((entryList) => {
3809
- const entries = entryList.getEntries();
3810
- if (entries.length === 0)
3811
- return;
3812
- const lcpElement = entries[entries.length - 1];
3813
- const imgSrc = lcpElement.element?.src ?? "";
3814
- if (imgSrc.startsWith("data:") || imgSrc.startsWith("blob:"))
3815
- return;
3816
- const img = this.images.get(imgSrc);
3817
- if (!img)
3818
- return;
3819
- if (!img.priority && !img.alreadyWarnedPriority) {
3820
- img.alreadyWarnedPriority = true;
3821
- logMissingPriorityError(imgSrc);
3822
- }
3823
- if (img.modified && !img.alreadyWarnedModified) {
3824
- img.alreadyWarnedModified = true;
3825
- logModifiedWarning(imgSrc);
3826
- }
3827
- });
3828
- observer.observe({
3829
- type: "largest-contentful-paint",
3830
- buffered: true
3831
- });
3832
- return observer;
3833
- }
3834
- registerImage(rewrittenSrc, isPriority) {
3835
- if (!this.observer)
3836
- return;
3837
- const url = getUrl(rewrittenSrc, this.window).href;
3838
- const existingState = this.images.get(url);
3839
- if (existingState) {
3840
- existingState.priority = existingState.priority || isPriority;
3841
- existingState.count++;
3842
- } else {
3843
- const newObservedImageState = {
3844
- priority: isPriority,
3845
- modified: false,
3846
- alreadyWarnedModified: false,
3847
- alreadyWarnedPriority: false,
3848
- count: 1
3849
- };
3850
- this.images.set(url, newObservedImageState);
3851
- }
3852
- }
3853
- unregisterImage(rewrittenSrc) {
3854
- if (!this.observer)
3855
- return;
3856
- const url = getUrl(rewrittenSrc, this.window).href;
3857
- const existingState = this.images.get(url);
3858
- if (existingState) {
3859
- existingState.count--;
3860
- if (existingState.count <= 0) {
3861
- this.images.delete(url);
3862
- }
3863
- }
3864
- }
3865
- updateImage(originalSrc, newSrc) {
3866
- if (!this.observer)
3867
- return;
3868
- const originalUrl = getUrl(originalSrc, this.window).href;
3869
- const newUrl = getUrl(newSrc, this.window).href;
3870
- if (originalUrl === newUrl)
3871
- return;
3872
- const originalState = this.images.get(originalUrl);
3873
- if (!originalState)
3874
- return;
3875
- originalState.count--;
3876
- if (originalState.count <= 0) {
3877
- this.images.delete(originalUrl);
3878
- }
3879
- const newState = this.images.get(newUrl);
3880
- if (newState) {
3881
- newState.priority = newState.priority || originalState.priority;
3882
- newState.modified = true;
3883
- newState.alreadyWarnedPriority = newState.alreadyWarnedPriority || originalState.alreadyWarnedPriority;
3884
- newState.alreadyWarnedModified = newState.alreadyWarnedModified || originalState.alreadyWarnedModified;
3885
- newState.count++;
3886
- } else {
3887
- this.images.set(newUrl, {
3888
- priority: originalState.priority,
3889
- modified: true,
3890
- alreadyWarnedModified: originalState.alreadyWarnedModified,
3891
- alreadyWarnedPriority: originalState.alreadyWarnedPriority,
3892
- count: 1
3893
- });
3894
- }
3895
- }
3896
- ngOnDestroy() {
3897
- if (!this.observer)
3898
- return;
3899
- this.observer.disconnect();
3900
- this.images.clear();
3901
- }
3902
- static ɵfac = function LCPImageObserver_Factory(__ngFactoryType__) {
3903
- return new (__ngFactoryType__ || LCPImageObserver);
3904
- };
3905
- static ɵprov = /* @__PURE__ */ ɵ_defineInjectable({
3906
- token: LCPImageObserver,
3907
- factory: LCPImageObserver.ɵfac,
3908
- providedIn: "root"
3909
- });
3910
- }
3911
- (() => {
3912
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LCPImageObserver, [{
3913
- type: Injectable,
3914
- args: [{
3915
- providedIn: "root"
3916
- }]
3917
- }], () => [], null);
3918
- })();
3919
- function logMissingPriorityError(ngSrc) {
3920
- const directiveDetails = imgDirectiveDetails(ngSrc);
3921
- console.error(formatRuntimeError(2955, `${directiveDetails} this image is the Largest Contentful Paint (LCP) ` + `element but was not marked "priority". This image should be marked ` + `"priority" in order to prioritize its loading. ` + `To fix this, add the "priority" attribute.`));
3922
- }
3923
- function logModifiedWarning(ngSrc) {
3924
- const directiveDetails = imgDirectiveDetails(ngSrc);
3925
- console.warn(formatRuntimeError(2964, `${directiveDetails} this image is the Largest Contentful Paint (LCP) ` + `element and has had its "ngSrc" attribute modified. This can cause ` + `slower loading performance. It is recommended not to modify the "ngSrc" ` + `property on any image which could be the LCP element.`));
3926
- }
3927
- var INTERNAL_PRECONNECT_CHECK_BLOCKLIST = new Set(["localhost", "127.0.0.1", "0.0.0.0", "[::1]"]);
3928
- var PRECONNECT_CHECK_BLOCKLIST = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "PRECONNECT_CHECK_BLOCKLIST" : "");
3929
-
3930
- class PreconnectLinkChecker {
3931
- document = inject(DOCUMENT);
3932
- preconnectLinks = null;
3933
- alreadySeen = new Set;
3934
- window = this.document.defaultView;
3935
- blocklist = new Set(INTERNAL_PRECONNECT_CHECK_BLOCKLIST);
3936
- constructor() {
3937
- assertDevMode("preconnect link checker");
3938
- const blocklist = inject(PRECONNECT_CHECK_BLOCKLIST, {
3939
- optional: true
3940
- });
3941
- if (blocklist) {
3942
- this.populateBlocklist(blocklist);
3943
- }
3944
- }
3945
- populateBlocklist(origins) {
3946
- if (Array.isArray(origins)) {
3947
- deepForEach(origins, (origin) => {
3948
- this.blocklist.add(extractHostname(origin));
3949
- });
3950
- } else {
3951
- this.blocklist.add(extractHostname(origins));
3952
- }
3953
- }
3954
- assertPreconnect(rewrittenSrc, originalNgSrc) {
3955
- if (typeof ngServerMode !== "undefined" && ngServerMode)
3956
- return;
3957
- const imgUrl = getUrl(rewrittenSrc, this.window);
3958
- if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin))
3959
- return;
3960
- this.alreadySeen.add(imgUrl.origin);
3961
- this.preconnectLinks ??= this.queryPreconnectLinks();
3962
- if (!this.preconnectLinks.has(imgUrl.origin)) {
3963
- console.warn(formatRuntimeError(2956, `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this ` + `image. Preconnecting to the origin(s) that serve priority images ensures that these ` + `images are delivered as soon as possible. To fix this, please add the following ` + `element into the <head> of the document:
3964
- ` + ` <link rel="preconnect" href="${imgUrl.origin}">`));
3965
- }
3966
- }
3967
- queryPreconnectLinks() {
3968
- const preconnectUrls = new Set;
3969
- const links = this.document.querySelectorAll("link[rel=preconnect]");
3970
- for (const link of links) {
3971
- const url = getUrl(link.href, this.window);
3972
- preconnectUrls.add(url.origin);
3973
- }
3974
- return preconnectUrls;
3975
- }
3976
- ngOnDestroy() {
3977
- this.preconnectLinks?.clear();
3978
- this.alreadySeen.clear();
3979
- }
3980
- static ɵfac = function PreconnectLinkChecker_Factory(__ngFactoryType__) {
3981
- return new (__ngFactoryType__ || PreconnectLinkChecker);
3982
- };
3983
- static ɵprov = /* @__PURE__ */ ɵ_defineInjectable({
3984
- token: PreconnectLinkChecker,
3985
- factory: PreconnectLinkChecker.ɵfac,
3986
- providedIn: "root"
3987
- });
3988
- }
3989
- (() => {
3990
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PreconnectLinkChecker, [{
3991
- type: Injectable,
3992
- args: [{
3993
- providedIn: "root"
3994
- }]
3995
- }], () => [], null);
3996
- })();
3997
- function deepForEach(input, fn) {
3998
- for (let value of input) {
3999
- Array.isArray(value) ? deepForEach(value, fn) : fn(value);
4000
- }
4001
- }
4002
- var DEFAULT_PRELOADED_IMAGES_LIMIT = 5;
4003
- var PRELOADED_IMAGES = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "NG_OPTIMIZED_PRELOADED_IMAGES" : "", {
4004
- factory: () => new Set
4005
- });
4006
-
4007
- class PreloadLinkCreator {
4008
- preloadedImages = inject(PRELOADED_IMAGES);
4009
- document = inject(DOCUMENT);
4010
- errorShown = false;
4011
- createPreloadLinkTag(renderer, src, srcset, sizes) {
4012
- if (ngDevMode && !this.errorShown && this.preloadedImages.size >= DEFAULT_PRELOADED_IMAGES_LIMIT) {
4013
- this.errorShown = true;
4014
- console.warn(formatRuntimeError(2961, `The \`NgOptimizedImage\` directive has detected that more than ` + `${DEFAULT_PRELOADED_IMAGES_LIMIT} images were marked as priority. ` + `This might negatively affect an overall performance of the page. ` + `To fix this, remove the "priority" attribute from images with less priority.`));
4015
- }
4016
- if (this.preloadedImages.has(src)) {
4017
- return;
4018
- }
4019
- this.preloadedImages.add(src);
4020
- const preload = renderer.createElement("link");
4021
- renderer.setAttribute(preload, "as", "image");
4022
- renderer.setAttribute(preload, "href", src);
4023
- renderer.setAttribute(preload, "rel", "preload");
4024
- renderer.setAttribute(preload, "fetchpriority", "high");
4025
- if (sizes) {
4026
- renderer.setAttribute(preload, "imageSizes", sizes);
4027
- }
4028
- if (srcset) {
4029
- renderer.setAttribute(preload, "imageSrcset", srcset);
4030
- }
4031
- renderer.appendChild(this.document.head, preload);
4032
- }
4033
- static ɵfac = function PreloadLinkCreator_Factory(__ngFactoryType__) {
4034
- return new (__ngFactoryType__ || PreloadLinkCreator);
4035
- };
4036
- static ɵprov = /* @__PURE__ */ ɵ_defineInjectable({
4037
- token: PreloadLinkCreator,
4038
- factory: PreloadLinkCreator.ɵfac,
4039
- providedIn: "root"
4040
- });
4041
- }
4042
- (() => {
4043
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PreloadLinkCreator, [{
4044
- type: Injectable,
4045
- args: [{
4046
- providedIn: "root"
4047
- }]
4048
- }], null, null);
4049
- })();
4050
- var BASE64_IMG_MAX_LENGTH_IN_ERROR = 50;
4051
- var VALID_WIDTH_DESCRIPTOR_SRCSET = /^((\s*\d+w\s*(,|$)){1,})$/;
4052
- var VALID_DENSITY_DESCRIPTOR_SRCSET = /^((\s*\d+(\.\d+)?x\s*(,|$)){1,})$/;
4053
- var ABSOLUTE_SRCSET_DENSITY_CAP = 3;
4054
- var RECOMMENDED_SRCSET_DENSITY_CAP = 2;
4055
- var DENSITY_SRCSET_MULTIPLIERS = [1, 2];
4056
- var VIEWPORT_BREAKPOINT_CUTOFF = 640;
4057
- var ASPECT_RATIO_TOLERANCE = 0.1;
4058
- var OVERSIZED_IMAGE_TOLERANCE = 1000;
4059
- var FIXED_SRCSET_WIDTH_LIMIT = 1920;
4060
- var FIXED_SRCSET_HEIGHT_LIMIT = 1080;
4061
- var PLACEHOLDER_DIMENSION_LIMIT = 1000;
4062
- var DATA_URL_WARN_LIMIT = 4000;
4063
- var DATA_URL_ERROR_LIMIT = 1e4;
4064
- var BUILT_IN_LOADERS = [imgixLoaderInfo, imageKitLoaderInfo, cloudinaryLoaderInfo, netlifyLoaderInfo];
4065
- var PRIORITY_COUNT_THRESHOLD = 10;
4066
- var IMGS_WITH_PRIORITY_ATTR_COUNT = 0;
4067
-
4068
- class NgOptimizedImage {
4069
- imageLoader = inject(IMAGE_LOADER);
4070
- config = processConfig(inject(IMAGE_CONFIG));
4071
- renderer = inject(Renderer2);
4072
- imgElement = inject(ElementRef).nativeElement;
4073
- injector = inject(Injector);
4074
- destroyRef = inject(DestroyRef);
4075
- lcpObserver;
4076
- _renderedSrc = null;
4077
- ngSrc;
4078
- ngSrcset;
4079
- sizes;
4080
- width;
4081
- height;
4082
- decoding;
4083
- loading;
4084
- priority = false;
4085
- loaderParams;
4086
- disableOptimizedSrcset = false;
4087
- fill = false;
4088
- placeholder;
4089
- placeholderConfig;
4090
- src;
4091
- srcset;
4092
- constructor() {
4093
- if (ngDevMode) {
4094
- this.lcpObserver = this.injector.get(LCPImageObserver);
4095
- this.destroyRef.onDestroy(() => {
4096
- if (!this.priority && this._renderedSrc !== null) {
4097
- this.lcpObserver.unregisterImage(this._renderedSrc);
4098
- }
4099
- });
4100
- }
4101
- this.destroyRef.onDestroy(() => {
4102
- this.renderer.removeAttribute(this.imgElement, "loading");
4103
- });
4104
- }
4105
- ngOnInit() {
4106
- performanceMarkFeature("NgOptimizedImage");
4107
- if (ngDevMode) {
4108
- const ngZone = this.injector.get(NgZone);
4109
- assertNonEmptyInput(this, "ngSrc", this.ngSrc);
4110
- assertValidNgSrcset(this, this.ngSrcset);
4111
- assertNoConflictingSrc(this);
4112
- if (this.ngSrcset) {
4113
- assertNoConflictingSrcset(this);
4114
- }
4115
- assertNotBase64Image(this);
4116
- assertNotBlobUrl(this);
4117
- if (this.fill) {
4118
- assertEmptyWidthAndHeight(this);
4119
- ngZone.runOutsideAngular(() => assertNonZeroRenderedHeight(this, this.imgElement, this.renderer, this.destroyRef));
4120
- } else {
4121
- assertNonEmptyWidthAndHeight(this);
4122
- if (this.height !== undefined) {
4123
- assertGreaterThanZero(this, this.height, "height");
4124
- }
4125
- if (this.width !== undefined) {
4126
- assertGreaterThanZero(this, this.width, "width");
4127
- }
4128
- ngZone.runOutsideAngular(() => assertNoImageDistortion(this, this.imgElement, this.renderer, this.destroyRef));
4129
- }
4130
- assertValidLoadingInput(this);
4131
- assertValidDecodingInput(this);
4132
- if (!this.ngSrcset) {
4133
- assertNoComplexSizes(this);
4134
- }
4135
- assertValidPlaceholder(this, this.imageLoader);
4136
- assertNotMissingBuiltInLoader(this.ngSrc, this.imageLoader);
4137
- assertNoNgSrcsetWithoutLoader(this, this.imageLoader);
4138
- assertNoLoaderParamsWithoutLoader(this, this.imageLoader);
4139
- ngZone.runOutsideAngular(() => {
4140
- this.lcpObserver.registerImage(this.getRewrittenSrc(), this.priority);
4141
- });
4142
- if (this.priority) {
4143
- const checker = this.injector.get(PreconnectLinkChecker);
4144
- checker.assertPreconnect(this.getRewrittenSrc(), this.ngSrc);
4145
- if (typeof ngServerMode !== "undefined" && !ngServerMode) {
4146
- const applicationRef = this.injector.get(ApplicationRef);
4147
- assetPriorityCountBelowThreshold(applicationRef);
4148
- }
4149
- }
4150
- }
4151
- if (this.placeholder) {
4152
- this.removePlaceholderOnLoad(this.imgElement);
4153
- }
4154
- this.setHostAttributes();
4155
- }
4156
- setHostAttributes() {
4157
- if (this.fill) {
4158
- this.sizes ||= "100vw";
4159
- } else {
4160
- this.setHostAttribute("width", this.width.toString());
4161
- this.setHostAttribute("height", this.height.toString());
4162
- }
4163
- this.setHostAttribute("loading", this.getLoadingBehavior());
4164
- this.setHostAttribute("fetchpriority", this.getFetchPriority());
4165
- this.setHostAttribute("decoding", this.getDecoding());
4166
- this.setHostAttribute("ng-img", "true");
4167
- const rewrittenSrcset = this.updateSrcAndSrcset();
4168
- if (this.sizes) {
4169
- if (this.getLoadingBehavior() === "lazy") {
4170
- this.setHostAttribute("sizes", "auto, " + this.sizes);
4171
- } else {
4172
- this.setHostAttribute("sizes", this.sizes);
4173
- }
4174
- } else {
4175
- if (this.ngSrcset && VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset) && this.getLoadingBehavior() === "lazy") {
4176
- this.setHostAttribute("sizes", "auto, 100vw");
4177
- }
4178
- }
4179
- if (typeof ngServerMode !== "undefined" && ngServerMode && this.priority) {
4180
- const preloadLinkCreator = this.injector.get(PreloadLinkCreator);
4181
- preloadLinkCreator.createPreloadLinkTag(this.renderer, this.getRewrittenSrc(), rewrittenSrcset, this.sizes);
4182
- }
4183
- }
4184
- ngOnChanges(changes) {
4185
- if (ngDevMode) {
4186
- assertNoPostInitInputChange(this, changes, ["ngSrcset", "width", "height", "priority", "fill", "loading", "sizes", "loaderParams", "disableOptimizedSrcset"]);
4187
- }
4188
- if (changes["ngSrc"] && !changes["ngSrc"].isFirstChange()) {
4189
- const oldSrc = this._renderedSrc;
4190
- this.updateSrcAndSrcset(true);
4191
- if (ngDevMode) {
4192
- const newSrc = this._renderedSrc;
4193
- if (oldSrc && newSrc && oldSrc !== newSrc) {
4194
- const ngZone = this.injector.get(NgZone);
4195
- ngZone.runOutsideAngular(() => {
4196
- this.lcpObserver.updateImage(oldSrc, newSrc);
4197
- });
4198
- }
4199
- }
4200
- }
4201
- if (ngDevMode && changes["placeholder"]?.currentValue && typeof ngServerMode !== "undefined" && !ngServerMode) {
4202
- assertPlaceholderDimensions(this, this.imgElement);
4203
- }
4204
- }
4205
- getAspectRatio() {
4206
- if (this.width && this.height && this.height !== 0) {
4207
- return this.width / this.height;
4208
- }
4209
- return null;
4210
- }
4211
- callImageLoader(configWithoutCustomParams) {
4212
- let augmentedConfig = configWithoutCustomParams;
4213
- if (this.loaderParams) {
4214
- augmentedConfig.loaderParams = this.loaderParams;
4215
- }
4216
- const ratio = this.getAspectRatio();
4217
- if (ratio !== null && augmentedConfig.width) {
4218
- augmentedConfig.height = Math.round(augmentedConfig.width / ratio);
4219
- }
4220
- return this.imageLoader(augmentedConfig);
4221
- }
4222
- getLoadingBehavior() {
4223
- if (!this.priority && this.loading !== undefined) {
4224
- return this.loading;
4225
- }
4226
- return this.priority ? "eager" : "lazy";
4227
- }
4228
- getFetchPriority() {
4229
- return this.priority ? "high" : "auto";
4230
- }
4231
- getDecoding() {
4232
- if (this.priority) {
4233
- return "sync";
4234
- }
4235
- return this.decoding ?? "auto";
4236
- }
4237
- getRewrittenSrc() {
4238
- if (!this._renderedSrc) {
4239
- const imgConfig = {
4240
- src: this.ngSrc
4241
- };
4242
- this._renderedSrc = this.callImageLoader(imgConfig);
4243
- }
4244
- return this._renderedSrc;
4245
- }
4246
- getRewrittenSrcset() {
4247
- const widthSrcSet = VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset);
4248
- const finalSrcs = this.ngSrcset.split(",").filter((src) => src !== "").map((srcStr) => {
4249
- srcStr = srcStr.trim();
4250
- const width = widthSrcSet ? parseFloat(srcStr) : parseFloat(srcStr) * this.width;
4251
- return `${this.callImageLoader({
4252
- src: this.ngSrc,
4253
- width
4254
- })} ${srcStr}`;
4255
- });
4256
- return finalSrcs.join(", ");
4257
- }
4258
- getAutomaticSrcset() {
4259
- if (this.sizes) {
4260
- return this.getResponsiveSrcset();
4261
- } else {
4262
- return this.getFixedSrcset();
4263
- }
4264
- }
4265
- getResponsiveSrcset() {
4266
- const {
4267
- breakpoints
4268
- } = this.config;
4269
- let filteredBreakpoints = breakpoints;
4270
- if (this.sizes?.trim() === "100vw") {
4271
- filteredBreakpoints = breakpoints.filter((bp) => bp >= VIEWPORT_BREAKPOINT_CUTOFF);
4272
- }
4273
- const finalSrcs = filteredBreakpoints.map((bp) => `${this.callImageLoader({
4274
- src: this.ngSrc,
4275
- width: bp
4276
- })} ${bp}w`);
4277
- return finalSrcs.join(", ");
4278
- }
4279
- updateSrcAndSrcset(forceSrcRecalc = false) {
4280
- if (forceSrcRecalc) {
4281
- this._renderedSrc = null;
4282
- }
4283
- const rewrittenSrc = this.getRewrittenSrc();
4284
- this.setHostAttribute("src", rewrittenSrc);
4285
- let rewrittenSrcset = undefined;
4286
- if (this.ngSrcset) {
4287
- rewrittenSrcset = this.getRewrittenSrcset();
4288
- } else if (this.shouldGenerateAutomaticSrcset()) {
4289
- rewrittenSrcset = this.getAutomaticSrcset();
4290
- }
4291
- if (rewrittenSrcset) {
4292
- this.setHostAttribute("srcset", rewrittenSrcset);
4293
- }
4294
- return rewrittenSrcset;
4295
- }
4296
- getFixedSrcset() {
4297
- const finalSrcs = DENSITY_SRCSET_MULTIPLIERS.map((multiplier) => `${this.callImageLoader({
4298
- src: this.ngSrc,
4299
- width: this.width * multiplier
4300
- })} ${multiplier}x`);
4301
- return finalSrcs.join(", ");
4302
- }
4303
- shouldGenerateAutomaticSrcset() {
4304
- let oversizedImage = false;
4305
- if (!this.sizes) {
4306
- oversizedImage = this.width > FIXED_SRCSET_WIDTH_LIMIT || this.height > FIXED_SRCSET_HEIGHT_LIMIT;
4307
- }
4308
- return !this.disableOptimizedSrcset && !this.srcset && this.imageLoader !== noopImageLoader && !oversizedImage;
4309
- }
4310
- generatePlaceholder(placeholderInput) {
4311
- const {
4312
- placeholderResolution
4313
- } = this.config;
4314
- if (placeholderInput === true) {
4315
- return `url(${this.callImageLoader({
4316
- src: this.ngSrc,
4317
- width: placeholderResolution,
4318
- isPlaceholder: true
4319
- })})`;
4320
- } else if (typeof placeholderInput === "string") {
4321
- return `url(${placeholderInput})`;
4322
- }
4323
- return null;
4324
- }
4325
- shouldBlurPlaceholder(placeholderConfig) {
4326
- if (!placeholderConfig || !placeholderConfig.hasOwnProperty("blur")) {
4327
- return true;
4328
- }
4329
- return Boolean(placeholderConfig.blur);
4330
- }
4331
- removePlaceholderOnLoad(img) {
4332
- const callback = () => {
4333
- const changeDetectorRef = this.injector.get(ChangeDetectorRef);
4334
- removeLoadListenerFn();
4335
- removeErrorListenerFn();
4336
- this.placeholder = false;
4337
- changeDetectorRef.markForCheck();
4338
- };
4339
- const removeLoadListenerFn = this.renderer.listen(img, "load", callback);
4340
- const removeErrorListenerFn = this.renderer.listen(img, "error", callback);
4341
- this.destroyRef.onDestroy(() => {
4342
- removeLoadListenerFn();
4343
- removeErrorListenerFn();
4344
- });
4345
- callOnLoadIfImageIsLoaded(img, callback);
4346
- }
4347
- setHostAttribute(name, value) {
4348
- this.renderer.setAttribute(this.imgElement, name, value);
4349
- }
4350
- static ɵfac = function NgOptimizedImage_Factory(__ngFactoryType__) {
4351
- return new (__ngFactoryType__ || NgOptimizedImage);
4352
- };
4353
- static ɵdir = /* @__PURE__ */ ɵ_defineDirective({
4354
- type: NgOptimizedImage,
4355
- selectors: [["img", "ngSrc", ""]],
4356
- hostVars: 18,
4357
- hostBindings: function NgOptimizedImage_HostBindings(rf, ctx) {
4358
- if (rf & 2) {
4359
- ɵ_styleProp("position", ctx.fill ? "absolute" : null)("width", ctx.fill ? "100%" : null)("height", ctx.fill ? "100%" : null)("inset", ctx.fill ? "0" : null)("background-size", ctx.placeholder ? "cover" : null)("background-position", ctx.placeholder ? "50% 50%" : null)("background-repeat", ctx.placeholder ? "no-repeat" : null)("background-image", ctx.placeholder ? ctx.generatePlaceholder(ctx.placeholder) : null)("filter", ctx.placeholder && ctx.shouldBlurPlaceholder(ctx.placeholderConfig) ? "blur(15px)" : null);
4360
- }
4361
- },
4362
- inputs: {
4363
- ngSrc: [2, "ngSrc", "ngSrc", unwrapSafeUrl],
4364
- ngSrcset: "ngSrcset",
4365
- sizes: "sizes",
4366
- width: [2, "width", "width", numberAttribute],
4367
- height: [2, "height", "height", numberAttribute],
4368
- decoding: "decoding",
4369
- loading: "loading",
4370
- priority: [2, "priority", "priority", booleanAttribute],
4371
- loaderParams: "loaderParams",
4372
- disableOptimizedSrcset: [2, "disableOptimizedSrcset", "disableOptimizedSrcset", booleanAttribute],
4373
- fill: [2, "fill", "fill", booleanAttribute],
4374
- placeholder: [2, "placeholder", "placeholder", booleanOrUrlAttribute],
4375
- placeholderConfig: "placeholderConfig",
4376
- src: "src",
4377
- srcset: "srcset"
4378
- },
4379
- features: [ɵ_NgOnChangesFeature]
4380
- });
4381
- }
4382
- (() => {
4383
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgOptimizedImage, [{
4384
- type: Directive,
4385
- args: [{
4386
- selector: "img[ngSrc]",
4387
- host: {
4388
- "[style.position]": 'fill ? "absolute" : null',
4389
- "[style.width]": 'fill ? "100%" : null',
4390
- "[style.height]": 'fill ? "100%" : null',
4391
- "[style.inset]": 'fill ? "0" : null',
4392
- "[style.background-size]": 'placeholder ? "cover" : null',
4393
- "[style.background-position]": 'placeholder ? "50% 50%" : null',
4394
- "[style.background-repeat]": 'placeholder ? "no-repeat" : null',
4395
- "[style.background-image]": "placeholder ? generatePlaceholder(placeholder) : null",
4396
- "[style.filter]": 'placeholder && shouldBlurPlaceholder(placeholderConfig) ? "blur(15px)" : null'
4397
- }
4398
- }]
4399
- }], () => [], {
4400
- ngSrc: [{
4401
- type: Input,
4402
- args: [{
4403
- required: true,
4404
- transform: unwrapSafeUrl
4405
- }]
4406
- }],
4407
- ngSrcset: [{
4408
- type: Input
4409
- }],
4410
- sizes: [{
4411
- type: Input
4412
- }],
4413
- width: [{
4414
- type: Input,
4415
- args: [{
4416
- transform: numberAttribute
4417
- }]
4418
- }],
4419
- height: [{
4420
- type: Input,
4421
- args: [{
4422
- transform: numberAttribute
4423
- }]
4424
- }],
4425
- decoding: [{
4426
- type: Input
4427
- }],
4428
- loading: [{
4429
- type: Input
4430
- }],
4431
- priority: [{
4432
- type: Input,
4433
- args: [{
4434
- transform: booleanAttribute
4435
- }]
4436
- }],
4437
- loaderParams: [{
4438
- type: Input
4439
- }],
4440
- disableOptimizedSrcset: [{
4441
- type: Input,
4442
- args: [{
4443
- transform: booleanAttribute
4444
- }]
4445
- }],
4446
- fill: [{
4447
- type: Input,
4448
- args: [{
4449
- transform: booleanAttribute
4450
- }]
4451
- }],
4452
- placeholder: [{
4453
- type: Input,
4454
- args: [{
4455
- transform: booleanOrUrlAttribute
4456
- }]
4457
- }],
4458
- placeholderConfig: [{
4459
- type: Input
4460
- }],
4461
- src: [{
4462
- type: Input
4463
- }],
4464
- srcset: [{
4465
- type: Input
4466
- }]
4467
- });
4468
- })();
4469
- function processConfig(config) {
4470
- let sortedBreakpoints = {};
4471
- if (config.breakpoints) {
4472
- sortedBreakpoints.breakpoints = config.breakpoints.sort((a, b) => a - b);
4473
- }
4474
- return Object.assign({}, IMAGE_CONFIG_DEFAULTS, config, sortedBreakpoints);
4475
- }
4476
- function assertNoConflictingSrc(dir) {
4477
- if (dir.src) {
4478
- throw new RuntimeError(2950, `${imgDirectiveDetails(dir.ngSrc)} both \`src\` and \`ngSrc\` have been set. ` + `Supplying both of these attributes breaks lazy loading. ` + `The NgOptimizedImage directive sets \`src\` itself based on the value of \`ngSrc\`. ` + `To fix this, please remove the \`src\` attribute.`);
4479
- }
4480
- }
4481
- function assertNoConflictingSrcset(dir) {
4482
- if (dir.srcset) {
4483
- throw new RuntimeError(2951, `${imgDirectiveDetails(dir.ngSrc)} both \`srcset\` and \`ngSrcset\` have been set. ` + `Supplying both of these attributes breaks lazy loading. ` + `The NgOptimizedImage directive sets \`srcset\` itself based on the value of ` + `\`ngSrcset\`. To fix this, please remove the \`srcset\` attribute.`);
4484
- }
4485
- }
4486
- function assertNotBase64Image(dir) {
4487
- let ngSrc = dir.ngSrc.trim();
4488
- if (ngSrc.startsWith("data:")) {
4489
- if (ngSrc.length > BASE64_IMG_MAX_LENGTH_IN_ERROR) {
4490
- ngSrc = ngSrc.substring(0, BASE64_IMG_MAX_LENGTH_IN_ERROR) + "...";
4491
- }
4492
- throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`ngSrc\` is a Base64-encoded string ` + `(${ngSrc}). NgOptimizedImage does not support Base64-encoded strings. ` + `To fix this, disable the NgOptimizedImage directive for this element ` + `by removing \`ngSrc\` and using a standard \`src\` attribute instead.`);
4493
- }
4494
- }
4495
- function assertNoComplexSizes(dir) {
4496
- let sizes = dir.sizes;
4497
- if (sizes?.match(/((\)|,)\s|^)\d+px/)) {
4498
- throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`sizes\` was set to a string including ` + `pixel values. For automatic \`srcset\` generation, \`sizes\` must only include responsive ` + `values, such as \`sizes="50vw"\` or \`sizes="(min-width: 768px) 50vw, 100vw"\`. ` + `To fix this, modify the \`sizes\` attribute, or provide your own \`ngSrcset\` value directly.`);
4499
- }
4500
- }
4501
- function assertValidPlaceholder(dir, imageLoader) {
4502
- assertNoPlaceholderConfigWithoutPlaceholder(dir);
4503
- assertNoRelativePlaceholderWithoutLoader(dir, imageLoader);
4504
- assertNoOversizedDataUrl(dir);
4505
- }
4506
- function assertNoPlaceholderConfigWithoutPlaceholder(dir) {
4507
- if (dir.placeholderConfig && !dir.placeholder) {
4508
- throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`placeholderConfig\` options were provided for an ` + `image that does not use the \`placeholder\` attribute, and will have no effect.`);
4509
- }
4510
- }
4511
- function assertNoRelativePlaceholderWithoutLoader(dir, imageLoader) {
4512
- if (dir.placeholder === true && imageLoader === noopImageLoader) {
4513
- throw new RuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to true but ` + `no image loader is configured (i.e. the default one is being used), ` + `which would result in the same image being used for the primary image and its placeholder. ` + `To fix this, provide a loader or remove the \`placeholder\` attribute from the image.`);
4514
- }
4515
- }
4516
- function assertNoOversizedDataUrl(dir) {
4517
- if (dir.placeholder && typeof dir.placeholder === "string" && dir.placeholder.startsWith("data:")) {
4518
- if (dir.placeholder.length > DATA_URL_ERROR_LIMIT) {
4519
- throw new RuntimeError(2965, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to a data URL which is longer ` + `than ${DATA_URL_ERROR_LIMIT} characters. This is strongly discouraged, as large inline placeholders ` + `directly increase the bundle size of Angular and hurt page load performance. To fix this, generate ` + `a smaller data URL placeholder.`);
4520
- }
4521
- if (dir.placeholder.length > DATA_URL_WARN_LIMIT) {
4522
- console.warn(formatRuntimeError(2965, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to a data URL which is longer ` + `than ${DATA_URL_WARN_LIMIT} characters. This is discouraged, as large inline placeholders ` + `directly increase the bundle size of Angular and hurt page load performance. For better loading performance, ` + `generate a smaller data URL placeholder.`));
4523
- }
4524
- }
4525
- }
4526
- function assertNotBlobUrl(dir) {
4527
- const ngSrc = dir.ngSrc.trim();
4528
- if (ngSrc.startsWith("blob:")) {
4529
- throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrc\` was set to a blob URL (${ngSrc}). ` + `Blob URLs are not supported by the NgOptimizedImage directive. ` + `To fix this, disable the NgOptimizedImage directive for this element ` + `by removing \`ngSrc\` and using a regular \`src\` attribute instead.`);
4530
- }
4531
- }
4532
- function assertNonEmptyInput(dir, name, value) {
4533
- const isString = typeof value === "string";
4534
- const isEmptyString = isString && value.trim() === "";
4535
- if (!isString || isEmptyString) {
4536
- throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`${name}\` has an invalid value ` + `(\`${value}\`). To fix this, change the value to a non-empty string.`);
4537
- }
4538
- }
4539
- function assertValidNgSrcset(dir, value) {
4540
- if (value == null)
4541
- return;
4542
- assertNonEmptyInput(dir, "ngSrcset", value);
4543
- const stringVal = value;
4544
- const isValidWidthDescriptor = VALID_WIDTH_DESCRIPTOR_SRCSET.test(stringVal);
4545
- const isValidDensityDescriptor = VALID_DENSITY_DESCRIPTOR_SRCSET.test(stringVal);
4546
- if (isValidDensityDescriptor) {
4547
- assertUnderDensityCap(dir, stringVal);
4548
- }
4549
- const isValidSrcset = isValidWidthDescriptor || isValidDensityDescriptor;
4550
- if (!isValidSrcset) {
4551
- throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrcset\` has an invalid value (\`${value}\`). ` + `To fix this, supply \`ngSrcset\` using a comma-separated list of one or more width ` + `descriptors (e.g. "100w, 200w") or density descriptors (e.g. "1x, 2x").`);
4552
- }
4553
- }
4554
- function assertUnderDensityCap(dir, value) {
4555
- const underDensityCap = value.split(",").every((num) => num === "" || parseFloat(num) <= ABSOLUTE_SRCSET_DENSITY_CAP);
4556
- if (!underDensityCap) {
4557
- throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` contains an unsupported image density:` + `\`${value}\`. NgOptimizedImage generally recommends a max image density of ` + `${RECOMMENDED_SRCSET_DENSITY_CAP}x but supports image densities up to ` + `${ABSOLUTE_SRCSET_DENSITY_CAP}x. The human eye cannot distinguish between image densities ` + `greater than ${RECOMMENDED_SRCSET_DENSITY_CAP}x - which makes them unnecessary for ` + `most use cases. Images that will be pinch-zoomed are typically the primary use case for ` + `${ABSOLUTE_SRCSET_DENSITY_CAP}x images. Please remove the high density descriptor and try again.`);
4558
- }
4559
- }
4560
- function postInitInputChangeError(dir, inputName) {
4561
- let reason;
4562
- if (inputName === "width" || inputName === "height") {
4563
- reason = `Changing \`${inputName}\` may result in different attribute value ` + `applied to the underlying image element and cause layout shifts on a page.`;
4564
- } else {
4565
- reason = `Changing the \`${inputName}\` would have no effect on the underlying ` + `image element, because the resource loading has already occurred.`;
4566
- }
4567
- return new RuntimeError(2953, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` was updated after initialization. ` + `The NgOptimizedImage directive will not react to this input change. ${reason} ` + `To fix this, either switch \`${inputName}\` to a static value ` + `or wrap the image element in an @if that is gated on the necessary value.`);
4568
- }
4569
- function assertNoPostInitInputChange(dir, changes, inputs) {
4570
- inputs.forEach((input) => {
4571
- const isUpdated = changes.hasOwnProperty(input);
4572
- if (isUpdated && !changes[input].isFirstChange()) {
4573
- if (input === "ngSrc") {
4574
- dir = {
4575
- ngSrc: changes[input].previousValue
4576
- };
4577
- }
4578
- throw postInitInputChangeError(dir, input);
4579
- }
4580
- });
4581
- }
4582
- function assertGreaterThanZero(dir, inputValue, inputName) {
4583
- const validNumber = typeof inputValue === "number" && inputValue > 0;
4584
- const validString = typeof inputValue === "string" && /^\d+$/.test(inputValue.trim()) && parseInt(inputValue) > 0;
4585
- if (!validNumber && !validString) {
4586
- throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` has an invalid value. ` + `To fix this, provide \`${inputName}\` as a number greater than 0.`);
4587
- }
4588
- }
4589
- function assertNoImageDistortion(dir, img, renderer, destroyRef) {
4590
- const callback = () => {
4591
- removeLoadListenerFn();
4592
- removeErrorListenerFn();
4593
- const computedStyle = window.getComputedStyle(img);
4594
- let renderedWidth = parseFloat(computedStyle.getPropertyValue("width"));
4595
- let renderedHeight = parseFloat(computedStyle.getPropertyValue("height"));
4596
- const boxSizing = computedStyle.getPropertyValue("box-sizing");
4597
- if (boxSizing === "border-box") {
4598
- const paddingTop = computedStyle.getPropertyValue("padding-top");
4599
- const paddingRight = computedStyle.getPropertyValue("padding-right");
4600
- const paddingBottom = computedStyle.getPropertyValue("padding-bottom");
4601
- const paddingLeft = computedStyle.getPropertyValue("padding-left");
4602
- renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
4603
- renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
4604
- }
4605
- const renderedAspectRatio = renderedWidth / renderedHeight;
4606
- const nonZeroRenderedDimensions = renderedWidth !== 0 && renderedHeight !== 0;
4607
- const intrinsicWidth = img.naturalWidth;
4608
- const intrinsicHeight = img.naturalHeight;
4609
- const intrinsicAspectRatio = intrinsicWidth / intrinsicHeight;
4610
- const suppliedWidth = dir.width;
4611
- const suppliedHeight = dir.height;
4612
- const suppliedAspectRatio = suppliedWidth / suppliedHeight;
4613
- const inaccurateDimensions = Math.abs(suppliedAspectRatio - intrinsicAspectRatio) > ASPECT_RATIO_TOLERANCE;
4614
- const stylingDistortion = nonZeroRenderedDimensions && Math.abs(intrinsicAspectRatio - renderedAspectRatio) > ASPECT_RATIO_TOLERANCE;
4615
- if (inaccurateDimensions) {
4616
- console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the image does not match ` + `the aspect ratio indicated by the width and height attributes. ` + `
4617
- Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` + `(aspect-ratio: ${round(intrinsicAspectRatio)}).
4618
- Supplied width and height attributes: ` + `${suppliedWidth}w x ${suppliedHeight}h (aspect-ratio: ${round(suppliedAspectRatio)}). ` + `
4619
- To fix this, update the width and height attributes.`));
4620
- } else if (stylingDistortion) {
4621
- console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the rendered image ` + `does not match the image's intrinsic aspect ratio. ` + `
4622
- Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` + `(aspect-ratio: ${round(intrinsicAspectRatio)}).
4623
- Rendered image size: ` + `${renderedWidth}w x ${renderedHeight}h (aspect-ratio: ` + `${round(renderedAspectRatio)}).
4624
- This issue can occur if "width" and "height" ` + `attributes are added to an image without updating the corresponding ` + `image styling. To fix this, adjust image styling. In most cases, ` + `adding "height: auto" or "width: auto" to the image styling will fix ` + `this issue.`));
4625
- } else if (!dir.ngSrcset && nonZeroRenderedDimensions) {
4626
- const recommendedWidth = RECOMMENDED_SRCSET_DENSITY_CAP * renderedWidth;
4627
- const recommendedHeight = RECOMMENDED_SRCSET_DENSITY_CAP * renderedHeight;
4628
- const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE;
4629
- const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE;
4630
- if (oversizedWidth || oversizedHeight) {
4631
- console.warn(formatRuntimeError(2960, `${imgDirectiveDetails(dir.ngSrc)} the intrinsic image is significantly ` + `larger than necessary. ` + `
4632
- Rendered image size: ${renderedWidth}w x ${renderedHeight}h. ` + `
4633
- Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h. ` + `
4634
- Recommended intrinsic image size: ${recommendedWidth}w x ${recommendedHeight}h. ` + `
4635
- Note: Recommended intrinsic image size is calculated assuming a maximum DPR of ` + `${RECOMMENDED_SRCSET_DENSITY_CAP}. To improve loading time, resize the image ` + `or consider using the "ngSrcset" and "sizes" attributes.`));
4636
- }
4637
- }
4638
- };
4639
- const removeLoadListenerFn = renderer.listen(img, "load", callback);
4640
- const removeErrorListenerFn = renderer.listen(img, "error", () => {
4641
- removeLoadListenerFn();
4642
- removeErrorListenerFn();
4643
- });
4644
- destroyRef.onDestroy(() => {
4645
- removeLoadListenerFn();
4646
- removeErrorListenerFn();
4647
- });
4648
- callOnLoadIfImageIsLoaded(img, callback);
4649
- }
4650
- function assertNonEmptyWidthAndHeight(dir) {
4651
- let missingAttributes = [];
4652
- if (dir.width === undefined)
4653
- missingAttributes.push("width");
4654
- if (dir.height === undefined)
4655
- missingAttributes.push("height");
4656
- if (missingAttributes.length > 0) {
4657
- throw new RuntimeError(2954, `${imgDirectiveDetails(dir.ngSrc)} these required attributes ` + `are missing: ${missingAttributes.map((attr) => `"${attr}"`).join(", ")}. ` + `Including "width" and "height" attributes will prevent image-related layout shifts. ` + `To fix this, include "width" and "height" attributes on the image tag or turn on ` + `"fill" mode with the \`fill\` attribute.`);
4658
- }
4659
- }
4660
- function assertEmptyWidthAndHeight(dir) {
4661
- if (dir.width || dir.height) {
4662
- throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the attributes \`height\` and/or \`width\` are present ` + `along with the \`fill\` attribute. Because \`fill\` mode causes an image to fill its containing ` + `element, the size attributes have no effect and should be removed.`);
4663
- }
4664
- }
4665
- function assertNonZeroRenderedHeight(dir, img, renderer, destroyRef) {
4666
- const callback = () => {
4667
- removeLoadListenerFn();
4668
- removeErrorListenerFn();
4669
- const renderedHeight = img.clientHeight;
4670
- if (dir.fill && renderedHeight === 0) {
4671
- console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the height of the fill-mode image is zero. ` + `This is likely because the containing element does not have the CSS 'position' ` + `property set to one of the following: "relative", "fixed", or "absolute". ` + `To fix this problem, make sure the container element has the CSS 'position' ` + `property defined and the height of the element is not zero.`));
4672
- }
4673
- };
4674
- const removeLoadListenerFn = renderer.listen(img, "load", callback);
4675
- const removeErrorListenerFn = renderer.listen(img, "error", () => {
4676
- removeLoadListenerFn();
4677
- removeErrorListenerFn();
4678
- });
4679
- destroyRef.onDestroy(() => {
4680
- removeLoadListenerFn();
4681
- removeErrorListenerFn();
4682
- });
4683
- callOnLoadIfImageIsLoaded(img, callback);
4684
- }
4685
- function assertValidLoadingInput(dir) {
4686
- if (dir.loading && dir.priority) {
4687
- throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute ` + `was used on an image that was marked "priority". ` + `Setting \`loading\` on priority images is not allowed ` + `because these images will always be eagerly loaded. ` + `To fix this, remove the “loading” attribute from the priority image.`);
4688
- }
4689
- const validInputs = ["auto", "eager", "lazy"];
4690
- if (typeof dir.loading === "string" && !validInputs.includes(dir.loading)) {
4691
- throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute ` + `has an invalid value (\`${dir.loading}\`). ` + `To fix this, provide a valid value ("lazy", "eager", or "auto").`);
4692
- }
4693
- }
4694
- function assertValidDecodingInput(dir) {
4695
- const validInputs = ["sync", "async", "auto"];
4696
- if (typeof dir.decoding === "string" && !validInputs.includes(dir.decoding)) {
4697
- throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`decoding\` attribute ` + `has an invalid value (\`${dir.decoding}\`). ` + `To fix this, provide a valid value ("sync", "async", or "auto").`);
4698
- }
4699
- }
4700
- function assertNotMissingBuiltInLoader(ngSrc, imageLoader) {
4701
- if (imageLoader === noopImageLoader) {
4702
- let builtInLoaderName = "";
4703
- for (const loader of BUILT_IN_LOADERS) {
4704
- if (loader.testUrl(ngSrc)) {
4705
- builtInLoaderName = loader.name;
4706
- break;
4707
- }
4708
- }
4709
- if (builtInLoaderName) {
4710
- console.warn(formatRuntimeError(2962, `NgOptimizedImage: It looks like your images may be hosted on the ` + `${builtInLoaderName} CDN, but your app is not using Angular's ` + `built-in loader for that CDN. We recommend switching to use ` + `the built-in by calling \`provide${builtInLoaderName}Loader()\` ` + `in your \`providers\` and passing it your instance's base URL. ` + `If you don't want to use the built-in loader, define a custom ` + `loader function using IMAGE_LOADER to silence this warning.`));
4711
- }
4712
- }
4713
- }
4714
- function assertNoNgSrcsetWithoutLoader(dir, imageLoader) {
4715
- if (dir.ngSrcset && imageLoader === noopImageLoader) {
4716
- console.warn(formatRuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` attribute is present but ` + `no image loader is configured (i.e. the default one is being used), ` + `which would result in the same image being used for all configured sizes. ` + `To fix this, provide a loader or remove the \`ngSrcset\` attribute from the image.`));
4717
- }
4718
- }
4719
- function assertNoLoaderParamsWithoutLoader(dir, imageLoader) {
4720
- if (dir.loaderParams && imageLoader === noopImageLoader) {
4721
- console.warn(formatRuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`loaderParams\` attribute is present but ` + `no image loader is configured (i.e. the default one is being used), ` + `which means that the loaderParams data will not be consumed and will not affect the URL. ` + `To fix this, provide a custom loader or remove the \`loaderParams\` attribute from the image.`));
4722
- }
4723
- }
4724
- async function assetPriorityCountBelowThreshold(appRef) {
4725
- if (IMGS_WITH_PRIORITY_ATTR_COUNT === 0) {
4726
- IMGS_WITH_PRIORITY_ATTR_COUNT++;
4727
- await appRef.whenStable();
4728
- if (IMGS_WITH_PRIORITY_ATTR_COUNT > PRIORITY_COUNT_THRESHOLD) {
4729
- console.warn(formatRuntimeError(2966, `NgOptimizedImage: The "priority" attribute is set to true more than ${PRIORITY_COUNT_THRESHOLD} times (${IMGS_WITH_PRIORITY_ATTR_COUNT} times). ` + `Marking too many images as "high" priority can hurt your application's LCP (https://web.dev/lcp). ` + `"Priority" should only be set on the image expected to be the page's LCP element.`));
4730
- }
4731
- } else {
4732
- IMGS_WITH_PRIORITY_ATTR_COUNT++;
4733
- }
4734
- }
4735
- function assertPlaceholderDimensions(dir, imgElement) {
4736
- const computedStyle = window.getComputedStyle(imgElement);
4737
- let renderedWidth = parseFloat(computedStyle.getPropertyValue("width"));
4738
- let renderedHeight = parseFloat(computedStyle.getPropertyValue("height"));
4739
- if (renderedWidth > PLACEHOLDER_DIMENSION_LIMIT || renderedHeight > PLACEHOLDER_DIMENSION_LIMIT) {
4740
- console.warn(formatRuntimeError(2967, `${imgDirectiveDetails(dir.ngSrc)} it uses a placeholder image, but at least one ` + `of the dimensions attribute (height or width) exceeds the limit of ${PLACEHOLDER_DIMENSION_LIMIT}px. ` + `To fix this, use a smaller image as a placeholder.`));
4741
- }
4742
- }
4743
- function callOnLoadIfImageIsLoaded(img, callback) {
4744
- if (img.complete && img.naturalWidth) {
4745
- callback();
4746
- }
4747
- }
4748
- function round(input) {
4749
- return Number.isInteger(input) ? input : input.toFixed(2);
4750
- }
4751
- function unwrapSafeUrl(value) {
4752
- if (typeof value === "string") {
4753
- return value;
4754
- }
4755
- return unwrapSafeValue(value);
4756
- }
4757
- function booleanOrUrlAttribute(value) {
4758
- if (typeof value === "string" && value !== "true" && value !== "false" && value !== "") {
4759
- return value;
4760
- }
4761
- return booleanAttribute(value);
4762
- }
4763
-
4764
- export { LocationStrategy, APP_BASE_HREF, PathLocationStrategy, NoTrailingSlashPathLocationStrategy, TrailingSlashPathLocationStrategy, Location, HashLocationStrategy, NumberFormatStyle, Plural, FormStyle, TranslationWidth, FormatWidth, NumberSymbol, WeekDay, getLocaleId, getLocaleDayPeriods, getLocaleDayNames, getLocaleMonthNames, getLocaleEraNames, getLocaleFirstDayOfWeek, getLocaleWeekEndRange, getLocaleDateFormat, getLocaleTimeFormat, getLocaleDateTimeFormat, getLocaleNumberSymbol, getLocaleNumberFormat, getLocaleCurrencySymbol, getLocaleCurrencyName, getLocaleCurrencyCode2 as getLocaleCurrencyCode, getLocalePluralCase2 as getLocalePluralCase, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleDirection, getCurrencySymbol, getNumberOfCurrencyDigits, formatDate, formatCurrency, formatPercent, formatNumber, NgLocalization, NgLocaleLocalization, NgClass, NgComponentOutlet, NgForOfContext, NgForOf, NgIf, NgIfContext, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, NgStyle, NgTemplateOutlet, AsyncPipe, LowerCasePipe, TitleCasePipe, UpperCasePipe, DATE_PIPE_DEFAULT_TIMEZONE, DATE_PIPE_DEFAULT_OPTIONS, DatePipe, I18nPluralPipe, I18nSelectPipe, JsonPipe, KeyValuePipe, DecimalPipe, PercentPipe, CurrencyPipe, SlicePipe, CommonModule, PRECOMMIT_HANDLER_SUPPORTED, PlatformNavigation, NavigationAdapterForLocation, registerLocaleData2 as registerLocaleData, PLATFORM_BROWSER_ID, isPlatformBrowser, isPlatformServer, VERSION, ViewportScroller, IMAGE_LOADER, provideCloudflareLoader, provideCloudinaryLoader, provideImageKitLoader, provideImgixLoader, provideNetlifyLoader, PRECONNECT_CHECK_BLOCKLIST, NgOptimizedImage, exports_common };