ngxsmk-datepicker 1.4.6 → 1.4.7

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.
@@ -1,4715 +0,0 @@
1
- import {
2
- CommonModule,
3
- DomAdapter,
4
- PLATFORM_BROWSER_ID,
5
- XhrFactory,
6
- getDOM,
7
- parseCookieValue,
8
- setRootDomAdapter
9
- } from "./chunk-42OOCJLE.js";
10
- import {
11
- APP_BOOTSTRAP_LISTENER,
12
- APP_ID,
13
- ApplicationModule,
14
- ApplicationRef,
15
- CSP_NONCE,
16
- Console,
17
- DOCUMENT,
18
- DestroyRef,
19
- ENVIRONMENT_INITIALIZER,
20
- EnvironmentInjector,
21
- ErrorHandler,
22
- INJECTOR_SCOPE,
23
- IS_ENABLED_BLOCKING_INITIAL_NAVIGATION,
24
- Inject,
25
- Injectable,
26
- InjectionToken,
27
- Injector,
28
- NgModule,
29
- NgZone,
30
- Observable,
31
- Optional,
32
- PLATFORM_ID,
33
- PLATFORM_INITIALIZER,
34
- PendingTasks,
35
- RendererFactory2,
36
- RendererStyleFlags2,
37
- ResourceImpl,
38
- RuntimeError,
39
- SecurityContext,
40
- TESTABILITY,
41
- TESTABILITY_GETTER,
42
- Testability,
43
- TestabilityRegistry,
44
- TracingService,
45
- TransferState,
46
- Version,
47
- ViewEncapsulation,
48
- XSS_SECURITY_URL,
49
- ZONELESS_ENABLED,
50
- _global,
51
- _sanitizeHtml,
52
- _sanitizeUrl,
53
- allLeavingAnimations,
54
- allowSanitizationBypassAndThrow,
55
- assertInInjectionContext,
56
- bypassSanitizationTrustHtml,
57
- bypassSanitizationTrustResourceUrl,
58
- bypassSanitizationTrustScript,
59
- bypassSanitizationTrustStyle,
60
- bypassSanitizationTrustUrl,
61
- computed,
62
- concatMap,
63
- createPlatformFactory,
64
- encapsulateResourceError,
65
- filter,
66
- finalize,
67
- formatRuntimeError,
68
- forwardRef,
69
- inject,
70
- internalCreateApplication,
71
- linkedSignal,
72
- makeEnvironmentProviders,
73
- makeStateKey,
74
- map,
75
- of,
76
- performanceMarkFeature,
77
- platformCore,
78
- runInInjectionContext,
79
- setClassMetadata,
80
- setDocument,
81
- signal,
82
- switchMap,
83
- truncateMiddle,
84
- unwrapSafeValue,
85
- withDomHydration,
86
- withEventReplay,
87
- withI18nSupport,
88
- withIncrementalHydration,
89
- ɵɵdefineInjectable,
90
- ɵɵdefineInjector,
91
- ɵɵdefineNgModule,
92
- ɵɵinject
93
- } from "./chunk-DQIUKFFJ.js";
94
- import {
95
- __async,
96
- __objRest,
97
- __spreadValues
98
- } from "./chunk-WDMUDEB6.js";
99
-
100
- // node_modules/@angular/platform-browser/fesm2022/dom_renderer.mjs
101
- var EventManagerPlugin = class {
102
- _doc;
103
- // TODO: remove (has some usage in G3)
104
- constructor(_doc) {
105
- this._doc = _doc;
106
- }
107
- // Using non-null assertion because it's set by EventManager's constructor
108
- manager;
109
- };
110
- var DomEventsPlugin = class _DomEventsPlugin extends EventManagerPlugin {
111
- constructor(doc) {
112
- super(doc);
113
- }
114
- // This plugin should come last in the list of plugins, because it accepts all
115
- // events.
116
- supports(eventName) {
117
- return true;
118
- }
119
- addEventListener(element, eventName, handler, options) {
120
- element.addEventListener(eventName, handler, options);
121
- return () => this.removeEventListener(element, eventName, handler, options);
122
- }
123
- removeEventListener(target, eventName, callback, options) {
124
- return target.removeEventListener(eventName, callback, options);
125
- }
126
- static ɵfac = function DomEventsPlugin_Factory(__ngFactoryType__) {
127
- return new (__ngFactoryType__ || _DomEventsPlugin)(ɵɵinject(DOCUMENT));
128
- };
129
- static ɵprov = ɵɵdefineInjectable({
130
- token: _DomEventsPlugin,
131
- factory: _DomEventsPlugin.ɵfac
132
- });
133
- };
134
- (() => {
135
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DomEventsPlugin, [{
136
- type: Injectable
137
- }], () => [{
138
- type: void 0,
139
- decorators: [{
140
- type: Inject,
141
- args: [DOCUMENT]
142
- }]
143
- }], null);
144
- })();
145
- var EVENT_MANAGER_PLUGINS = new InjectionToken(ngDevMode ? "EventManagerPlugins" : "");
146
- var EventManager = class _EventManager {
147
- _zone;
148
- _plugins;
149
- _eventNameToPlugin = /* @__PURE__ */ new Map();
150
- /**
151
- * Initializes an instance of the event-manager service.
152
- */
153
- constructor(plugins, _zone) {
154
- this._zone = _zone;
155
- plugins.forEach((plugin) => {
156
- plugin.manager = this;
157
- });
158
- const otherPlugins = plugins.filter((p) => !(p instanceof DomEventsPlugin));
159
- this._plugins = otherPlugins.slice().reverse();
160
- const domEventPlugin = plugins.find((p) => p instanceof DomEventsPlugin);
161
- if (domEventPlugin) {
162
- this._plugins.push(domEventPlugin);
163
- }
164
- }
165
- /**
166
- * Registers a handler for a specific element and event.
167
- *
168
- * @param element The HTML element to receive event notifications.
169
- * @param eventName The name of the event to listen for.
170
- * @param handler A function to call when the notification occurs. Receives the
171
- * event object as an argument.
172
- * @param options Options that configure how the event listener is bound.
173
- * @returns A callback function that can be used to remove the handler.
174
- */
175
- addEventListener(element, eventName, handler, options) {
176
- const plugin = this._findPluginFor(eventName);
177
- return plugin.addEventListener(element, eventName, handler, options);
178
- }
179
- /**
180
- * Retrieves the compilation zone in which event listeners are registered.
181
- */
182
- getZone() {
183
- return this._zone;
184
- }
185
- /** @internal */
186
- _findPluginFor(eventName) {
187
- let plugin = this._eventNameToPlugin.get(eventName);
188
- if (plugin) {
189
- return plugin;
190
- }
191
- const plugins = this._plugins;
192
- plugin = plugins.find((plugin2) => plugin2.supports(eventName));
193
- if (!plugin) {
194
- throw new RuntimeError(5101, (typeof ngDevMode === "undefined" || ngDevMode) && `No event manager plugin found for event ${eventName}`);
195
- }
196
- this._eventNameToPlugin.set(eventName, plugin);
197
- return plugin;
198
- }
199
- static ɵfac = function EventManager_Factory(__ngFactoryType__) {
200
- return new (__ngFactoryType__ || _EventManager)(ɵɵinject(EVENT_MANAGER_PLUGINS), ɵɵinject(NgZone));
201
- };
202
- static ɵprov = ɵɵdefineInjectable({
203
- token: _EventManager,
204
- factory: _EventManager.ɵfac
205
- });
206
- };
207
- (() => {
208
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(EventManager, [{
209
- type: Injectable
210
- }], () => [{
211
- type: void 0,
212
- decorators: [{
213
- type: Inject,
214
- args: [EVENT_MANAGER_PLUGINS]
215
- }]
216
- }, {
217
- type: NgZone
218
- }], null);
219
- })();
220
- var APP_ID_ATTRIBUTE_NAME = "ng-app-id";
221
- function removeElements(elements) {
222
- for (const element of elements) {
223
- element.remove();
224
- }
225
- }
226
- function createStyleElement(style, doc) {
227
- const styleElement = doc.createElement("style");
228
- styleElement.textContent = style;
229
- return styleElement;
230
- }
231
- function addServerStyles(doc, appId, inline, external) {
232
- const elements = doc.head?.querySelectorAll(`style[${APP_ID_ATTRIBUTE_NAME}="${appId}"],link[${APP_ID_ATTRIBUTE_NAME}="${appId}"]`);
233
- if (elements) {
234
- for (const styleElement of elements) {
235
- styleElement.removeAttribute(APP_ID_ATTRIBUTE_NAME);
236
- if (styleElement instanceof HTMLLinkElement) {
237
- external.set(styleElement.href.slice(styleElement.href.lastIndexOf("/") + 1), {
238
- usage: 0,
239
- elements: [styleElement]
240
- });
241
- } else if (styleElement.textContent) {
242
- inline.set(styleElement.textContent, {
243
- usage: 0,
244
- elements: [styleElement]
245
- });
246
- }
247
- }
248
- }
249
- }
250
- function createLinkElement(url, doc) {
251
- const linkElement = doc.createElement("link");
252
- linkElement.setAttribute("rel", "stylesheet");
253
- linkElement.setAttribute("href", url);
254
- return linkElement;
255
- }
256
- var SharedStylesHost = class _SharedStylesHost {
257
- doc;
258
- appId;
259
- nonce;
260
- /**
261
- * Provides usage information for active inline style content and associated HTML <style> elements.
262
- * Embedded styles typically originate from the `styles` metadata of a rendered component.
263
- */
264
- inline = /* @__PURE__ */ new Map();
265
- /**
266
- * Provides usage information for active external style URLs and the associated HTML <link> elements.
267
- * External styles typically originate from the `ɵɵExternalStylesFeature` of a rendered component.
268
- */
269
- external = /* @__PURE__ */ new Map();
270
- /**
271
- * Set of host DOM nodes that will have styles attached.
272
- */
273
- hosts = /* @__PURE__ */ new Set();
274
- constructor(doc, appId, nonce, platformId = {}) {
275
- this.doc = doc;
276
- this.appId = appId;
277
- this.nonce = nonce;
278
- addServerStyles(doc, appId, this.inline, this.external);
279
- this.hosts.add(doc.head);
280
- }
281
- /**
282
- * Adds embedded styles to the DOM via HTML `style` elements.
283
- * @param styles An array of style content strings.
284
- */
285
- addStyles(styles, urls) {
286
- for (const value of styles) {
287
- this.addUsage(value, this.inline, createStyleElement);
288
- }
289
- urls?.forEach((value) => this.addUsage(value, this.external, createLinkElement));
290
- }
291
- /**
292
- * Removes embedded styles from the DOM that were added as HTML `style` elements.
293
- * @param styles An array of style content strings.
294
- */
295
- removeStyles(styles, urls) {
296
- for (const value of styles) {
297
- this.removeUsage(value, this.inline);
298
- }
299
- urls?.forEach((value) => this.removeUsage(value, this.external));
300
- }
301
- addUsage(value, usages, creator) {
302
- const record = usages.get(value);
303
- if (record) {
304
- if ((typeof ngDevMode === "undefined" || ngDevMode) && record.usage === 0) {
305
- record.elements.forEach((element) => element.setAttribute("ng-style-reused", ""));
306
- }
307
- record.usage++;
308
- } else {
309
- usages.set(value, {
310
- usage: 1,
311
- elements: [...this.hosts].map((host) => this.addElement(host, creator(value, this.doc)))
312
- });
313
- }
314
- }
315
- removeUsage(value, usages) {
316
- const record = usages.get(value);
317
- if (record) {
318
- record.usage--;
319
- if (record.usage <= 0) {
320
- removeElements(record.elements);
321
- usages.delete(value);
322
- }
323
- }
324
- }
325
- ngOnDestroy() {
326
- for (const [, {
327
- elements
328
- }] of [...this.inline, ...this.external]) {
329
- removeElements(elements);
330
- }
331
- this.hosts.clear();
332
- }
333
- /**
334
- * Adds a host node to the set of style hosts and adds all existing style usage to
335
- * the newly added host node.
336
- *
337
- * This is currently only used for Shadow DOM encapsulation mode.
338
- */
339
- addHost(hostNode) {
340
- this.hosts.add(hostNode);
341
- for (const [style, {
342
- elements
343
- }] of this.inline) {
344
- elements.push(this.addElement(hostNode, createStyleElement(style, this.doc)));
345
- }
346
- for (const [url, {
347
- elements
348
- }] of this.external) {
349
- elements.push(this.addElement(hostNode, createLinkElement(url, this.doc)));
350
- }
351
- }
352
- removeHost(hostNode) {
353
- this.hosts.delete(hostNode);
354
- }
355
- addElement(host, element) {
356
- if (this.nonce) {
357
- element.setAttribute("nonce", this.nonce);
358
- }
359
- if (false) {
360
- element.setAttribute(APP_ID_ATTRIBUTE_NAME, this.appId);
361
- }
362
- return host.appendChild(element);
363
- }
364
- static ɵfac = function SharedStylesHost_Factory(__ngFactoryType__) {
365
- return new (__ngFactoryType__ || _SharedStylesHost)(ɵɵinject(DOCUMENT), ɵɵinject(APP_ID), ɵɵinject(CSP_NONCE, 8), ɵɵinject(PLATFORM_ID));
366
- };
367
- static ɵprov = ɵɵdefineInjectable({
368
- token: _SharedStylesHost,
369
- factory: _SharedStylesHost.ɵfac
370
- });
371
- };
372
- (() => {
373
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SharedStylesHost, [{
374
- type: Injectable
375
- }], () => [{
376
- type: Document,
377
- decorators: [{
378
- type: Inject,
379
- args: [DOCUMENT]
380
- }]
381
- }, {
382
- type: void 0,
383
- decorators: [{
384
- type: Inject,
385
- args: [APP_ID]
386
- }]
387
- }, {
388
- type: void 0,
389
- decorators: [{
390
- type: Inject,
391
- args: [CSP_NONCE]
392
- }, {
393
- type: Optional
394
- }]
395
- }, {
396
- type: void 0,
397
- decorators: [{
398
- type: Inject,
399
- args: [PLATFORM_ID]
400
- }]
401
- }], null);
402
- })();
403
- var NAMESPACE_URIS = {
404
- "svg": "http://www.w3.org/2000/svg",
405
- "xhtml": "http://www.w3.org/1999/xhtml",
406
- "xlink": "http://www.w3.org/1999/xlink",
407
- "xml": "http://www.w3.org/XML/1998/namespace",
408
- "xmlns": "http://www.w3.org/2000/xmlns/",
409
- "math": "http://www.w3.org/1998/Math/MathML"
410
- };
411
- var COMPONENT_REGEX = /%COMP%/g;
412
- var SOURCEMAP_URL_REGEXP = /\/\*#\s*sourceMappingURL=(.+?)\s*\*\//;
413
- var PROTOCOL_REGEXP = /^https?:/;
414
- var COMPONENT_VARIABLE = "%COMP%";
415
- var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
416
- var CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
417
- var REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT = true;
418
- var REMOVE_STYLES_ON_COMPONENT_DESTROY = new InjectionToken(ngDevMode ? "RemoveStylesOnCompDestroy" : "", {
419
- providedIn: "root",
420
- factory: () => REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT
421
- });
422
- function shimContentAttribute(componentShortId) {
423
- return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);
424
- }
425
- function shimHostAttribute(componentShortId) {
426
- return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);
427
- }
428
- function shimStylesContent(compId, styles) {
429
- return styles.map((s) => s.replace(COMPONENT_REGEX, compId));
430
- }
431
- function addBaseHrefToCssSourceMap(baseHref, styles) {
432
- if (!baseHref) {
433
- return styles;
434
- }
435
- const absoluteBaseHrefUrl = new URL(baseHref, "http://localhost");
436
- return styles.map((cssContent) => {
437
- if (!cssContent.includes("sourceMappingURL=")) {
438
- return cssContent;
439
- }
440
- return cssContent.replace(SOURCEMAP_URL_REGEXP, (_, sourceMapUrl) => {
441
- if (sourceMapUrl[0] === "/" || sourceMapUrl.startsWith("data:") || PROTOCOL_REGEXP.test(sourceMapUrl)) {
442
- return `/*# sourceMappingURL=${sourceMapUrl} */`;
443
- }
444
- const {
445
- pathname: resolvedSourceMapUrl
446
- } = new URL(sourceMapUrl, absoluteBaseHrefUrl);
447
- return `/*# sourceMappingURL=${resolvedSourceMapUrl} */`;
448
- });
449
- });
450
- }
451
- var DomRendererFactory2 = class _DomRendererFactory2 {
452
- eventManager;
453
- sharedStylesHost;
454
- appId;
455
- removeStylesOnCompDestroy;
456
- doc;
457
- platformId;
458
- ngZone;
459
- nonce;
460
- tracingService;
461
- rendererByCompId = /* @__PURE__ */ new Map();
462
- defaultRenderer;
463
- platformIsServer;
464
- constructor(eventManager, sharedStylesHost, appId, removeStylesOnCompDestroy, doc, platformId, ngZone, nonce = null, tracingService = null) {
465
- this.eventManager = eventManager;
466
- this.sharedStylesHost = sharedStylesHost;
467
- this.appId = appId;
468
- this.removeStylesOnCompDestroy = removeStylesOnCompDestroy;
469
- this.doc = doc;
470
- this.platformId = platformId;
471
- this.ngZone = ngZone;
472
- this.nonce = nonce;
473
- this.tracingService = tracingService;
474
- this.platformIsServer = false;
475
- this.defaultRenderer = new DefaultDomRenderer2(eventManager, doc, ngZone, this.platformIsServer, this.tracingService);
476
- }
477
- createRenderer(element, type) {
478
- if (!element || !type) {
479
- return this.defaultRenderer;
480
- }
481
- if (false) {
482
- type = __spreadProps(__spreadValues({}, type), {
483
- encapsulation: ViewEncapsulation.Emulated
484
- });
485
- }
486
- const renderer = this.getOrCreateRenderer(element, type);
487
- if (renderer instanceof EmulatedEncapsulationDomRenderer2) {
488
- renderer.applyToHost(element);
489
- } else if (renderer instanceof NoneEncapsulationDomRenderer) {
490
- renderer.applyStyles();
491
- }
492
- return renderer;
493
- }
494
- getOrCreateRenderer(element, type) {
495
- const rendererByCompId = this.rendererByCompId;
496
- let renderer = rendererByCompId.get(type.id);
497
- if (!renderer) {
498
- const doc = this.doc;
499
- const ngZone = this.ngZone;
500
- const eventManager = this.eventManager;
501
- const sharedStylesHost = this.sharedStylesHost;
502
- const removeStylesOnCompDestroy = this.removeStylesOnCompDestroy;
503
- const platformIsServer = this.platformIsServer;
504
- const tracingService = this.tracingService;
505
- switch (type.encapsulation) {
506
- case ViewEncapsulation.Emulated:
507
- renderer = new EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, type, this.appId, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService);
508
- break;
509
- case ViewEncapsulation.ShadowDom:
510
- return new ShadowDomRenderer(eventManager, sharedStylesHost, element, type, doc, ngZone, this.nonce, platformIsServer, tracingService);
511
- default:
512
- renderer = new NoneEncapsulationDomRenderer(eventManager, sharedStylesHost, type, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService);
513
- break;
514
- }
515
- rendererByCompId.set(type.id, renderer);
516
- }
517
- return renderer;
518
- }
519
- ngOnDestroy() {
520
- this.rendererByCompId.clear();
521
- }
522
- /**
523
- * Used during HMR to clear any cached data about a component.
524
- * @param componentId ID of the component that is being replaced.
525
- */
526
- componentReplaced(componentId) {
527
- this.rendererByCompId.delete(componentId);
528
- }
529
- static ɵfac = function DomRendererFactory2_Factory(__ngFactoryType__) {
530
- return new (__ngFactoryType__ || _DomRendererFactory2)(ɵɵinject(EventManager), ɵɵinject(SharedStylesHost), ɵɵinject(APP_ID), ɵɵinject(REMOVE_STYLES_ON_COMPONENT_DESTROY), ɵɵinject(DOCUMENT), ɵɵinject(PLATFORM_ID), ɵɵinject(NgZone), ɵɵinject(CSP_NONCE), ɵɵinject(TracingService, 8));
531
- };
532
- static ɵprov = ɵɵdefineInjectable({
533
- token: _DomRendererFactory2,
534
- factory: _DomRendererFactory2.ɵfac
535
- });
536
- };
537
- (() => {
538
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DomRendererFactory2, [{
539
- type: Injectable
540
- }], () => [{
541
- type: EventManager
542
- }, {
543
- type: SharedStylesHost
544
- }, {
545
- type: void 0,
546
- decorators: [{
547
- type: Inject,
548
- args: [APP_ID]
549
- }]
550
- }, {
551
- type: void 0,
552
- decorators: [{
553
- type: Inject,
554
- args: [REMOVE_STYLES_ON_COMPONENT_DESTROY]
555
- }]
556
- }, {
557
- type: Document,
558
- decorators: [{
559
- type: Inject,
560
- args: [DOCUMENT]
561
- }]
562
- }, {
563
- type: Object,
564
- decorators: [{
565
- type: Inject,
566
- args: [PLATFORM_ID]
567
- }]
568
- }, {
569
- type: NgZone
570
- }, {
571
- type: void 0,
572
- decorators: [{
573
- type: Inject,
574
- args: [CSP_NONCE]
575
- }]
576
- }, {
577
- type: TracingService,
578
- decorators: [{
579
- type: Inject,
580
- args: [TracingService]
581
- }, {
582
- type: Optional
583
- }]
584
- }], null);
585
- })();
586
- var DefaultDomRenderer2 = class {
587
- eventManager;
588
- doc;
589
- ngZone;
590
- platformIsServer;
591
- tracingService;
592
- data = /* @__PURE__ */ Object.create(null);
593
- /**
594
- * By default this renderer throws when encountering synthetic properties
595
- * This can be disabled for example by the AsyncAnimationRendererFactory
596
- */
597
- throwOnSyntheticProps = true;
598
- constructor(eventManager, doc, ngZone, platformIsServer, tracingService) {
599
- this.eventManager = eventManager;
600
- this.doc = doc;
601
- this.ngZone = ngZone;
602
- this.platformIsServer = platformIsServer;
603
- this.tracingService = tracingService;
604
- }
605
- destroy() {
606
- }
607
- destroyNode = null;
608
- createElement(name, namespace) {
609
- if (namespace) {
610
- return this.doc.createElementNS(NAMESPACE_URIS[namespace] || namespace, name);
611
- }
612
- return this.doc.createElement(name);
613
- }
614
- createComment(value) {
615
- return this.doc.createComment(value);
616
- }
617
- createText(value) {
618
- return this.doc.createTextNode(value);
619
- }
620
- appendChild(parent, newChild) {
621
- const targetParent = isTemplateNode(parent) ? parent.content : parent;
622
- targetParent.appendChild(newChild);
623
- }
624
- insertBefore(parent, newChild, refChild) {
625
- if (parent) {
626
- const targetParent = isTemplateNode(parent) ? parent.content : parent;
627
- targetParent.insertBefore(newChild, refChild);
628
- }
629
- }
630
- removeChild(_parent, oldChild) {
631
- oldChild.remove();
632
- }
633
- selectRootElement(selectorOrNode, preserveContent) {
634
- let el = typeof selectorOrNode === "string" ? this.doc.querySelector(selectorOrNode) : selectorOrNode;
635
- if (!el) {
636
- throw new RuntimeError(-5104, (typeof ngDevMode === "undefined" || ngDevMode) && `The selector "${selectorOrNode}" did not match any elements`);
637
- }
638
- if (!preserveContent) {
639
- el.textContent = "";
640
- }
641
- return el;
642
- }
643
- parentNode(node) {
644
- return node.parentNode;
645
- }
646
- nextSibling(node) {
647
- return node.nextSibling;
648
- }
649
- setAttribute(el, name, value, namespace) {
650
- if (namespace) {
651
- name = namespace + ":" + name;
652
- const namespaceUri = NAMESPACE_URIS[namespace];
653
- if (namespaceUri) {
654
- el.setAttributeNS(namespaceUri, name, value);
655
- } else {
656
- el.setAttribute(name, value);
657
- }
658
- } else {
659
- el.setAttribute(name, value);
660
- }
661
- }
662
- removeAttribute(el, name, namespace) {
663
- if (namespace) {
664
- const namespaceUri = NAMESPACE_URIS[namespace];
665
- if (namespaceUri) {
666
- el.removeAttributeNS(namespaceUri, name);
667
- } else {
668
- el.removeAttribute(`${namespace}:${name}`);
669
- }
670
- } else {
671
- el.removeAttribute(name);
672
- }
673
- }
674
- addClass(el, name) {
675
- el.classList.add(name);
676
- }
677
- removeClass(el, name) {
678
- el.classList.remove(name);
679
- }
680
- setStyle(el, style, value, flags) {
681
- if (flags & (RendererStyleFlags2.DashCase | RendererStyleFlags2.Important)) {
682
- el.style.setProperty(style, value, flags & RendererStyleFlags2.Important ? "important" : "");
683
- } else {
684
- el.style[style] = value;
685
- }
686
- }
687
- removeStyle(el, style, flags) {
688
- if (flags & RendererStyleFlags2.DashCase) {
689
- el.style.removeProperty(style);
690
- } else {
691
- el.style[style] = "";
692
- }
693
- }
694
- setProperty(el, name, value) {
695
- if (el == null) {
696
- return;
697
- }
698
- (typeof ngDevMode === "undefined" || ngDevMode) && this.throwOnSyntheticProps && checkNoSyntheticProp(name, "property");
699
- el[name] = value;
700
- }
701
- setValue(node, value) {
702
- node.nodeValue = value;
703
- }
704
- listen(target, event, callback, options) {
705
- (typeof ngDevMode === "undefined" || ngDevMode) && this.throwOnSyntheticProps && checkNoSyntheticProp(event, "listener");
706
- if (typeof target === "string") {
707
- target = getDOM().getGlobalEventTarget(this.doc, target);
708
- if (!target) {
709
- throw new RuntimeError(5102, (typeof ngDevMode === "undefined" || ngDevMode) && `Unsupported event target ${target} for event ${event}`);
710
- }
711
- }
712
- let wrappedCallback = this.decoratePreventDefault(callback);
713
- if (this.tracingService?.wrapEventListener) {
714
- wrappedCallback = this.tracingService.wrapEventListener(target, event, wrappedCallback);
715
- }
716
- return this.eventManager.addEventListener(target, event, wrappedCallback, options);
717
- }
718
- decoratePreventDefault(eventHandler) {
719
- return (event) => {
720
- if (event === "__ngUnwrap__") {
721
- return eventHandler;
722
- }
723
- const allowDefaultBehavior = false ? this.ngZone.runGuarded(() => eventHandler(event)) : eventHandler(event);
724
- if (allowDefaultBehavior === false) {
725
- event.preventDefault();
726
- }
727
- return void 0;
728
- };
729
- }
730
- };
731
- var AT_CHARCODE = (() => "@".charCodeAt(0))();
732
- function checkNoSyntheticProp(name, nameKind) {
733
- if (name.charCodeAt(0) === AT_CHARCODE) {
734
- throw new RuntimeError(5105, `Unexpected synthetic ${nameKind} ${name} found. Please make sure that:
735
- - Make sure \`provideAnimationsAsync()\`, \`provideAnimations()\` or \`provideNoopAnimations()\` call was added to a list of providers used to bootstrap an application.
736
- - There is a corresponding animation configuration named \`${name}\` defined in the \`animations\` field of the \`@Component\` decorator (see https://angular.dev/api/core/Component#animations).`);
737
- }
738
- }
739
- function isTemplateNode(node) {
740
- return node.tagName === "TEMPLATE" && node.content !== void 0;
741
- }
742
- var ShadowDomRenderer = class extends DefaultDomRenderer2 {
743
- sharedStylesHost;
744
- hostEl;
745
- shadowRoot;
746
- constructor(eventManager, sharedStylesHost, hostEl, component, doc, ngZone, nonce, platformIsServer, tracingService) {
747
- super(eventManager, doc, ngZone, platformIsServer, tracingService);
748
- this.sharedStylesHost = sharedStylesHost;
749
- this.hostEl = hostEl;
750
- this.shadowRoot = hostEl.attachShadow({
751
- mode: "open"
752
- });
753
- this.sharedStylesHost.addHost(this.shadowRoot);
754
- let styles = component.styles;
755
- if (ngDevMode) {
756
- const baseHref = getDOM().getBaseHref(doc) ?? "";
757
- styles = addBaseHrefToCssSourceMap(baseHref, styles);
758
- }
759
- styles = shimStylesContent(component.id, styles);
760
- for (const style of styles) {
761
- const styleEl = document.createElement("style");
762
- if (nonce) {
763
- styleEl.setAttribute("nonce", nonce);
764
- }
765
- styleEl.textContent = style;
766
- this.shadowRoot.appendChild(styleEl);
767
- }
768
- const styleUrls = component.getExternalStyles?.();
769
- if (styleUrls) {
770
- for (const styleUrl of styleUrls) {
771
- const linkEl = createLinkElement(styleUrl, doc);
772
- if (nonce) {
773
- linkEl.setAttribute("nonce", nonce);
774
- }
775
- this.shadowRoot.appendChild(linkEl);
776
- }
777
- }
778
- }
779
- nodeOrShadowRoot(node) {
780
- return node === this.hostEl ? this.shadowRoot : node;
781
- }
782
- appendChild(parent, newChild) {
783
- return super.appendChild(this.nodeOrShadowRoot(parent), newChild);
784
- }
785
- insertBefore(parent, newChild, refChild) {
786
- return super.insertBefore(this.nodeOrShadowRoot(parent), newChild, refChild);
787
- }
788
- removeChild(_parent, oldChild) {
789
- return super.removeChild(null, oldChild);
790
- }
791
- parentNode(node) {
792
- return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(node)));
793
- }
794
- destroy() {
795
- this.sharedStylesHost.removeHost(this.shadowRoot);
796
- }
797
- };
798
- var NoneEncapsulationDomRenderer = class extends DefaultDomRenderer2 {
799
- sharedStylesHost;
800
- removeStylesOnCompDestroy;
801
- styles;
802
- styleUrls;
803
- constructor(eventManager, sharedStylesHost, component, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService, compId) {
804
- super(eventManager, doc, ngZone, platformIsServer, tracingService);
805
- this.sharedStylesHost = sharedStylesHost;
806
- this.removeStylesOnCompDestroy = removeStylesOnCompDestroy;
807
- let styles = component.styles;
808
- if (ngDevMode) {
809
- const baseHref = getDOM().getBaseHref(doc) ?? "";
810
- styles = addBaseHrefToCssSourceMap(baseHref, styles);
811
- }
812
- this.styles = compId ? shimStylesContent(compId, styles) : styles;
813
- this.styleUrls = component.getExternalStyles?.(compId);
814
- }
815
- applyStyles() {
816
- this.sharedStylesHost.addStyles(this.styles, this.styleUrls);
817
- }
818
- destroy() {
819
- if (!this.removeStylesOnCompDestroy) {
820
- return;
821
- }
822
- if (allLeavingAnimations.size === 0) {
823
- this.sharedStylesHost.removeStyles(this.styles, this.styleUrls);
824
- }
825
- }
826
- };
827
- var EmulatedEncapsulationDomRenderer2 = class extends NoneEncapsulationDomRenderer {
828
- contentAttr;
829
- hostAttr;
830
- constructor(eventManager, sharedStylesHost, component, appId, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService) {
831
- const compId = appId + "-" + component.id;
832
- super(eventManager, sharedStylesHost, component, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService, compId);
833
- this.contentAttr = shimContentAttribute(compId);
834
- this.hostAttr = shimHostAttribute(compId);
835
- }
836
- applyToHost(element) {
837
- this.applyStyles();
838
- this.setAttribute(element, this.hostAttr, "");
839
- }
840
- createElement(parent, name) {
841
- const el = super.createElement(parent, name);
842
- super.setAttribute(el, this.contentAttr, "");
843
- return el;
844
- }
845
- };
846
-
847
- // node_modules/@angular/platform-browser/fesm2022/browser.mjs
848
- var BrowserDomAdapter = class _BrowserDomAdapter extends DomAdapter {
849
- supportsDOMEvents = true;
850
- static makeCurrent() {
851
- setRootDomAdapter(new _BrowserDomAdapter());
852
- }
853
- onAndCancel(el, evt, listener, options) {
854
- el.addEventListener(evt, listener, options);
855
- return () => {
856
- el.removeEventListener(evt, listener, options);
857
- };
858
- }
859
- dispatchEvent(el, evt) {
860
- el.dispatchEvent(evt);
861
- }
862
- remove(node) {
863
- node.remove();
864
- }
865
- createElement(tagName, doc) {
866
- doc = doc || this.getDefaultDocument();
867
- return doc.createElement(tagName);
868
- }
869
- createHtmlDocument() {
870
- return document.implementation.createHTMLDocument("fakeTitle");
871
- }
872
- getDefaultDocument() {
873
- return document;
874
- }
875
- isElementNode(node) {
876
- return node.nodeType === Node.ELEMENT_NODE;
877
- }
878
- isShadowRoot(node) {
879
- return node instanceof DocumentFragment;
880
- }
881
- /** @deprecated No longer being used in Ivy code. To be removed in version 14. */
882
- getGlobalEventTarget(doc, target) {
883
- if (target === "window") {
884
- return window;
885
- }
886
- if (target === "document") {
887
- return doc;
888
- }
889
- if (target === "body") {
890
- return doc.body;
891
- }
892
- return null;
893
- }
894
- getBaseHref(doc) {
895
- const href = getBaseElementHref();
896
- return href == null ? null : relativePath(href);
897
- }
898
- resetBaseElement() {
899
- baseElement = null;
900
- }
901
- getUserAgent() {
902
- return window.navigator.userAgent;
903
- }
904
- getCookie(name) {
905
- return parseCookieValue(document.cookie, name);
906
- }
907
- };
908
- var baseElement = null;
909
- function getBaseElementHref() {
910
- baseElement = baseElement || document.head.querySelector("base");
911
- return baseElement ? baseElement.getAttribute("href") : null;
912
- }
913
- function relativePath(url) {
914
- return new URL(url, document.baseURI).pathname;
915
- }
916
- var BrowserGetTestability = class {
917
- addToWindow(registry) {
918
- _global["getAngularTestability"] = (elem, findInAncestors = true) => {
919
- const testability = registry.findTestabilityInTree(elem, findInAncestors);
920
- if (testability == null) {
921
- throw new RuntimeError(5103, (typeof ngDevMode === "undefined" || ngDevMode) && "Could not find testability for element.");
922
- }
923
- return testability;
924
- };
925
- _global["getAllAngularTestabilities"] = () => registry.getAllTestabilities();
926
- _global["getAllAngularRootElements"] = () => registry.getAllRootElements();
927
- const whenAllStable = (callback) => {
928
- const testabilities = _global["getAllAngularTestabilities"]();
929
- let count = testabilities.length;
930
- const decrement = function() {
931
- count--;
932
- if (count == 0) {
933
- callback();
934
- }
935
- };
936
- testabilities.forEach((testability) => {
937
- testability.whenStable(decrement);
938
- });
939
- };
940
- if (!_global["frameworkStabilizers"]) {
941
- _global["frameworkStabilizers"] = [];
942
- }
943
- _global["frameworkStabilizers"].push(whenAllStable);
944
- }
945
- findTestabilityInTree(registry, elem, findInAncestors) {
946
- if (elem == null) {
947
- return null;
948
- }
949
- const t = registry.getTestability(elem);
950
- if (t != null) {
951
- return t;
952
- } else if (!findInAncestors) {
953
- return null;
954
- }
955
- if (getDOM().isShadowRoot(elem)) {
956
- return this.findTestabilityInTree(registry, elem.host, true);
957
- }
958
- return this.findTestabilityInTree(registry, elem.parentElement, true);
959
- }
960
- };
961
- var BrowserXhr = class _BrowserXhr {
962
- build() {
963
- return new XMLHttpRequest();
964
- }
965
- static ɵfac = function BrowserXhr_Factory(__ngFactoryType__) {
966
- return new (__ngFactoryType__ || _BrowserXhr)();
967
- };
968
- static ɵprov = ɵɵdefineInjectable({
969
- token: _BrowserXhr,
970
- factory: _BrowserXhr.ɵfac
971
- });
972
- };
973
- (() => {
974
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BrowserXhr, [{
975
- type: Injectable
976
- }], null, null);
977
- })();
978
- var MODIFIER_KEYS = ["alt", "control", "meta", "shift"];
979
- var _keyMap = {
980
- "\b": "Backspace",
981
- " ": "Tab",
982
- "": "Delete",
983
- "\x1B": "Escape",
984
- "Del": "Delete",
985
- "Esc": "Escape",
986
- "Left": "ArrowLeft",
987
- "Right": "ArrowRight",
988
- "Up": "ArrowUp",
989
- "Down": "ArrowDown",
990
- "Menu": "ContextMenu",
991
- "Scroll": "ScrollLock",
992
- "Win": "OS"
993
- };
994
- var MODIFIER_KEY_GETTERS = {
995
- "alt": (event) => event.altKey,
996
- "control": (event) => event.ctrlKey,
997
- "meta": (event) => event.metaKey,
998
- "shift": (event) => event.shiftKey
999
- };
1000
- var KeyEventsPlugin = class _KeyEventsPlugin extends EventManagerPlugin {
1001
- /**
1002
- * Initializes an instance of the browser plug-in.
1003
- * @param doc The document in which key events will be detected.
1004
- */
1005
- constructor(doc) {
1006
- super(doc);
1007
- }
1008
- /**
1009
- * Reports whether a named key event is supported.
1010
- * @param eventName The event name to query.
1011
- * @return True if the named key event is supported.
1012
- */
1013
- supports(eventName) {
1014
- return _KeyEventsPlugin.parseEventName(eventName) != null;
1015
- }
1016
- /**
1017
- * Registers a handler for a specific element and key event.
1018
- * @param element The HTML element to receive event notifications.
1019
- * @param eventName The name of the key event to listen for.
1020
- * @param handler A function to call when the notification occurs. Receives the
1021
- * event object as an argument.
1022
- * @returns The key event that was registered.
1023
- */
1024
- addEventListener(element, eventName, handler, options) {
1025
- const parsedEvent = _KeyEventsPlugin.parseEventName(eventName);
1026
- const outsideHandler = _KeyEventsPlugin.eventCallback(parsedEvent["fullKey"], handler, this.manager.getZone());
1027
- return this.manager.getZone().runOutsideAngular(() => {
1028
- return getDOM().onAndCancel(element, parsedEvent["domEventName"], outsideHandler, options);
1029
- });
1030
- }
1031
- /**
1032
- * Parses the user provided full keyboard event definition and normalizes it for
1033
- * later internal use. It ensures the string is all lowercase, converts special
1034
- * characters to a standard spelling, and orders all the values consistently.
1035
- *
1036
- * @param eventName The name of the key event to listen for.
1037
- * @returns an object with the full, normalized string, and the dom event name
1038
- * or null in the case when the event doesn't match a keyboard event.
1039
- */
1040
- static parseEventName(eventName) {
1041
- const parts = eventName.toLowerCase().split(".");
1042
- const domEventName = parts.shift();
1043
- if (parts.length === 0 || !(domEventName === "keydown" || domEventName === "keyup")) {
1044
- return null;
1045
- }
1046
- const key = _KeyEventsPlugin._normalizeKey(parts.pop());
1047
- let fullKey = "";
1048
- let codeIX = parts.indexOf("code");
1049
- if (codeIX > -1) {
1050
- parts.splice(codeIX, 1);
1051
- fullKey = "code.";
1052
- }
1053
- MODIFIER_KEYS.forEach((modifierName) => {
1054
- const index = parts.indexOf(modifierName);
1055
- if (index > -1) {
1056
- parts.splice(index, 1);
1057
- fullKey += modifierName + ".";
1058
- }
1059
- });
1060
- fullKey += key;
1061
- if (parts.length != 0 || key.length === 0) {
1062
- return null;
1063
- }
1064
- const result = {};
1065
- result["domEventName"] = domEventName;
1066
- result["fullKey"] = fullKey;
1067
- return result;
1068
- }
1069
- /**
1070
- * Determines whether the actual keys pressed match the configured key code string.
1071
- * The `fullKeyCode` event is normalized in the `parseEventName` method when the
1072
- * event is attached to the DOM during the `addEventListener` call. This is unseen
1073
- * by the end user and is normalized for internal consistency and parsing.
1074
- *
1075
- * @param event The keyboard event.
1076
- * @param fullKeyCode The normalized user defined expected key event string
1077
- * @returns boolean.
1078
- */
1079
- static matchEventFullKeyCode(event, fullKeyCode) {
1080
- let keycode = _keyMap[event.key] || event.key;
1081
- let key = "";
1082
- if (fullKeyCode.indexOf("code.") > -1) {
1083
- keycode = event.code;
1084
- key = "code.";
1085
- }
1086
- if (keycode == null || !keycode) return false;
1087
- keycode = keycode.toLowerCase();
1088
- if (keycode === " ") {
1089
- keycode = "space";
1090
- } else if (keycode === ".") {
1091
- keycode = "dot";
1092
- }
1093
- MODIFIER_KEYS.forEach((modifierName) => {
1094
- if (modifierName !== keycode) {
1095
- const modifierGetter = MODIFIER_KEY_GETTERS[modifierName];
1096
- if (modifierGetter(event)) {
1097
- key += modifierName + ".";
1098
- }
1099
- }
1100
- });
1101
- key += keycode;
1102
- return key === fullKeyCode;
1103
- }
1104
- /**
1105
- * Configures a handler callback for a key event.
1106
- * @param fullKey The event name that combines all simultaneous keystrokes.
1107
- * @param handler The function that responds to the key event.
1108
- * @param zone The zone in which the event occurred.
1109
- * @returns A callback function.
1110
- */
1111
- static eventCallback(fullKey, handler, zone) {
1112
- return (event) => {
1113
- if (_KeyEventsPlugin.matchEventFullKeyCode(event, fullKey)) {
1114
- zone.runGuarded(() => handler(event));
1115
- }
1116
- };
1117
- }
1118
- /** @internal */
1119
- static _normalizeKey(keyName) {
1120
- return keyName === "esc" ? "escape" : keyName;
1121
- }
1122
- static ɵfac = function KeyEventsPlugin_Factory(__ngFactoryType__) {
1123
- return new (__ngFactoryType__ || _KeyEventsPlugin)(ɵɵinject(DOCUMENT));
1124
- };
1125
- static ɵprov = ɵɵdefineInjectable({
1126
- token: _KeyEventsPlugin,
1127
- factory: _KeyEventsPlugin.ɵfac
1128
- });
1129
- };
1130
- (() => {
1131
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(KeyEventsPlugin, [{
1132
- type: Injectable
1133
- }], () => [{
1134
- type: void 0,
1135
- decorators: [{
1136
- type: Inject,
1137
- args: [DOCUMENT]
1138
- }]
1139
- }], null);
1140
- })();
1141
- function bootstrapApplication(rootComponent, options, context) {
1142
- const config = __spreadValues({
1143
- rootComponent,
1144
- platformRef: context?.platformRef
1145
- }, createProvidersConfig(options));
1146
- if (false) {
1147
- return resolveComponentResources(fetch).catch((error) => {
1148
- console.error(error);
1149
- return Promise.resolve();
1150
- }).then(() => internalCreateApplication(config));
1151
- }
1152
- return internalCreateApplication(config);
1153
- }
1154
- function createApplication(options) {
1155
- return internalCreateApplication(createProvidersConfig(options));
1156
- }
1157
- function createProvidersConfig(options) {
1158
- return {
1159
- appProviders: [...BROWSER_MODULE_PROVIDERS, ...options?.providers ?? []],
1160
- platformProviders: INTERNAL_BROWSER_PLATFORM_PROVIDERS
1161
- };
1162
- }
1163
- function provideProtractorTestingSupport() {
1164
- return [...TESTABILITY_PROVIDERS];
1165
- }
1166
- function initDomAdapter() {
1167
- BrowserDomAdapter.makeCurrent();
1168
- }
1169
- function errorHandler() {
1170
- return new ErrorHandler();
1171
- }
1172
- function _document() {
1173
- setDocument(document);
1174
- return document;
1175
- }
1176
- var INTERNAL_BROWSER_PLATFORM_PROVIDERS = [{
1177
- provide: PLATFORM_ID,
1178
- useValue: PLATFORM_BROWSER_ID
1179
- }, {
1180
- provide: PLATFORM_INITIALIZER,
1181
- useValue: initDomAdapter,
1182
- multi: true
1183
- }, {
1184
- provide: DOCUMENT,
1185
- useFactory: _document
1186
- }];
1187
- var platformBrowser = createPlatformFactory(platformCore, "browser", INTERNAL_BROWSER_PLATFORM_PROVIDERS);
1188
- var BROWSER_MODULE_PROVIDERS_MARKER = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "BrowserModule Providers Marker" : "");
1189
- var TESTABILITY_PROVIDERS = [{
1190
- provide: TESTABILITY_GETTER,
1191
- useClass: BrowserGetTestability
1192
- }, {
1193
- provide: TESTABILITY,
1194
- useClass: Testability,
1195
- deps: [NgZone, TestabilityRegistry, TESTABILITY_GETTER]
1196
- }, {
1197
- provide: Testability,
1198
- // Also provide as `Testability` for backwards-compatibility.
1199
- useClass: Testability,
1200
- deps: [NgZone, TestabilityRegistry, TESTABILITY_GETTER]
1201
- }];
1202
- var BROWSER_MODULE_PROVIDERS = [{
1203
- provide: INJECTOR_SCOPE,
1204
- useValue: "root"
1205
- }, {
1206
- provide: ErrorHandler,
1207
- useFactory: errorHandler
1208
- }, {
1209
- provide: EVENT_MANAGER_PLUGINS,
1210
- useClass: DomEventsPlugin,
1211
- multi: true,
1212
- deps: [DOCUMENT]
1213
- }, {
1214
- provide: EVENT_MANAGER_PLUGINS,
1215
- useClass: KeyEventsPlugin,
1216
- multi: true,
1217
- deps: [DOCUMENT]
1218
- }, DomRendererFactory2, SharedStylesHost, EventManager, {
1219
- provide: RendererFactory2,
1220
- useExisting: DomRendererFactory2
1221
- }, {
1222
- provide: XhrFactory,
1223
- useClass: BrowserXhr
1224
- }, typeof ngDevMode === "undefined" || ngDevMode ? {
1225
- provide: BROWSER_MODULE_PROVIDERS_MARKER,
1226
- useValue: true
1227
- } : []];
1228
- var BrowserModule = class _BrowserModule {
1229
- constructor() {
1230
- if (typeof ngDevMode === "undefined" || ngDevMode) {
1231
- const providersAlreadyPresent = inject(BROWSER_MODULE_PROVIDERS_MARKER, {
1232
- optional: true,
1233
- skipSelf: true
1234
- });
1235
- if (providersAlreadyPresent) {
1236
- throw new RuntimeError(5100, `Providers from the \`BrowserModule\` have already been loaded. If you need access to common directives such as NgIf and NgFor, import the \`CommonModule\` instead.`);
1237
- }
1238
- }
1239
- }
1240
- static ɵfac = function BrowserModule_Factory(__ngFactoryType__) {
1241
- return new (__ngFactoryType__ || _BrowserModule)();
1242
- };
1243
- static ɵmod = ɵɵdefineNgModule({
1244
- type: _BrowserModule,
1245
- exports: [CommonModule, ApplicationModule]
1246
- });
1247
- static ɵinj = ɵɵdefineInjector({
1248
- providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS],
1249
- imports: [CommonModule, ApplicationModule]
1250
- });
1251
- };
1252
- (() => {
1253
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BrowserModule, [{
1254
- type: NgModule,
1255
- args: [{
1256
- providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS],
1257
- exports: [CommonModule, ApplicationModule]
1258
- }]
1259
- }], () => [], null);
1260
- })();
1261
-
1262
- // node_modules/@angular/common/fesm2022/module.mjs
1263
- var HttpHandler = class {
1264
- };
1265
- var HttpBackend = class {
1266
- };
1267
- var HttpHeaders = class _HttpHeaders {
1268
- /**
1269
- * Internal map of lowercase header names to values.
1270
- */
1271
- headers;
1272
- /**
1273
- * Internal map of lowercased header names to the normalized
1274
- * form of the name (the form seen first).
1275
- */
1276
- normalizedNames = /* @__PURE__ */ new Map();
1277
- /**
1278
- * Complete the lazy initialization of this object (needed before reading).
1279
- */
1280
- lazyInit;
1281
- /**
1282
- * Queued updates to be materialized the next initialization.
1283
- */
1284
- lazyUpdate = null;
1285
- /** Constructs a new HTTP header object with the given values.*/
1286
- constructor(headers) {
1287
- if (!headers) {
1288
- this.headers = /* @__PURE__ */ new Map();
1289
- } else if (typeof headers === "string") {
1290
- this.lazyInit = () => {
1291
- this.headers = /* @__PURE__ */ new Map();
1292
- headers.split("\n").forEach((line) => {
1293
- const index = line.indexOf(":");
1294
- if (index > 0) {
1295
- const name = line.slice(0, index);
1296
- const value = line.slice(index + 1).trim();
1297
- this.addHeaderEntry(name, value);
1298
- }
1299
- });
1300
- };
1301
- } else if (typeof Headers !== "undefined" && headers instanceof Headers) {
1302
- this.headers = /* @__PURE__ */ new Map();
1303
- headers.forEach((value, name) => {
1304
- this.addHeaderEntry(name, value);
1305
- });
1306
- } else {
1307
- this.lazyInit = () => {
1308
- if (typeof ngDevMode === "undefined" || ngDevMode) {
1309
- assertValidHeaders(headers);
1310
- }
1311
- this.headers = /* @__PURE__ */ new Map();
1312
- Object.entries(headers).forEach(([name, values]) => {
1313
- this.setHeaderEntries(name, values);
1314
- });
1315
- };
1316
- }
1317
- }
1318
- /**
1319
- * Checks for existence of a given header.
1320
- *
1321
- * @param name The header name to check for existence.
1322
- *
1323
- * @returns True if the header exists, false otherwise.
1324
- */
1325
- has(name) {
1326
- this.init();
1327
- return this.headers.has(name.toLowerCase());
1328
- }
1329
- /**
1330
- * Retrieves the first value of a given header.
1331
- *
1332
- * @param name The header name.
1333
- *
1334
- * @returns The value string if the header exists, null otherwise
1335
- */
1336
- get(name) {
1337
- this.init();
1338
- const values = this.headers.get(name.toLowerCase());
1339
- return values && values.length > 0 ? values[0] : null;
1340
- }
1341
- /**
1342
- * Retrieves the names of the headers.
1343
- *
1344
- * @returns A list of header names.
1345
- */
1346
- keys() {
1347
- this.init();
1348
- return Array.from(this.normalizedNames.values());
1349
- }
1350
- /**
1351
- * Retrieves a list of values for a given header.
1352
- *
1353
- * @param name The header name from which to retrieve values.
1354
- *
1355
- * @returns A string of values if the header exists, null otherwise.
1356
- */
1357
- getAll(name) {
1358
- this.init();
1359
- return this.headers.get(name.toLowerCase()) || null;
1360
- }
1361
- /**
1362
- * Appends a new value to the existing set of values for a header
1363
- * and returns them in a clone of the original instance.
1364
- *
1365
- * @param name The header name for which to append the values.
1366
- * @param value The value to append.
1367
- *
1368
- * @returns A clone of the HTTP headers object with the value appended to the given header.
1369
- */
1370
- append(name, value) {
1371
- return this.clone({
1372
- name,
1373
- value,
1374
- op: "a"
1375
- });
1376
- }
1377
- /**
1378
- * Sets or modifies a value for a given header in a clone of the original instance.
1379
- * If the header already exists, its value is replaced with the given value
1380
- * in the returned object.
1381
- *
1382
- * @param name The header name.
1383
- * @param value The value or values to set or override for the given header.
1384
- *
1385
- * @returns A clone of the HTTP headers object with the newly set header value.
1386
- */
1387
- set(name, value) {
1388
- return this.clone({
1389
- name,
1390
- value,
1391
- op: "s"
1392
- });
1393
- }
1394
- /**
1395
- * Deletes values for a given header in a clone of the original instance.
1396
- *
1397
- * @param name The header name.
1398
- * @param value The value or values to delete for the given header.
1399
- *
1400
- * @returns A clone of the HTTP headers object with the given value deleted.
1401
- */
1402
- delete(name, value) {
1403
- return this.clone({
1404
- name,
1405
- value,
1406
- op: "d"
1407
- });
1408
- }
1409
- maybeSetNormalizedName(name, lcName) {
1410
- if (!this.normalizedNames.has(lcName)) {
1411
- this.normalizedNames.set(lcName, name);
1412
- }
1413
- }
1414
- init() {
1415
- if (!!this.lazyInit) {
1416
- if (this.lazyInit instanceof _HttpHeaders) {
1417
- this.copyFrom(this.lazyInit);
1418
- } else {
1419
- this.lazyInit();
1420
- }
1421
- this.lazyInit = null;
1422
- if (!!this.lazyUpdate) {
1423
- this.lazyUpdate.forEach((update) => this.applyUpdate(update));
1424
- this.lazyUpdate = null;
1425
- }
1426
- }
1427
- }
1428
- copyFrom(other) {
1429
- other.init();
1430
- Array.from(other.headers.keys()).forEach((key) => {
1431
- this.headers.set(key, other.headers.get(key));
1432
- this.normalizedNames.set(key, other.normalizedNames.get(key));
1433
- });
1434
- }
1435
- clone(update) {
1436
- const clone = new _HttpHeaders();
1437
- clone.lazyInit = !!this.lazyInit && this.lazyInit instanceof _HttpHeaders ? this.lazyInit : this;
1438
- clone.lazyUpdate = (this.lazyUpdate || []).concat([update]);
1439
- return clone;
1440
- }
1441
- applyUpdate(update) {
1442
- const key = update.name.toLowerCase();
1443
- switch (update.op) {
1444
- case "a":
1445
- case "s":
1446
- let value = update.value;
1447
- if (typeof value === "string") {
1448
- value = [value];
1449
- }
1450
- if (value.length === 0) {
1451
- return;
1452
- }
1453
- this.maybeSetNormalizedName(update.name, key);
1454
- const base = (update.op === "a" ? this.headers.get(key) : void 0) || [];
1455
- base.push(...value);
1456
- this.headers.set(key, base);
1457
- break;
1458
- case "d":
1459
- const toDelete = update.value;
1460
- if (!toDelete) {
1461
- this.headers.delete(key);
1462
- this.normalizedNames.delete(key);
1463
- } else {
1464
- let existing = this.headers.get(key);
1465
- if (!existing) {
1466
- return;
1467
- }
1468
- existing = existing.filter((value2) => toDelete.indexOf(value2) === -1);
1469
- if (existing.length === 0) {
1470
- this.headers.delete(key);
1471
- this.normalizedNames.delete(key);
1472
- } else {
1473
- this.headers.set(key, existing);
1474
- }
1475
- }
1476
- break;
1477
- }
1478
- }
1479
- addHeaderEntry(name, value) {
1480
- const key = name.toLowerCase();
1481
- this.maybeSetNormalizedName(name, key);
1482
- if (this.headers.has(key)) {
1483
- this.headers.get(key).push(value);
1484
- } else {
1485
- this.headers.set(key, [value]);
1486
- }
1487
- }
1488
- setHeaderEntries(name, values) {
1489
- const headerValues = (Array.isArray(values) ? values : [values]).map((value) => value.toString());
1490
- const key = name.toLowerCase();
1491
- this.headers.set(key, headerValues);
1492
- this.maybeSetNormalizedName(name, key);
1493
- }
1494
- /**
1495
- * @internal
1496
- */
1497
- forEach(fn) {
1498
- this.init();
1499
- Array.from(this.normalizedNames.keys()).forEach((key) => fn(this.normalizedNames.get(key), this.headers.get(key)));
1500
- }
1501
- };
1502
- function assertValidHeaders(headers) {
1503
- for (const [key, value] of Object.entries(headers)) {
1504
- if (!(typeof value === "string" || typeof value === "number") && !Array.isArray(value)) {
1505
- throw new Error(`Unexpected value of the \`${key}\` header provided. Expecting either a string, a number or an array, but got: \`${value}\`.`);
1506
- }
1507
- }
1508
- }
1509
- var HttpUrlEncodingCodec = class {
1510
- /**
1511
- * Encodes a key name for a URL parameter or query-string.
1512
- * @param key The key name.
1513
- * @returns The encoded key name.
1514
- */
1515
- encodeKey(key) {
1516
- return standardEncoding(key);
1517
- }
1518
- /**
1519
- * Encodes the value of a URL parameter or query-string.
1520
- * @param value The value.
1521
- * @returns The encoded value.
1522
- */
1523
- encodeValue(value) {
1524
- return standardEncoding(value);
1525
- }
1526
- /**
1527
- * Decodes an encoded URL parameter or query-string key.
1528
- * @param key The encoded key name.
1529
- * @returns The decoded key name.
1530
- */
1531
- decodeKey(key) {
1532
- return decodeURIComponent(key);
1533
- }
1534
- /**
1535
- * Decodes an encoded URL parameter or query-string value.
1536
- * @param value The encoded value.
1537
- * @returns The decoded value.
1538
- */
1539
- decodeValue(value) {
1540
- return decodeURIComponent(value);
1541
- }
1542
- };
1543
- function paramParser(rawParams, codec) {
1544
- const map2 = /* @__PURE__ */ new Map();
1545
- if (rawParams.length > 0) {
1546
- const params = rawParams.replace(/^\?/, "").split("&");
1547
- params.forEach((param) => {
1548
- const eqIdx = param.indexOf("=");
1549
- const [key, val] = eqIdx == -1 ? [codec.decodeKey(param), ""] : [codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))];
1550
- const list = map2.get(key) || [];
1551
- list.push(val);
1552
- map2.set(key, list);
1553
- });
1554
- }
1555
- return map2;
1556
- }
1557
- var STANDARD_ENCODING_REGEX = /%(\d[a-f0-9])/gi;
1558
- var STANDARD_ENCODING_REPLACEMENTS = {
1559
- "40": "@",
1560
- "3A": ":",
1561
- "24": "$",
1562
- "2C": ",",
1563
- "3B": ";",
1564
- "3D": "=",
1565
- "3F": "?",
1566
- "2F": "/"
1567
- };
1568
- function standardEncoding(v) {
1569
- return encodeURIComponent(v).replace(STANDARD_ENCODING_REGEX, (s, t) => STANDARD_ENCODING_REPLACEMENTS[t] ?? s);
1570
- }
1571
- function valueToString(value) {
1572
- return `${value}`;
1573
- }
1574
- var HttpParams = class _HttpParams {
1575
- map;
1576
- encoder;
1577
- updates = null;
1578
- cloneFrom = null;
1579
- constructor(options = {}) {
1580
- this.encoder = options.encoder || new HttpUrlEncodingCodec();
1581
- if (options.fromString) {
1582
- if (options.fromObject) {
1583
- throw new RuntimeError(2805, ngDevMode && "Cannot specify both fromString and fromObject.");
1584
- }
1585
- this.map = paramParser(options.fromString, this.encoder);
1586
- } else if (!!options.fromObject) {
1587
- this.map = /* @__PURE__ */ new Map();
1588
- Object.keys(options.fromObject).forEach((key) => {
1589
- const value = options.fromObject[key];
1590
- const values = Array.isArray(value) ? value.map(valueToString) : [valueToString(value)];
1591
- this.map.set(key, values);
1592
- });
1593
- } else {
1594
- this.map = null;
1595
- }
1596
- }
1597
- /**
1598
- * Reports whether the body includes one or more values for a given parameter.
1599
- * @param param The parameter name.
1600
- * @returns True if the parameter has one or more values,
1601
- * false if it has no value or is not present.
1602
- */
1603
- has(param) {
1604
- this.init();
1605
- return this.map.has(param);
1606
- }
1607
- /**
1608
- * Retrieves the first value for a parameter.
1609
- * @param param The parameter name.
1610
- * @returns The first value of the given parameter,
1611
- * or `null` if the parameter is not present.
1612
- */
1613
- get(param) {
1614
- this.init();
1615
- const res = this.map.get(param);
1616
- return !!res ? res[0] : null;
1617
- }
1618
- /**
1619
- * Retrieves all values for a parameter.
1620
- * @param param The parameter name.
1621
- * @returns All values in a string array,
1622
- * or `null` if the parameter not present.
1623
- */
1624
- getAll(param) {
1625
- this.init();
1626
- return this.map.get(param) || null;
1627
- }
1628
- /**
1629
- * Retrieves all the parameters for this body.
1630
- * @returns The parameter names in a string array.
1631
- */
1632
- keys() {
1633
- this.init();
1634
- return Array.from(this.map.keys());
1635
- }
1636
- /**
1637
- * Appends a new value to existing values for a parameter.
1638
- * @param param The parameter name.
1639
- * @param value The new value to add.
1640
- * @return A new body with the appended value.
1641
- */
1642
- append(param, value) {
1643
- return this.clone({
1644
- param,
1645
- value,
1646
- op: "a"
1647
- });
1648
- }
1649
- /**
1650
- * Constructs a new body with appended values for the given parameter name.
1651
- * @param params parameters and values
1652
- * @return A new body with the new value.
1653
- */
1654
- appendAll(params) {
1655
- const updates = [];
1656
- Object.keys(params).forEach((param) => {
1657
- const value = params[param];
1658
- if (Array.isArray(value)) {
1659
- value.forEach((_value) => {
1660
- updates.push({
1661
- param,
1662
- value: _value,
1663
- op: "a"
1664
- });
1665
- });
1666
- } else {
1667
- updates.push({
1668
- param,
1669
- value,
1670
- op: "a"
1671
- });
1672
- }
1673
- });
1674
- return this.clone(updates);
1675
- }
1676
- /**
1677
- * Replaces the value for a parameter.
1678
- * @param param The parameter name.
1679
- * @param value The new value.
1680
- * @return A new body with the new value.
1681
- */
1682
- set(param, value) {
1683
- return this.clone({
1684
- param,
1685
- value,
1686
- op: "s"
1687
- });
1688
- }
1689
- /**
1690
- * Removes a given value or all values from a parameter.
1691
- * @param param The parameter name.
1692
- * @param value The value to remove, if provided.
1693
- * @return A new body with the given value removed, or with all values
1694
- * removed if no value is specified.
1695
- */
1696
- delete(param, value) {
1697
- return this.clone({
1698
- param,
1699
- value,
1700
- op: "d"
1701
- });
1702
- }
1703
- /**
1704
- * Serializes the body to an encoded string, where key-value pairs (separated by `=`) are
1705
- * separated by `&`s.
1706
- */
1707
- toString() {
1708
- this.init();
1709
- return this.keys().map((key) => {
1710
- const eKey = this.encoder.encodeKey(key);
1711
- return this.map.get(key).map((value) => eKey + "=" + this.encoder.encodeValue(value)).join("&");
1712
- }).filter((param) => param !== "").join("&");
1713
- }
1714
- clone(update) {
1715
- const clone = new _HttpParams({
1716
- encoder: this.encoder
1717
- });
1718
- clone.cloneFrom = this.cloneFrom || this;
1719
- clone.updates = (this.updates || []).concat(update);
1720
- return clone;
1721
- }
1722
- init() {
1723
- if (this.map === null) {
1724
- this.map = /* @__PURE__ */ new Map();
1725
- }
1726
- if (this.cloneFrom !== null) {
1727
- this.cloneFrom.init();
1728
- this.cloneFrom.keys().forEach((key) => this.map.set(key, this.cloneFrom.map.get(key)));
1729
- this.updates.forEach((update) => {
1730
- switch (update.op) {
1731
- case "a":
1732
- case "s":
1733
- const base = (update.op === "a" ? this.map.get(update.param) : void 0) || [];
1734
- base.push(valueToString(update.value));
1735
- this.map.set(update.param, base);
1736
- break;
1737
- case "d":
1738
- if (update.value !== void 0) {
1739
- let base2 = this.map.get(update.param) || [];
1740
- const idx = base2.indexOf(valueToString(update.value));
1741
- if (idx !== -1) {
1742
- base2.splice(idx, 1);
1743
- }
1744
- if (base2.length > 0) {
1745
- this.map.set(update.param, base2);
1746
- } else {
1747
- this.map.delete(update.param);
1748
- }
1749
- } else {
1750
- this.map.delete(update.param);
1751
- break;
1752
- }
1753
- }
1754
- });
1755
- this.cloneFrom = this.updates = null;
1756
- }
1757
- }
1758
- };
1759
- var HttpContext = class {
1760
- map = /* @__PURE__ */ new Map();
1761
- /**
1762
- * Store a value in the context. If a value is already present it will be overwritten.
1763
- *
1764
- * @param token The reference to an instance of `HttpContextToken`.
1765
- * @param value The value to store.
1766
- *
1767
- * @returns A reference to itself for easy chaining.
1768
- */
1769
- set(token, value) {
1770
- this.map.set(token, value);
1771
- return this;
1772
- }
1773
- /**
1774
- * Retrieve the value associated with the given token.
1775
- *
1776
- * @param token The reference to an instance of `HttpContextToken`.
1777
- *
1778
- * @returns The stored value or default if one is defined.
1779
- */
1780
- get(token) {
1781
- if (!this.map.has(token)) {
1782
- this.map.set(token, token.defaultValue());
1783
- }
1784
- return this.map.get(token);
1785
- }
1786
- /**
1787
- * Delete the value associated with the given token.
1788
- *
1789
- * @param token The reference to an instance of `HttpContextToken`.
1790
- *
1791
- * @returns A reference to itself for easy chaining.
1792
- */
1793
- delete(token) {
1794
- this.map.delete(token);
1795
- return this;
1796
- }
1797
- /**
1798
- * Checks for existence of a given token.
1799
- *
1800
- * @param token The reference to an instance of `HttpContextToken`.
1801
- *
1802
- * @returns True if the token exists, false otherwise.
1803
- */
1804
- has(token) {
1805
- return this.map.has(token);
1806
- }
1807
- /**
1808
- * @returns a list of tokens currently stored in the context.
1809
- */
1810
- keys() {
1811
- return this.map.keys();
1812
- }
1813
- };
1814
- function mightHaveBody(method) {
1815
- switch (method) {
1816
- case "DELETE":
1817
- case "GET":
1818
- case "HEAD":
1819
- case "OPTIONS":
1820
- case "JSONP":
1821
- return false;
1822
- default:
1823
- return true;
1824
- }
1825
- }
1826
- function isArrayBuffer(value) {
1827
- return typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer;
1828
- }
1829
- function isBlob(value) {
1830
- return typeof Blob !== "undefined" && value instanceof Blob;
1831
- }
1832
- function isFormData(value) {
1833
- return typeof FormData !== "undefined" && value instanceof FormData;
1834
- }
1835
- function isUrlSearchParams(value) {
1836
- return typeof URLSearchParams !== "undefined" && value instanceof URLSearchParams;
1837
- }
1838
- var CONTENT_TYPE_HEADER = "Content-Type";
1839
- var ACCEPT_HEADER = "Accept";
1840
- var X_REQUEST_URL_HEADER = "X-Request-URL";
1841
- var TEXT_CONTENT_TYPE = "text/plain";
1842
- var JSON_CONTENT_TYPE = "application/json";
1843
- var ACCEPT_HEADER_VALUE = `${JSON_CONTENT_TYPE}, ${TEXT_CONTENT_TYPE}, */*`;
1844
- var HttpRequest = class _HttpRequest {
1845
- url;
1846
- /**
1847
- * The request body, or `null` if one isn't set.
1848
- *
1849
- * Bodies are not enforced to be immutable, as they can include a reference to any
1850
- * user-defined data type. However, interceptors should take care to preserve
1851
- * idempotence by treating them as such.
1852
- */
1853
- body = null;
1854
- /**
1855
- * Outgoing headers for this request.
1856
- */
1857
- headers;
1858
- /**
1859
- * Shared and mutable context that can be used by interceptors
1860
- */
1861
- context;
1862
- /**
1863
- * Whether this request should be made in a way that exposes progress events.
1864
- *
1865
- * Progress events are expensive (change detection runs on each event) and so
1866
- * they should only be requested if the consumer intends to monitor them.
1867
- *
1868
- * Note: The `FetchBackend` doesn't support progress report on uploads.
1869
- */
1870
- reportProgress = false;
1871
- /**
1872
- * Whether this request should be sent with outgoing credentials (cookies).
1873
- */
1874
- withCredentials = false;
1875
- /**
1876
- * The credentials mode of the request, which determines how cookies and HTTP authentication are handled.
1877
- * This can affect whether cookies are sent with the request, and how authentication is handled.
1878
- */
1879
- credentials;
1880
- /**
1881
- * When using the fetch implementation and set to `true`, the browser will not abort the associated request if the page that initiated it is unloaded before the request is complete.
1882
- */
1883
- keepalive = false;
1884
- /**
1885
- * Controls how the request will interact with the browser's HTTP cache.
1886
- * This affects whether a response is retrieved from the cache, how it is stored, or if it bypasses the cache altogether.
1887
- */
1888
- cache;
1889
- /**
1890
- * Indicates the relative priority of the request. This may be used by the browser to decide the order in which requests are dispatched and resources fetched.
1891
- */
1892
- priority;
1893
- /**
1894
- * The mode of the request, which determines how the request will interact with the browser's security model.
1895
- * This can affect things like CORS (Cross-Origin Resource Sharing) and same-origin policies.
1896
- */
1897
- mode;
1898
- /**
1899
- * The redirect mode of the request, which determines how redirects are handled.
1900
- * This can affect whether the request follows redirects automatically, or if it fails when a redirect occurs.
1901
- */
1902
- redirect;
1903
- /**
1904
- * The referrer of the request, which can be used to indicate the origin of the request.
1905
- * This is useful for security and analytics purposes.
1906
- * Value is a same-origin URL, "about:client", or the empty string, to set request's referrer.
1907
- */
1908
- referrer;
1909
- /**
1910
- * The integrity metadata of the request, which can be used to ensure the request is made with the expected content.
1911
- * A cryptographic hash of the resource to be fetched by request
1912
- */
1913
- integrity;
1914
- /**
1915
- * The expected response type of the server.
1916
- *
1917
- * This is used to parse the response appropriately before returning it to
1918
- * the requestee.
1919
- */
1920
- responseType = "json";
1921
- /**
1922
- * The outgoing HTTP request method.
1923
- */
1924
- method;
1925
- /**
1926
- * Outgoing URL parameters.
1927
- *
1928
- * To pass a string representation of HTTP parameters in the URL-query-string format,
1929
- * the `HttpParamsOptions`' `fromString` may be used. For example:
1930
- *
1931
- * ```ts
1932
- * new HttpParams({fromString: 'angular=awesome'})
1933
- * ```
1934
- */
1935
- params;
1936
- /**
1937
- * The outgoing URL with all URL parameters set.
1938
- */
1939
- urlWithParams;
1940
- /**
1941
- * The HttpTransferCache option for the request
1942
- */
1943
- transferCache;
1944
- /**
1945
- * The timeout for the backend HTTP request in ms.
1946
- */
1947
- timeout;
1948
- constructor(method, url, third, fourth) {
1949
- this.url = url;
1950
- this.method = method.toUpperCase();
1951
- let options;
1952
- if (mightHaveBody(this.method) || !!fourth) {
1953
- this.body = third !== void 0 ? third : null;
1954
- options = fourth;
1955
- } else {
1956
- options = third;
1957
- }
1958
- if (options) {
1959
- this.reportProgress = !!options.reportProgress;
1960
- this.withCredentials = !!options.withCredentials;
1961
- this.keepalive = !!options.keepalive;
1962
- if (!!options.responseType) {
1963
- this.responseType = options.responseType;
1964
- }
1965
- if (options.headers) {
1966
- this.headers = options.headers;
1967
- }
1968
- if (options.context) {
1969
- this.context = options.context;
1970
- }
1971
- if (options.params) {
1972
- this.params = options.params;
1973
- }
1974
- if (options.priority) {
1975
- this.priority = options.priority;
1976
- }
1977
- if (options.cache) {
1978
- this.cache = options.cache;
1979
- }
1980
- if (options.credentials) {
1981
- this.credentials = options.credentials;
1982
- }
1983
- if (typeof options.timeout === "number") {
1984
- if (options.timeout < 1 || !Number.isInteger(options.timeout)) {
1985
- throw new RuntimeError(2822, ngDevMode ? "`timeout` must be a positive integer value" : "");
1986
- }
1987
- this.timeout = options.timeout;
1988
- }
1989
- if (options.mode) {
1990
- this.mode = options.mode;
1991
- }
1992
- if (options.redirect) {
1993
- this.redirect = options.redirect;
1994
- }
1995
- if (options.integrity) {
1996
- this.integrity = options.integrity;
1997
- }
1998
- if (options.referrer) {
1999
- this.referrer = options.referrer;
2000
- }
2001
- this.transferCache = options.transferCache;
2002
- }
2003
- this.headers ??= new HttpHeaders();
2004
- this.context ??= new HttpContext();
2005
- if (!this.params) {
2006
- this.params = new HttpParams();
2007
- this.urlWithParams = url;
2008
- } else {
2009
- const params = this.params.toString();
2010
- if (params.length === 0) {
2011
- this.urlWithParams = url;
2012
- } else {
2013
- const qIdx = url.indexOf("?");
2014
- const sep = qIdx === -1 ? "?" : qIdx < url.length - 1 ? "&" : "";
2015
- this.urlWithParams = url + sep + params;
2016
- }
2017
- }
2018
- }
2019
- /**
2020
- * Transform the free-form body into a serialized format suitable for
2021
- * transmission to the server.
2022
- */
2023
- serializeBody() {
2024
- if (this.body === null) {
2025
- return null;
2026
- }
2027
- if (typeof this.body === "string" || isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) || isUrlSearchParams(this.body)) {
2028
- return this.body;
2029
- }
2030
- if (this.body instanceof HttpParams) {
2031
- return this.body.toString();
2032
- }
2033
- if (typeof this.body === "object" || typeof this.body === "boolean" || Array.isArray(this.body)) {
2034
- return JSON.stringify(this.body);
2035
- }
2036
- return this.body.toString();
2037
- }
2038
- /**
2039
- * Examine the body and attempt to infer an appropriate MIME type
2040
- * for it.
2041
- *
2042
- * If no such type can be inferred, this method will return `null`.
2043
- */
2044
- detectContentTypeHeader() {
2045
- if (this.body === null) {
2046
- return null;
2047
- }
2048
- if (isFormData(this.body)) {
2049
- return null;
2050
- }
2051
- if (isBlob(this.body)) {
2052
- return this.body.type || null;
2053
- }
2054
- if (isArrayBuffer(this.body)) {
2055
- return null;
2056
- }
2057
- if (typeof this.body === "string") {
2058
- return TEXT_CONTENT_TYPE;
2059
- }
2060
- if (this.body instanceof HttpParams) {
2061
- return "application/x-www-form-urlencoded;charset=UTF-8";
2062
- }
2063
- if (typeof this.body === "object" || typeof this.body === "number" || typeof this.body === "boolean") {
2064
- return JSON_CONTENT_TYPE;
2065
- }
2066
- return null;
2067
- }
2068
- clone(update = {}) {
2069
- const method = update.method || this.method;
2070
- const url = update.url || this.url;
2071
- const responseType = update.responseType || this.responseType;
2072
- const keepalive = update.keepalive ?? this.keepalive;
2073
- const priority = update.priority || this.priority;
2074
- const cache = update.cache || this.cache;
2075
- const mode = update.mode || this.mode;
2076
- const redirect = update.redirect || this.redirect;
2077
- const credentials = update.credentials || this.credentials;
2078
- const referrer = update.referrer || this.referrer;
2079
- const integrity = update.integrity || this.integrity;
2080
- const transferCache = update.transferCache ?? this.transferCache;
2081
- const timeout = update.timeout ?? this.timeout;
2082
- const body = update.body !== void 0 ? update.body : this.body;
2083
- const withCredentials = update.withCredentials ?? this.withCredentials;
2084
- const reportProgress = update.reportProgress ?? this.reportProgress;
2085
- let headers = update.headers || this.headers;
2086
- let params = update.params || this.params;
2087
- const context = update.context ?? this.context;
2088
- if (update.setHeaders !== void 0) {
2089
- headers = Object.keys(update.setHeaders).reduce((headers2, name) => headers2.set(name, update.setHeaders[name]), headers);
2090
- }
2091
- if (update.setParams) {
2092
- params = Object.keys(update.setParams).reduce((params2, param) => params2.set(param, update.setParams[param]), params);
2093
- }
2094
- return new _HttpRequest(method, url, body, {
2095
- params,
2096
- headers,
2097
- context,
2098
- reportProgress,
2099
- responseType,
2100
- withCredentials,
2101
- transferCache,
2102
- keepalive,
2103
- cache,
2104
- priority,
2105
- timeout,
2106
- mode,
2107
- redirect,
2108
- credentials,
2109
- referrer,
2110
- integrity
2111
- });
2112
- }
2113
- };
2114
- var HttpEventType;
2115
- (function(HttpEventType2) {
2116
- HttpEventType2[HttpEventType2["Sent"] = 0] = "Sent";
2117
- HttpEventType2[HttpEventType2["UploadProgress"] = 1] = "UploadProgress";
2118
- HttpEventType2[HttpEventType2["ResponseHeader"] = 2] = "ResponseHeader";
2119
- HttpEventType2[HttpEventType2["DownloadProgress"] = 3] = "DownloadProgress";
2120
- HttpEventType2[HttpEventType2["Response"] = 4] = "Response";
2121
- HttpEventType2[HttpEventType2["User"] = 5] = "User";
2122
- })(HttpEventType || (HttpEventType = {}));
2123
- var HttpResponseBase = class {
2124
- /**
2125
- * All response headers.
2126
- */
2127
- headers;
2128
- /**
2129
- * Response status code.
2130
- */
2131
- status;
2132
- /**
2133
- * Textual description of response status code, defaults to OK.
2134
- *
2135
- * Do not depend on this.
2136
- */
2137
- statusText;
2138
- /**
2139
- * URL of the resource retrieved, or null if not available.
2140
- */
2141
- url;
2142
- /**
2143
- * Whether the status code falls in the 2xx range.
2144
- */
2145
- ok;
2146
- /**
2147
- * Type of the response, narrowed to either the full response or the header.
2148
- */
2149
- type;
2150
- /**
2151
- * Indicates whether the HTTP response was redirected during the request.
2152
- * This property is only available when using the Fetch API using `withFetch()`
2153
- * When using the default XHR Request this property will be `undefined`
2154
- */
2155
- redirected;
2156
- /**
2157
- * Super-constructor for all responses.
2158
- *
2159
- * The single parameter accepted is an initialization hash. Any properties
2160
- * of the response passed there will override the default values.
2161
- */
2162
- constructor(init, defaultStatus = 200, defaultStatusText = "OK") {
2163
- this.headers = init.headers || new HttpHeaders();
2164
- this.status = init.status !== void 0 ? init.status : defaultStatus;
2165
- this.statusText = init.statusText || defaultStatusText;
2166
- this.url = init.url || null;
2167
- this.redirected = init.redirected;
2168
- this.ok = this.status >= 200 && this.status < 300;
2169
- }
2170
- };
2171
- var HttpHeaderResponse = class _HttpHeaderResponse extends HttpResponseBase {
2172
- /**
2173
- * Create a new `HttpHeaderResponse` with the given parameters.
2174
- */
2175
- constructor(init = {}) {
2176
- super(init);
2177
- }
2178
- type = HttpEventType.ResponseHeader;
2179
- /**
2180
- * Copy this `HttpHeaderResponse`, overriding its contents with the
2181
- * given parameter hash.
2182
- */
2183
- clone(update = {}) {
2184
- return new _HttpHeaderResponse({
2185
- headers: update.headers || this.headers,
2186
- status: update.status !== void 0 ? update.status : this.status,
2187
- statusText: update.statusText || this.statusText,
2188
- url: update.url || this.url || void 0
2189
- });
2190
- }
2191
- };
2192
- var HttpResponse = class _HttpResponse extends HttpResponseBase {
2193
- /**
2194
- * The response body, or `null` if one was not returned.
2195
- */
2196
- body;
2197
- /**
2198
- * Construct a new `HttpResponse`.
2199
- */
2200
- constructor(init = {}) {
2201
- super(init);
2202
- this.body = init.body !== void 0 ? init.body : null;
2203
- }
2204
- type = HttpEventType.Response;
2205
- clone(update = {}) {
2206
- return new _HttpResponse({
2207
- body: update.body !== void 0 ? update.body : this.body,
2208
- headers: update.headers || this.headers,
2209
- status: update.status !== void 0 ? update.status : this.status,
2210
- statusText: update.statusText || this.statusText,
2211
- url: update.url || this.url || void 0,
2212
- redirected: update.redirected ?? this.redirected
2213
- });
2214
- }
2215
- };
2216
- var HttpErrorResponse = class extends HttpResponseBase {
2217
- name = "HttpErrorResponse";
2218
- message;
2219
- error;
2220
- /**
2221
- * Errors are never okay, even when the status code is in the 2xx success range.
2222
- */
2223
- ok = false;
2224
- constructor(init) {
2225
- super(init, 0, "Unknown Error");
2226
- if (this.status >= 200 && this.status < 300) {
2227
- this.message = `Http failure during parsing for ${init.url || "(unknown url)"}`;
2228
- } else {
2229
- this.message = `Http failure response for ${init.url || "(unknown url)"}: ${init.status} ${init.statusText}`;
2230
- }
2231
- this.error = init.error || null;
2232
- }
2233
- };
2234
- var HTTP_STATUS_CODE_OK = 200;
2235
- var HTTP_STATUS_CODE_NO_CONTENT = 204;
2236
- var HttpStatusCode;
2237
- (function(HttpStatusCode2) {
2238
- HttpStatusCode2[HttpStatusCode2["Continue"] = 100] = "Continue";
2239
- HttpStatusCode2[HttpStatusCode2["SwitchingProtocols"] = 101] = "SwitchingProtocols";
2240
- HttpStatusCode2[HttpStatusCode2["Processing"] = 102] = "Processing";
2241
- HttpStatusCode2[HttpStatusCode2["EarlyHints"] = 103] = "EarlyHints";
2242
- HttpStatusCode2[HttpStatusCode2["Ok"] = 200] = "Ok";
2243
- HttpStatusCode2[HttpStatusCode2["Created"] = 201] = "Created";
2244
- HttpStatusCode2[HttpStatusCode2["Accepted"] = 202] = "Accepted";
2245
- HttpStatusCode2[HttpStatusCode2["NonAuthoritativeInformation"] = 203] = "NonAuthoritativeInformation";
2246
- HttpStatusCode2[HttpStatusCode2["NoContent"] = 204] = "NoContent";
2247
- HttpStatusCode2[HttpStatusCode2["ResetContent"] = 205] = "ResetContent";
2248
- HttpStatusCode2[HttpStatusCode2["PartialContent"] = 206] = "PartialContent";
2249
- HttpStatusCode2[HttpStatusCode2["MultiStatus"] = 207] = "MultiStatus";
2250
- HttpStatusCode2[HttpStatusCode2["AlreadyReported"] = 208] = "AlreadyReported";
2251
- HttpStatusCode2[HttpStatusCode2["ImUsed"] = 226] = "ImUsed";
2252
- HttpStatusCode2[HttpStatusCode2["MultipleChoices"] = 300] = "MultipleChoices";
2253
- HttpStatusCode2[HttpStatusCode2["MovedPermanently"] = 301] = "MovedPermanently";
2254
- HttpStatusCode2[HttpStatusCode2["Found"] = 302] = "Found";
2255
- HttpStatusCode2[HttpStatusCode2["SeeOther"] = 303] = "SeeOther";
2256
- HttpStatusCode2[HttpStatusCode2["NotModified"] = 304] = "NotModified";
2257
- HttpStatusCode2[HttpStatusCode2["UseProxy"] = 305] = "UseProxy";
2258
- HttpStatusCode2[HttpStatusCode2["Unused"] = 306] = "Unused";
2259
- HttpStatusCode2[HttpStatusCode2["TemporaryRedirect"] = 307] = "TemporaryRedirect";
2260
- HttpStatusCode2[HttpStatusCode2["PermanentRedirect"] = 308] = "PermanentRedirect";
2261
- HttpStatusCode2[HttpStatusCode2["BadRequest"] = 400] = "BadRequest";
2262
- HttpStatusCode2[HttpStatusCode2["Unauthorized"] = 401] = "Unauthorized";
2263
- HttpStatusCode2[HttpStatusCode2["PaymentRequired"] = 402] = "PaymentRequired";
2264
- HttpStatusCode2[HttpStatusCode2["Forbidden"] = 403] = "Forbidden";
2265
- HttpStatusCode2[HttpStatusCode2["NotFound"] = 404] = "NotFound";
2266
- HttpStatusCode2[HttpStatusCode2["MethodNotAllowed"] = 405] = "MethodNotAllowed";
2267
- HttpStatusCode2[HttpStatusCode2["NotAcceptable"] = 406] = "NotAcceptable";
2268
- HttpStatusCode2[HttpStatusCode2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
2269
- HttpStatusCode2[HttpStatusCode2["RequestTimeout"] = 408] = "RequestTimeout";
2270
- HttpStatusCode2[HttpStatusCode2["Conflict"] = 409] = "Conflict";
2271
- HttpStatusCode2[HttpStatusCode2["Gone"] = 410] = "Gone";
2272
- HttpStatusCode2[HttpStatusCode2["LengthRequired"] = 411] = "LengthRequired";
2273
- HttpStatusCode2[HttpStatusCode2["PreconditionFailed"] = 412] = "PreconditionFailed";
2274
- HttpStatusCode2[HttpStatusCode2["PayloadTooLarge"] = 413] = "PayloadTooLarge";
2275
- HttpStatusCode2[HttpStatusCode2["UriTooLong"] = 414] = "UriTooLong";
2276
- HttpStatusCode2[HttpStatusCode2["UnsupportedMediaType"] = 415] = "UnsupportedMediaType";
2277
- HttpStatusCode2[HttpStatusCode2["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
2278
- HttpStatusCode2[HttpStatusCode2["ExpectationFailed"] = 417] = "ExpectationFailed";
2279
- HttpStatusCode2[HttpStatusCode2["ImATeapot"] = 418] = "ImATeapot";
2280
- HttpStatusCode2[HttpStatusCode2["MisdirectedRequest"] = 421] = "MisdirectedRequest";
2281
- HttpStatusCode2[HttpStatusCode2["UnprocessableEntity"] = 422] = "UnprocessableEntity";
2282
- HttpStatusCode2[HttpStatusCode2["Locked"] = 423] = "Locked";
2283
- HttpStatusCode2[HttpStatusCode2["FailedDependency"] = 424] = "FailedDependency";
2284
- HttpStatusCode2[HttpStatusCode2["TooEarly"] = 425] = "TooEarly";
2285
- HttpStatusCode2[HttpStatusCode2["UpgradeRequired"] = 426] = "UpgradeRequired";
2286
- HttpStatusCode2[HttpStatusCode2["PreconditionRequired"] = 428] = "PreconditionRequired";
2287
- HttpStatusCode2[HttpStatusCode2["TooManyRequests"] = 429] = "TooManyRequests";
2288
- HttpStatusCode2[HttpStatusCode2["RequestHeaderFieldsTooLarge"] = 431] = "RequestHeaderFieldsTooLarge";
2289
- HttpStatusCode2[HttpStatusCode2["UnavailableForLegalReasons"] = 451] = "UnavailableForLegalReasons";
2290
- HttpStatusCode2[HttpStatusCode2["InternalServerError"] = 500] = "InternalServerError";
2291
- HttpStatusCode2[HttpStatusCode2["NotImplemented"] = 501] = "NotImplemented";
2292
- HttpStatusCode2[HttpStatusCode2["BadGateway"] = 502] = "BadGateway";
2293
- HttpStatusCode2[HttpStatusCode2["ServiceUnavailable"] = 503] = "ServiceUnavailable";
2294
- HttpStatusCode2[HttpStatusCode2["GatewayTimeout"] = 504] = "GatewayTimeout";
2295
- HttpStatusCode2[HttpStatusCode2["HttpVersionNotSupported"] = 505] = "HttpVersionNotSupported";
2296
- HttpStatusCode2[HttpStatusCode2["VariantAlsoNegotiates"] = 506] = "VariantAlsoNegotiates";
2297
- HttpStatusCode2[HttpStatusCode2["InsufficientStorage"] = 507] = "InsufficientStorage";
2298
- HttpStatusCode2[HttpStatusCode2["LoopDetected"] = 508] = "LoopDetected";
2299
- HttpStatusCode2[HttpStatusCode2["NotExtended"] = 510] = "NotExtended";
2300
- HttpStatusCode2[HttpStatusCode2["NetworkAuthenticationRequired"] = 511] = "NetworkAuthenticationRequired";
2301
- })(HttpStatusCode || (HttpStatusCode = {}));
2302
- function addBody(options, body) {
2303
- return {
2304
- body,
2305
- headers: options.headers,
2306
- context: options.context,
2307
- observe: options.observe,
2308
- params: options.params,
2309
- reportProgress: options.reportProgress,
2310
- responseType: options.responseType,
2311
- withCredentials: options.withCredentials,
2312
- credentials: options.credentials,
2313
- transferCache: options.transferCache,
2314
- timeout: options.timeout,
2315
- keepalive: options.keepalive,
2316
- priority: options.priority,
2317
- cache: options.cache,
2318
- mode: options.mode,
2319
- redirect: options.redirect,
2320
- integrity: options.integrity,
2321
- referrer: options.referrer
2322
- };
2323
- }
2324
- var HttpClient = class _HttpClient {
2325
- handler;
2326
- constructor(handler) {
2327
- this.handler = handler;
2328
- }
2329
- /**
2330
- * Constructs an observable for a generic HTTP request that, when subscribed,
2331
- * fires the request through the chain of registered interceptors and on to the
2332
- * server.
2333
- *
2334
- * You can pass an `HttpRequest` directly as the only parameter. In this case,
2335
- * the call returns an observable of the raw `HttpEvent` stream.
2336
- *
2337
- * Alternatively you can pass an HTTP method as the first parameter,
2338
- * a URL string as the second, and an options hash containing the request body as the third.
2339
- * See `addBody()`. In this case, the specified `responseType` and `observe` options determine the
2340
- * type of returned observable.
2341
- * * The `responseType` value determines how a successful response body is parsed.
2342
- * * If `responseType` is the default `json`, you can pass a type interface for the resulting
2343
- * object as a type parameter to the call.
2344
- *
2345
- * The `observe` value determines the return type, according to what you are interested in
2346
- * observing.
2347
- * * An `observe` value of events returns an observable of the raw `HttpEvent` stream, including
2348
- * progress events by default.
2349
- * * An `observe` value of response returns an observable of `HttpResponse<T>`,
2350
- * where the `T` parameter depends on the `responseType` and any optionally provided type
2351
- * parameter.
2352
- * * An `observe` value of body returns an observable of `<T>` with the same `T` body type.
2353
- *
2354
- */
2355
- request(first, url, options = {}) {
2356
- let req;
2357
- if (first instanceof HttpRequest) {
2358
- req = first;
2359
- } else {
2360
- let headers = void 0;
2361
- if (options.headers instanceof HttpHeaders) {
2362
- headers = options.headers;
2363
- } else {
2364
- headers = new HttpHeaders(options.headers);
2365
- }
2366
- let params = void 0;
2367
- if (!!options.params) {
2368
- if (options.params instanceof HttpParams) {
2369
- params = options.params;
2370
- } else {
2371
- params = new HttpParams({
2372
- fromObject: options.params
2373
- });
2374
- }
2375
- }
2376
- req = new HttpRequest(first, url, options.body !== void 0 ? options.body : null, {
2377
- headers,
2378
- context: options.context,
2379
- params,
2380
- reportProgress: options.reportProgress,
2381
- // By default, JSON is assumed to be returned for all calls.
2382
- responseType: options.responseType || "json",
2383
- withCredentials: options.withCredentials,
2384
- transferCache: options.transferCache,
2385
- keepalive: options.keepalive,
2386
- priority: options.priority,
2387
- cache: options.cache,
2388
- mode: options.mode,
2389
- redirect: options.redirect,
2390
- credentials: options.credentials,
2391
- referrer: options.referrer,
2392
- integrity: options.integrity,
2393
- timeout: options.timeout
2394
- });
2395
- }
2396
- const events$ = of(req).pipe(concatMap((req2) => this.handler.handle(req2)));
2397
- if (first instanceof HttpRequest || options.observe === "events") {
2398
- return events$;
2399
- }
2400
- const res$ = events$.pipe(filter((event) => event instanceof HttpResponse));
2401
- switch (options.observe || "body") {
2402
- case "body":
2403
- switch (req.responseType) {
2404
- case "arraybuffer":
2405
- return res$.pipe(map((res) => {
2406
- if (res.body !== null && !(res.body instanceof ArrayBuffer)) {
2407
- throw new RuntimeError(2806, ngDevMode && "Response is not an ArrayBuffer.");
2408
- }
2409
- return res.body;
2410
- }));
2411
- case "blob":
2412
- return res$.pipe(map((res) => {
2413
- if (res.body !== null && !(res.body instanceof Blob)) {
2414
- throw new RuntimeError(2807, ngDevMode && "Response is not a Blob.");
2415
- }
2416
- return res.body;
2417
- }));
2418
- case "text":
2419
- return res$.pipe(map((res) => {
2420
- if (res.body !== null && typeof res.body !== "string") {
2421
- throw new RuntimeError(2808, ngDevMode && "Response is not a string.");
2422
- }
2423
- return res.body;
2424
- }));
2425
- case "json":
2426
- default:
2427
- return res$.pipe(map((res) => res.body));
2428
- }
2429
- case "response":
2430
- return res$;
2431
- default:
2432
- throw new RuntimeError(2809, ngDevMode && `Unreachable: unhandled observe type ${options.observe}}`);
2433
- }
2434
- }
2435
- /**
2436
- * Constructs an observable that, when subscribed, causes the configured
2437
- * `DELETE` request to execute on the server. See the individual overloads for
2438
- * details on the return type.
2439
- *
2440
- * @param url The endpoint URL.
2441
- * @param options The HTTP options to send with the request.
2442
- *
2443
- */
2444
- delete(url, options = {}) {
2445
- return this.request("DELETE", url, options);
2446
- }
2447
- /**
2448
- * Constructs an observable that, when subscribed, causes the configured
2449
- * `GET` request to execute on the server. See the individual overloads for
2450
- * details on the return type.
2451
- */
2452
- get(url, options = {}) {
2453
- return this.request("GET", url, options);
2454
- }
2455
- /**
2456
- * Constructs an observable that, when subscribed, causes the configured
2457
- * `HEAD` request to execute on the server. The `HEAD` method returns
2458
- * meta information about the resource without transferring the
2459
- * resource itself. See the individual overloads for
2460
- * details on the return type.
2461
- */
2462
- head(url, options = {}) {
2463
- return this.request("HEAD", url, options);
2464
- }
2465
- /**
2466
- * Constructs an `Observable` that, when subscribed, causes a request with the special method
2467
- * `JSONP` to be dispatched via the interceptor pipeline.
2468
- * The [JSONP pattern](https://en.wikipedia.org/wiki/JSONP) works around limitations of certain
2469
- * API endpoints that don't support newer,
2470
- * and preferable [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) protocol.
2471
- * JSONP treats the endpoint API as a JavaScript file and tricks the browser to process the
2472
- * requests even if the API endpoint is not located on the same domain (origin) as the client-side
2473
- * application making the request.
2474
- * The endpoint API must support JSONP callback for JSONP requests to work.
2475
- * The resource API returns the JSON response wrapped in a callback function.
2476
- * You can pass the callback function name as one of the query parameters.
2477
- * Note that JSONP requests can only be used with `GET` requests.
2478
- *
2479
- * @param url The resource URL.
2480
- * @param callbackParam The callback function name.
2481
- *
2482
- */
2483
- jsonp(url, callbackParam) {
2484
- return this.request("JSONP", url, {
2485
- params: new HttpParams().append(callbackParam, "JSONP_CALLBACK"),
2486
- observe: "body",
2487
- responseType: "json"
2488
- });
2489
- }
2490
- /**
2491
- * Constructs an `Observable` that, when subscribed, causes the configured
2492
- * `OPTIONS` request to execute on the server. This method allows the client
2493
- * to determine the supported HTTP methods and other capabilities of an endpoint,
2494
- * without implying a resource action. See the individual overloads for
2495
- * details on the return type.
2496
- */
2497
- options(url, options = {}) {
2498
- return this.request("OPTIONS", url, options);
2499
- }
2500
- /**
2501
- * Constructs an observable that, when subscribed, causes the configured
2502
- * `PATCH` request to execute on the server. See the individual overloads for
2503
- * details on the return type.
2504
- */
2505
- patch(url, body, options = {}) {
2506
- return this.request("PATCH", url, addBody(options, body));
2507
- }
2508
- /**
2509
- * Constructs an observable that, when subscribed, causes the configured
2510
- * `POST` request to execute on the server. The server responds with the location of
2511
- * the replaced resource. See the individual overloads for
2512
- * details on the return type.
2513
- */
2514
- post(url, body, options = {}) {
2515
- return this.request("POST", url, addBody(options, body));
2516
- }
2517
- /**
2518
- * Constructs an observable that, when subscribed, causes the configured
2519
- * `PUT` request to execute on the server. The `PUT` method replaces an existing resource
2520
- * with a new set of values.
2521
- * See the individual overloads for details on the return type.
2522
- */
2523
- put(url, body, options = {}) {
2524
- return this.request("PUT", url, addBody(options, body));
2525
- }
2526
- static ɵfac = function HttpClient_Factory(__ngFactoryType__) {
2527
- return new (__ngFactoryType__ || _HttpClient)(ɵɵinject(HttpHandler));
2528
- };
2529
- static ɵprov = ɵɵdefineInjectable({
2530
- token: _HttpClient,
2531
- factory: _HttpClient.ɵfac
2532
- });
2533
- };
2534
- (() => {
2535
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpClient, [{
2536
- type: Injectable
2537
- }], () => [{
2538
- type: HttpHandler
2539
- }], null);
2540
- })();
2541
- var XSSI_PREFIX$1 = /^\)\]\}',?\n/;
2542
- function getResponseUrl$1(response) {
2543
- if (response.url) {
2544
- return response.url;
2545
- }
2546
- const xRequestUrl = X_REQUEST_URL_HEADER.toLocaleLowerCase();
2547
- return response.headers.get(xRequestUrl);
2548
- }
2549
- var FETCH_BACKEND = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "FETCH_BACKEND" : "");
2550
- var FetchBackend = class _FetchBackend {
2551
- // We use an arrow function to always reference the current global implementation of `fetch`.
2552
- // This is helpful for cases when the global `fetch` implementation is modified by external code,
2553
- // see https://github.com/angular/angular/issues/57527.
2554
- fetchImpl = inject(FetchFactory, {
2555
- optional: true
2556
- })?.fetch ?? ((...args) => globalThis.fetch(...args));
2557
- ngZone = inject(NgZone);
2558
- destroyRef = inject(DestroyRef);
2559
- destroyed = false;
2560
- constructor() {
2561
- this.destroyRef.onDestroy(() => {
2562
- this.destroyed = true;
2563
- });
2564
- }
2565
- handle(request) {
2566
- return new Observable((observer) => {
2567
- const aborter = new AbortController();
2568
- this.doRequest(request, aborter.signal, observer).then(noop, (error) => observer.error(new HttpErrorResponse({
2569
- error
2570
- })));
2571
- let timeoutId;
2572
- if (request.timeout) {
2573
- timeoutId = this.ngZone.runOutsideAngular(() => setTimeout(() => {
2574
- if (!aborter.signal.aborted) {
2575
- aborter.abort(new DOMException("signal timed out", "TimeoutError"));
2576
- }
2577
- }, request.timeout));
2578
- }
2579
- return () => {
2580
- if (timeoutId !== void 0) {
2581
- clearTimeout(timeoutId);
2582
- }
2583
- aborter.abort();
2584
- };
2585
- });
2586
- }
2587
- doRequest(request, signal2, observer) {
2588
- return __async(this, null, function* () {
2589
- const init = this.createRequestInit(request);
2590
- let response;
2591
- try {
2592
- const fetchPromise = this.ngZone.runOutsideAngular(() => this.fetchImpl(request.urlWithParams, __spreadValues({
2593
- signal: signal2
2594
- }, init)));
2595
- silenceSuperfluousUnhandledPromiseRejection(fetchPromise);
2596
- observer.next({
2597
- type: HttpEventType.Sent
2598
- });
2599
- response = yield fetchPromise;
2600
- } catch (error) {
2601
- observer.error(new HttpErrorResponse({
2602
- error,
2603
- status: error.status ?? 0,
2604
- statusText: error.statusText,
2605
- url: request.urlWithParams,
2606
- headers: error.headers
2607
- }));
2608
- return;
2609
- }
2610
- const headers = new HttpHeaders(response.headers);
2611
- const statusText = response.statusText;
2612
- const url = getResponseUrl$1(response) ?? request.urlWithParams;
2613
- let status = response.status;
2614
- let body = null;
2615
- if (request.reportProgress) {
2616
- observer.next(new HttpHeaderResponse({
2617
- headers,
2618
- status,
2619
- statusText,
2620
- url
2621
- }));
2622
- }
2623
- if (response.body) {
2624
- const contentLength = response.headers.get("content-length");
2625
- const chunks = [];
2626
- const reader = response.body.getReader();
2627
- let receivedLength = 0;
2628
- let decoder;
2629
- let partialText;
2630
- const reqZone = typeof Zone !== "undefined" && Zone.current;
2631
- let canceled = false;
2632
- yield this.ngZone.runOutsideAngular(() => __async(this, null, function* () {
2633
- while (true) {
2634
- if (this.destroyed) {
2635
- yield reader.cancel();
2636
- canceled = true;
2637
- break;
2638
- }
2639
- const {
2640
- done,
2641
- value
2642
- } = yield reader.read();
2643
- if (done) {
2644
- break;
2645
- }
2646
- chunks.push(value);
2647
- receivedLength += value.length;
2648
- if (request.reportProgress) {
2649
- partialText = request.responseType === "text" ? (partialText ?? "") + (decoder ??= new TextDecoder()).decode(value, {
2650
- stream: true
2651
- }) : void 0;
2652
- const reportProgress = () => observer.next({
2653
- type: HttpEventType.DownloadProgress,
2654
- total: contentLength ? +contentLength : void 0,
2655
- loaded: receivedLength,
2656
- partialText
2657
- });
2658
- reqZone ? reqZone.run(reportProgress) : reportProgress();
2659
- }
2660
- }
2661
- }));
2662
- if (canceled) {
2663
- observer.complete();
2664
- return;
2665
- }
2666
- const chunksAll = this.concatChunks(chunks, receivedLength);
2667
- try {
2668
- const contentType = response.headers.get(CONTENT_TYPE_HEADER) ?? "";
2669
- body = this.parseBody(request, chunksAll, contentType, status);
2670
- } catch (error) {
2671
- observer.error(new HttpErrorResponse({
2672
- error,
2673
- headers: new HttpHeaders(response.headers),
2674
- status: response.status,
2675
- statusText: response.statusText,
2676
- url: getResponseUrl$1(response) ?? request.urlWithParams
2677
- }));
2678
- return;
2679
- }
2680
- }
2681
- if (status === 0) {
2682
- status = body ? HTTP_STATUS_CODE_OK : 0;
2683
- }
2684
- const ok = status >= 200 && status < 300;
2685
- const redirected = response.redirected;
2686
- if (ok) {
2687
- observer.next(new HttpResponse({
2688
- body,
2689
- headers,
2690
- status,
2691
- statusText,
2692
- url,
2693
- redirected
2694
- }));
2695
- observer.complete();
2696
- } else {
2697
- observer.error(new HttpErrorResponse({
2698
- error: body,
2699
- headers,
2700
- status,
2701
- statusText,
2702
- url,
2703
- redirected
2704
- }));
2705
- }
2706
- });
2707
- }
2708
- parseBody(request, binContent, contentType, status) {
2709
- switch (request.responseType) {
2710
- case "json":
2711
- const text = new TextDecoder().decode(binContent).replace(XSSI_PREFIX$1, "");
2712
- if (text === "") {
2713
- return null;
2714
- }
2715
- try {
2716
- return JSON.parse(text);
2717
- } catch (e) {
2718
- if (status < 200 || status >= 300) {
2719
- return text;
2720
- }
2721
- throw e;
2722
- }
2723
- case "text":
2724
- return new TextDecoder().decode(binContent);
2725
- case "blob":
2726
- return new Blob([binContent], {
2727
- type: contentType
2728
- });
2729
- case "arraybuffer":
2730
- return binContent.buffer;
2731
- }
2732
- }
2733
- createRequestInit(req) {
2734
- const headers = {};
2735
- let credentials;
2736
- credentials = req.credentials;
2737
- if (req.withCredentials) {
2738
- (typeof ngDevMode === "undefined" || ngDevMode) && warningOptionsMessage(req);
2739
- credentials = "include";
2740
- }
2741
- req.headers.forEach((name, values) => headers[name] = values.join(","));
2742
- if (!req.headers.has(ACCEPT_HEADER)) {
2743
- headers[ACCEPT_HEADER] = ACCEPT_HEADER_VALUE;
2744
- }
2745
- if (!req.headers.has(CONTENT_TYPE_HEADER)) {
2746
- const detectedType = req.detectContentTypeHeader();
2747
- if (detectedType !== null) {
2748
- headers[CONTENT_TYPE_HEADER] = detectedType;
2749
- }
2750
- }
2751
- return {
2752
- body: req.serializeBody(),
2753
- method: req.method,
2754
- headers,
2755
- credentials,
2756
- keepalive: req.keepalive,
2757
- cache: req.cache,
2758
- priority: req.priority,
2759
- mode: req.mode,
2760
- redirect: req.redirect,
2761
- referrer: req.referrer,
2762
- integrity: req.integrity
2763
- };
2764
- }
2765
- concatChunks(chunks, totalLength) {
2766
- const chunksAll = new Uint8Array(totalLength);
2767
- let position = 0;
2768
- for (const chunk of chunks) {
2769
- chunksAll.set(chunk, position);
2770
- position += chunk.length;
2771
- }
2772
- return chunksAll;
2773
- }
2774
- static ɵfac = function FetchBackend_Factory(__ngFactoryType__) {
2775
- return new (__ngFactoryType__ || _FetchBackend)();
2776
- };
2777
- static ɵprov = ɵɵdefineInjectable({
2778
- token: _FetchBackend,
2779
- factory: _FetchBackend.ɵfac
2780
- });
2781
- };
2782
- (() => {
2783
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FetchBackend, [{
2784
- type: Injectable
2785
- }], () => [], null);
2786
- })();
2787
- var FetchFactory = class {
2788
- };
2789
- function noop() {
2790
- }
2791
- function warningOptionsMessage(req) {
2792
- if (req.credentials && req.withCredentials) {
2793
- console.warn(formatRuntimeError(2819, `Angular detected that a \`HttpClient\` request has both \`withCredentials: true\` and \`credentials: '${req.credentials}'\` options. The \`withCredentials\` option is overriding the explicit \`credentials\` setting to 'include'. Consider removing \`withCredentials\` and using \`credentials: '${req.credentials}'\` directly for clarity.`));
2794
- }
2795
- }
2796
- function silenceSuperfluousUnhandledPromiseRejection(promise) {
2797
- promise.then(noop, noop);
2798
- }
2799
- function interceptorChainEndFn(req, finalHandlerFn) {
2800
- return finalHandlerFn(req);
2801
- }
2802
- function adaptLegacyInterceptorToChain(chainTailFn, interceptor) {
2803
- return (initialRequest, finalHandlerFn) => interceptor.intercept(initialRequest, {
2804
- handle: (downstreamRequest) => chainTailFn(downstreamRequest, finalHandlerFn)
2805
- });
2806
- }
2807
- function chainedInterceptorFn(chainTailFn, interceptorFn, injector) {
2808
- return (initialRequest, finalHandlerFn) => runInInjectionContext(injector, () => interceptorFn(initialRequest, (downstreamRequest) => chainTailFn(downstreamRequest, finalHandlerFn)));
2809
- }
2810
- var HTTP_INTERCEPTORS = new InjectionToken(ngDevMode ? "HTTP_INTERCEPTORS" : "");
2811
- var HTTP_INTERCEPTOR_FNS = new InjectionToken(ngDevMode ? "HTTP_INTERCEPTOR_FNS" : "");
2812
- var HTTP_ROOT_INTERCEPTOR_FNS = new InjectionToken(ngDevMode ? "HTTP_ROOT_INTERCEPTOR_FNS" : "");
2813
- var REQUESTS_CONTRIBUTE_TO_STABILITY = new InjectionToken(ngDevMode ? "REQUESTS_CONTRIBUTE_TO_STABILITY" : "", {
2814
- providedIn: "root",
2815
- factory: () => true
2816
- });
2817
- function legacyInterceptorFnFactory() {
2818
- let chain = null;
2819
- return (req, handler) => {
2820
- if (chain === null) {
2821
- const interceptors = inject(HTTP_INTERCEPTORS, {
2822
- optional: true
2823
- }) ?? [];
2824
- chain = interceptors.reduceRight(adaptLegacyInterceptorToChain, interceptorChainEndFn);
2825
- }
2826
- const pendingTasks = inject(PendingTasks);
2827
- const contributeToStability = inject(REQUESTS_CONTRIBUTE_TO_STABILITY);
2828
- if (contributeToStability) {
2829
- const removeTask = pendingTasks.add();
2830
- return chain(req, handler).pipe(finalize(removeTask));
2831
- } else {
2832
- return chain(req, handler);
2833
- }
2834
- };
2835
- }
2836
- var fetchBackendWarningDisplayed = false;
2837
- var HttpInterceptorHandler = class _HttpInterceptorHandler extends HttpHandler {
2838
- backend;
2839
- injector;
2840
- chain = null;
2841
- pendingTasks = inject(PendingTasks);
2842
- contributeToStability = inject(REQUESTS_CONTRIBUTE_TO_STABILITY);
2843
- constructor(backend, injector) {
2844
- super();
2845
- this.backend = backend;
2846
- this.injector = injector;
2847
- if ((typeof ngDevMode === "undefined" || ngDevMode) && !fetchBackendWarningDisplayed) {
2848
- const isTestingBackend = this.backend.isTestingBackend;
2849
- if (false) {
2850
- fetchBackendWarningDisplayed = true;
2851
- injector.get(Console).warn(formatRuntimeError(2801, "Angular detected that `HttpClient` is not configured to use `fetch` APIs. It's strongly recommended to enable `fetch` for applications that use Server-Side Rendering for better performance and compatibility. To enable `fetch`, add the `withFetch()` to the `provideHttpClient()` call at the root of the application."));
2852
- }
2853
- }
2854
- }
2855
- handle(initialRequest) {
2856
- if (this.chain === null) {
2857
- const dedupedInterceptorFns = Array.from(/* @__PURE__ */ new Set([...this.injector.get(HTTP_INTERCEPTOR_FNS), ...this.injector.get(HTTP_ROOT_INTERCEPTOR_FNS, [])]));
2858
- this.chain = dedupedInterceptorFns.reduceRight((nextSequencedFn, interceptorFn) => chainedInterceptorFn(nextSequencedFn, interceptorFn, this.injector), interceptorChainEndFn);
2859
- }
2860
- if (this.contributeToStability) {
2861
- const removeTask = this.pendingTasks.add();
2862
- return this.chain(initialRequest, (downstreamRequest) => this.backend.handle(downstreamRequest)).pipe(finalize(removeTask));
2863
- } else {
2864
- return this.chain(initialRequest, (downstreamRequest) => this.backend.handle(downstreamRequest));
2865
- }
2866
- }
2867
- static ɵfac = function HttpInterceptorHandler_Factory(__ngFactoryType__) {
2868
- return new (__ngFactoryType__ || _HttpInterceptorHandler)(ɵɵinject(HttpBackend), ɵɵinject(EnvironmentInjector));
2869
- };
2870
- static ɵprov = ɵɵdefineInjectable({
2871
- token: _HttpInterceptorHandler,
2872
- factory: _HttpInterceptorHandler.ɵfac
2873
- });
2874
- };
2875
- (() => {
2876
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpInterceptorHandler, [{
2877
- type: Injectable
2878
- }], () => [{
2879
- type: HttpBackend
2880
- }, {
2881
- type: EnvironmentInjector
2882
- }], null);
2883
- })();
2884
- var nextRequestId = 0;
2885
- var foreignDocument;
2886
- var JSONP_ERR_NO_CALLBACK = "JSONP injected script did not invoke callback.";
2887
- var JSONP_ERR_WRONG_METHOD = "JSONP requests must use JSONP request method.";
2888
- var JSONP_ERR_WRONG_RESPONSE_TYPE = "JSONP requests must use Json response type.";
2889
- var JSONP_ERR_HEADERS_NOT_SUPPORTED = "JSONP requests do not support headers.";
2890
- var JsonpCallbackContext = class {
2891
- };
2892
- function jsonpCallbackContext() {
2893
- if (typeof window === "object") {
2894
- return window;
2895
- }
2896
- return {};
2897
- }
2898
- var JsonpClientBackend = class _JsonpClientBackend {
2899
- callbackMap;
2900
- document;
2901
- /**
2902
- * A resolved promise that can be used to schedule microtasks in the event handlers.
2903
- */
2904
- resolvedPromise = Promise.resolve();
2905
- constructor(callbackMap, document2) {
2906
- this.callbackMap = callbackMap;
2907
- this.document = document2;
2908
- }
2909
- /**
2910
- * Get the name of the next callback method, by incrementing the global `nextRequestId`.
2911
- */
2912
- nextCallback() {
2913
- return `ng_jsonp_callback_${nextRequestId++}`;
2914
- }
2915
- /**
2916
- * Processes a JSONP request and returns an event stream of the results.
2917
- * @param req The request object.
2918
- * @returns An observable of the response events.
2919
- *
2920
- */
2921
- handle(req) {
2922
- if (req.method !== "JSONP") {
2923
- throw new RuntimeError(2810, ngDevMode && JSONP_ERR_WRONG_METHOD);
2924
- } else if (req.responseType !== "json") {
2925
- throw new RuntimeError(2811, ngDevMode && JSONP_ERR_WRONG_RESPONSE_TYPE);
2926
- }
2927
- if (req.headers.keys().length > 0) {
2928
- throw new RuntimeError(2812, ngDevMode && JSONP_ERR_HEADERS_NOT_SUPPORTED);
2929
- }
2930
- return new Observable((observer) => {
2931
- const callback = this.nextCallback();
2932
- const url = req.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/, `=${callback}$1`);
2933
- const node = this.document.createElement("script");
2934
- node.src = url;
2935
- let body = null;
2936
- let finished = false;
2937
- this.callbackMap[callback] = (data) => {
2938
- delete this.callbackMap[callback];
2939
- body = data;
2940
- finished = true;
2941
- };
2942
- const cleanup = () => {
2943
- node.removeEventListener("load", onLoad);
2944
- node.removeEventListener("error", onError);
2945
- node.remove();
2946
- delete this.callbackMap[callback];
2947
- };
2948
- const onLoad = () => {
2949
- this.resolvedPromise.then(() => {
2950
- cleanup();
2951
- if (!finished) {
2952
- observer.error(new HttpErrorResponse({
2953
- url,
2954
- status: 0,
2955
- statusText: "JSONP Error",
2956
- error: new Error(JSONP_ERR_NO_CALLBACK)
2957
- }));
2958
- return;
2959
- }
2960
- observer.next(new HttpResponse({
2961
- body,
2962
- status: HTTP_STATUS_CODE_OK,
2963
- statusText: "OK",
2964
- url
2965
- }));
2966
- observer.complete();
2967
- });
2968
- };
2969
- const onError = (error) => {
2970
- cleanup();
2971
- observer.error(new HttpErrorResponse({
2972
- error,
2973
- status: 0,
2974
- statusText: "JSONP Error",
2975
- url
2976
- }));
2977
- };
2978
- node.addEventListener("load", onLoad);
2979
- node.addEventListener("error", onError);
2980
- this.document.body.appendChild(node);
2981
- observer.next({
2982
- type: HttpEventType.Sent
2983
- });
2984
- return () => {
2985
- if (!finished) {
2986
- this.removeListeners(node);
2987
- }
2988
- cleanup();
2989
- };
2990
- });
2991
- }
2992
- removeListeners(script) {
2993
- foreignDocument ??= this.document.implementation.createHTMLDocument();
2994
- foreignDocument.adoptNode(script);
2995
- }
2996
- static ɵfac = function JsonpClientBackend_Factory(__ngFactoryType__) {
2997
- return new (__ngFactoryType__ || _JsonpClientBackend)(ɵɵinject(JsonpCallbackContext), ɵɵinject(DOCUMENT));
2998
- };
2999
- static ɵprov = ɵɵdefineInjectable({
3000
- token: _JsonpClientBackend,
3001
- factory: _JsonpClientBackend.ɵfac
3002
- });
3003
- };
3004
- (() => {
3005
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(JsonpClientBackend, [{
3006
- type: Injectable
3007
- }], () => [{
3008
- type: JsonpCallbackContext
3009
- }, {
3010
- type: void 0,
3011
- decorators: [{
3012
- type: Inject,
3013
- args: [DOCUMENT]
3014
- }]
3015
- }], null);
3016
- })();
3017
- function jsonpInterceptorFn(req, next) {
3018
- if (req.method === "JSONP") {
3019
- return inject(JsonpClientBackend).handle(req);
3020
- }
3021
- return next(req);
3022
- }
3023
- var JsonpInterceptor = class _JsonpInterceptor {
3024
- injector;
3025
- constructor(injector) {
3026
- this.injector = injector;
3027
- }
3028
- /**
3029
- * Identifies and handles a given JSONP request.
3030
- * @param initialRequest The outgoing request object to handle.
3031
- * @param next The next interceptor in the chain, or the backend
3032
- * if no interceptors remain in the chain.
3033
- * @returns An observable of the event stream.
3034
- */
3035
- intercept(initialRequest, next) {
3036
- return runInInjectionContext(this.injector, () => jsonpInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
3037
- }
3038
- static ɵfac = function JsonpInterceptor_Factory(__ngFactoryType__) {
3039
- return new (__ngFactoryType__ || _JsonpInterceptor)(ɵɵinject(EnvironmentInjector));
3040
- };
3041
- static ɵprov = ɵɵdefineInjectable({
3042
- token: _JsonpInterceptor,
3043
- factory: _JsonpInterceptor.ɵfac
3044
- });
3045
- };
3046
- (() => {
3047
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(JsonpInterceptor, [{
3048
- type: Injectable
3049
- }], () => [{
3050
- type: EnvironmentInjector
3051
- }], null);
3052
- })();
3053
- var XSSI_PREFIX = /^\)\]\}',?\n/;
3054
- var X_REQUEST_URL_REGEXP = RegExp(`^${X_REQUEST_URL_HEADER}:`, "m");
3055
- function getResponseUrl(xhr) {
3056
- if ("responseURL" in xhr && xhr.responseURL) {
3057
- return xhr.responseURL;
3058
- }
3059
- if (X_REQUEST_URL_REGEXP.test(xhr.getAllResponseHeaders())) {
3060
- return xhr.getResponseHeader(X_REQUEST_URL_HEADER);
3061
- }
3062
- return null;
3063
- }
3064
- function validateXhrCompatibility(req) {
3065
- const unsupportedOptions = [{
3066
- property: "keepalive",
3067
- errorCode: 2813
3068
- /* RuntimeErrorCode.KEEPALIVE_NOT_SUPPORTED_WITH_XHR */
3069
- }, {
3070
- property: "cache",
3071
- errorCode: 2814
3072
- /* RuntimeErrorCode.CACHE_NOT_SUPPORTED_WITH_XHR */
3073
- }, {
3074
- property: "priority",
3075
- errorCode: 2815
3076
- /* RuntimeErrorCode.PRIORITY_NOT_SUPPORTED_WITH_XHR */
3077
- }, {
3078
- property: "mode",
3079
- errorCode: 2816
3080
- /* RuntimeErrorCode.MODE_NOT_SUPPORTED_WITH_XHR */
3081
- }, {
3082
- property: "redirect",
3083
- errorCode: 2817
3084
- /* RuntimeErrorCode.REDIRECT_NOT_SUPPORTED_WITH_XHR */
3085
- }, {
3086
- property: "credentials",
3087
- errorCode: 2818
3088
- /* RuntimeErrorCode.CREDENTIALS_NOT_SUPPORTED_WITH_XHR */
3089
- }, {
3090
- property: "integrity",
3091
- errorCode: 2820
3092
- /* RuntimeErrorCode.INTEGRITY_NOT_SUPPORTED_WITH_XHR */
3093
- }, {
3094
- property: "referrer",
3095
- errorCode: 2821
3096
- /* RuntimeErrorCode.REFERRER_NOT_SUPPORTED_WITH_XHR */
3097
- }];
3098
- for (const {
3099
- property,
3100
- errorCode
3101
- } of unsupportedOptions) {
3102
- if (req[property]) {
3103
- console.warn(formatRuntimeError(errorCode, `Angular detected that a \`HttpClient\` request with the \`${property}\` option was sent using XHR, which does not support it. To use the \`${property}\` option, enable Fetch API support by passing \`withFetch()\` as an argument to \`provideHttpClient()\`.`));
3104
- }
3105
- }
3106
- }
3107
- var HttpXhrBackend = class _HttpXhrBackend {
3108
- xhrFactory;
3109
- constructor(xhrFactory) {
3110
- this.xhrFactory = xhrFactory;
3111
- }
3112
- /**
3113
- * Processes a request and returns a stream of response events.
3114
- * @param req The request object.
3115
- * @returns An observable of the response events.
3116
- */
3117
- handle(req) {
3118
- if (req.method === "JSONP") {
3119
- throw new RuntimeError(-2800, (typeof ngDevMode === "undefined" || ngDevMode) && `Cannot make a JSONP request without JSONP support. To fix the problem, either add the \`withJsonpSupport()\` call (if \`provideHttpClient()\` is used) or import the \`HttpClientJsonpModule\` in the root NgModule.`);
3120
- }
3121
- ngDevMode && validateXhrCompatibility(req);
3122
- const xhrFactory = this.xhrFactory;
3123
- const source = (
3124
- // Note that `ɵloadImpl` is never defined in client bundles and can be
3125
- // safely dropped whenever we're running in the browser.
3126
- // This branching is redundant.
3127
- // The `ngServerMode` guard also enables tree-shaking of the `from()`
3128
- // function from the common bundle, as it's only used in server code.
3129
- false ? from(xhrFactory.ɵloadImpl()) : of(null)
3130
- );
3131
- return source.pipe(switchMap(() => {
3132
- return new Observable((observer) => {
3133
- const xhr = xhrFactory.build();
3134
- xhr.open(req.method, req.urlWithParams);
3135
- if (req.withCredentials) {
3136
- xhr.withCredentials = true;
3137
- }
3138
- req.headers.forEach((name, values) => xhr.setRequestHeader(name, values.join(",")));
3139
- if (!req.headers.has(ACCEPT_HEADER)) {
3140
- xhr.setRequestHeader(ACCEPT_HEADER, ACCEPT_HEADER_VALUE);
3141
- }
3142
- if (!req.headers.has(CONTENT_TYPE_HEADER)) {
3143
- const detectedType = req.detectContentTypeHeader();
3144
- if (detectedType !== null) {
3145
- xhr.setRequestHeader(CONTENT_TYPE_HEADER, detectedType);
3146
- }
3147
- }
3148
- if (req.timeout) {
3149
- xhr.timeout = req.timeout;
3150
- }
3151
- if (req.responseType) {
3152
- const responseType = req.responseType.toLowerCase();
3153
- xhr.responseType = responseType !== "json" ? responseType : "text";
3154
- }
3155
- const reqBody = req.serializeBody();
3156
- let headerResponse = null;
3157
- const partialFromXhr = () => {
3158
- if (headerResponse !== null) {
3159
- return headerResponse;
3160
- }
3161
- const statusText = xhr.statusText || "OK";
3162
- const headers = new HttpHeaders(xhr.getAllResponseHeaders());
3163
- const url = getResponseUrl(xhr) || req.url;
3164
- headerResponse = new HttpHeaderResponse({
3165
- headers,
3166
- status: xhr.status,
3167
- statusText,
3168
- url
3169
- });
3170
- return headerResponse;
3171
- };
3172
- const onLoad = () => {
3173
- let {
3174
- headers,
3175
- status,
3176
- statusText,
3177
- url
3178
- } = partialFromXhr();
3179
- let body = null;
3180
- if (status !== HTTP_STATUS_CODE_NO_CONTENT) {
3181
- body = typeof xhr.response === "undefined" ? xhr.responseText : xhr.response;
3182
- }
3183
- if (status === 0) {
3184
- status = !!body ? HTTP_STATUS_CODE_OK : 0;
3185
- }
3186
- let ok = status >= 200 && status < 300;
3187
- if (req.responseType === "json" && typeof body === "string") {
3188
- const originalBody = body;
3189
- body = body.replace(XSSI_PREFIX, "");
3190
- try {
3191
- body = body !== "" ? JSON.parse(body) : null;
3192
- } catch (error) {
3193
- body = originalBody;
3194
- if (ok) {
3195
- ok = false;
3196
- body = {
3197
- error,
3198
- text: body
3199
- };
3200
- }
3201
- }
3202
- }
3203
- if (ok) {
3204
- observer.next(new HttpResponse({
3205
- body,
3206
- headers,
3207
- status,
3208
- statusText,
3209
- url: url || void 0
3210
- }));
3211
- observer.complete();
3212
- } else {
3213
- observer.error(new HttpErrorResponse({
3214
- // The error in this case is the response body (error from the server).
3215
- error: body,
3216
- headers,
3217
- status,
3218
- statusText,
3219
- url: url || void 0
3220
- }));
3221
- }
3222
- };
3223
- const onError = (error) => {
3224
- const {
3225
- url
3226
- } = partialFromXhr();
3227
- const res = new HttpErrorResponse({
3228
- error,
3229
- status: xhr.status || 0,
3230
- statusText: xhr.statusText || "Unknown Error",
3231
- url: url || void 0
3232
- });
3233
- observer.error(res);
3234
- };
3235
- let onTimeout = onError;
3236
- if (req.timeout) {
3237
- onTimeout = (_) => {
3238
- const {
3239
- url
3240
- } = partialFromXhr();
3241
- const res = new HttpErrorResponse({
3242
- error: new DOMException("Request timed out", "TimeoutError"),
3243
- status: xhr.status || 0,
3244
- statusText: xhr.statusText || "Request timeout",
3245
- url: url || void 0
3246
- });
3247
- observer.error(res);
3248
- };
3249
- }
3250
- let sentHeaders = false;
3251
- const onDownProgress = (event) => {
3252
- if (!sentHeaders) {
3253
- observer.next(partialFromXhr());
3254
- sentHeaders = true;
3255
- }
3256
- let progressEvent = {
3257
- type: HttpEventType.DownloadProgress,
3258
- loaded: event.loaded
3259
- };
3260
- if (event.lengthComputable) {
3261
- progressEvent.total = event.total;
3262
- }
3263
- if (req.responseType === "text" && !!xhr.responseText) {
3264
- progressEvent.partialText = xhr.responseText;
3265
- }
3266
- observer.next(progressEvent);
3267
- };
3268
- const onUpProgress = (event) => {
3269
- let progress = {
3270
- type: HttpEventType.UploadProgress,
3271
- loaded: event.loaded
3272
- };
3273
- if (event.lengthComputable) {
3274
- progress.total = event.total;
3275
- }
3276
- observer.next(progress);
3277
- };
3278
- xhr.addEventListener("load", onLoad);
3279
- xhr.addEventListener("error", onError);
3280
- xhr.addEventListener("timeout", onTimeout);
3281
- xhr.addEventListener("abort", onError);
3282
- if (req.reportProgress) {
3283
- xhr.addEventListener("progress", onDownProgress);
3284
- if (reqBody !== null && xhr.upload) {
3285
- xhr.upload.addEventListener("progress", onUpProgress);
3286
- }
3287
- }
3288
- xhr.send(reqBody);
3289
- observer.next({
3290
- type: HttpEventType.Sent
3291
- });
3292
- return () => {
3293
- xhr.removeEventListener("error", onError);
3294
- xhr.removeEventListener("abort", onError);
3295
- xhr.removeEventListener("load", onLoad);
3296
- xhr.removeEventListener("timeout", onTimeout);
3297
- if (req.reportProgress) {
3298
- xhr.removeEventListener("progress", onDownProgress);
3299
- if (reqBody !== null && xhr.upload) {
3300
- xhr.upload.removeEventListener("progress", onUpProgress);
3301
- }
3302
- }
3303
- if (xhr.readyState !== xhr.DONE) {
3304
- xhr.abort();
3305
- }
3306
- };
3307
- });
3308
- }));
3309
- }
3310
- static ɵfac = function HttpXhrBackend_Factory(__ngFactoryType__) {
3311
- return new (__ngFactoryType__ || _HttpXhrBackend)(ɵɵinject(XhrFactory));
3312
- };
3313
- static ɵprov = ɵɵdefineInjectable({
3314
- token: _HttpXhrBackend,
3315
- factory: _HttpXhrBackend.ɵfac
3316
- });
3317
- };
3318
- (() => {
3319
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpXhrBackend, [{
3320
- type: Injectable
3321
- }], () => [{
3322
- type: XhrFactory
3323
- }], null);
3324
- })();
3325
- var XSRF_ENABLED = new InjectionToken(ngDevMode ? "XSRF_ENABLED" : "");
3326
- var XSRF_DEFAULT_COOKIE_NAME = "XSRF-TOKEN";
3327
- var XSRF_COOKIE_NAME = new InjectionToken(ngDevMode ? "XSRF_COOKIE_NAME" : "", {
3328
- providedIn: "root",
3329
- factory: () => XSRF_DEFAULT_COOKIE_NAME
3330
- });
3331
- var XSRF_DEFAULT_HEADER_NAME = "X-XSRF-TOKEN";
3332
- var XSRF_HEADER_NAME = new InjectionToken(ngDevMode ? "XSRF_HEADER_NAME" : "", {
3333
- providedIn: "root",
3334
- factory: () => XSRF_DEFAULT_HEADER_NAME
3335
- });
3336
- var HttpXsrfTokenExtractor = class {
3337
- };
3338
- var HttpXsrfCookieExtractor = class _HttpXsrfCookieExtractor {
3339
- doc;
3340
- cookieName;
3341
- lastCookieString = "";
3342
- lastToken = null;
3343
- /**
3344
- * @internal for testing
3345
- */
3346
- parseCount = 0;
3347
- constructor(doc, cookieName) {
3348
- this.doc = doc;
3349
- this.cookieName = cookieName;
3350
- }
3351
- getToken() {
3352
- if (false) {
3353
- return null;
3354
- }
3355
- const cookieString = this.doc.cookie || "";
3356
- if (cookieString !== this.lastCookieString) {
3357
- this.parseCount++;
3358
- this.lastToken = parseCookieValue(cookieString, this.cookieName);
3359
- this.lastCookieString = cookieString;
3360
- }
3361
- return this.lastToken;
3362
- }
3363
- static ɵfac = function HttpXsrfCookieExtractor_Factory(__ngFactoryType__) {
3364
- return new (__ngFactoryType__ || _HttpXsrfCookieExtractor)(ɵɵinject(DOCUMENT), ɵɵinject(XSRF_COOKIE_NAME));
3365
- };
3366
- static ɵprov = ɵɵdefineInjectable({
3367
- token: _HttpXsrfCookieExtractor,
3368
- factory: _HttpXsrfCookieExtractor.ɵfac
3369
- });
3370
- };
3371
- (() => {
3372
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpXsrfCookieExtractor, [{
3373
- type: Injectable
3374
- }], () => [{
3375
- type: void 0,
3376
- decorators: [{
3377
- type: Inject,
3378
- args: [DOCUMENT]
3379
- }]
3380
- }, {
3381
- type: void 0,
3382
- decorators: [{
3383
- type: Inject,
3384
- args: [XSRF_COOKIE_NAME]
3385
- }]
3386
- }], null);
3387
- })();
3388
- function xsrfInterceptorFn(req, next) {
3389
- const lcUrl = req.url.toLowerCase();
3390
- if (!inject(XSRF_ENABLED) || req.method === "GET" || req.method === "HEAD" || lcUrl.startsWith("http://") || lcUrl.startsWith("https://")) {
3391
- return next(req);
3392
- }
3393
- const token = inject(HttpXsrfTokenExtractor).getToken();
3394
- const headerName = inject(XSRF_HEADER_NAME);
3395
- if (token != null && !req.headers.has(headerName)) {
3396
- req = req.clone({
3397
- headers: req.headers.set(headerName, token)
3398
- });
3399
- }
3400
- return next(req);
3401
- }
3402
- var HttpXsrfInterceptor = class _HttpXsrfInterceptor {
3403
- injector;
3404
- constructor(injector) {
3405
- this.injector = injector;
3406
- }
3407
- intercept(initialRequest, next) {
3408
- return runInInjectionContext(this.injector, () => xsrfInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
3409
- }
3410
- static ɵfac = function HttpXsrfInterceptor_Factory(__ngFactoryType__) {
3411
- return new (__ngFactoryType__ || _HttpXsrfInterceptor)(ɵɵinject(EnvironmentInjector));
3412
- };
3413
- static ɵprov = ɵɵdefineInjectable({
3414
- token: _HttpXsrfInterceptor,
3415
- factory: _HttpXsrfInterceptor.ɵfac
3416
- });
3417
- };
3418
- (() => {
3419
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpXsrfInterceptor, [{
3420
- type: Injectable
3421
- }], () => [{
3422
- type: EnvironmentInjector
3423
- }], null);
3424
- })();
3425
- var HttpFeatureKind;
3426
- (function(HttpFeatureKind2) {
3427
- HttpFeatureKind2[HttpFeatureKind2["Interceptors"] = 0] = "Interceptors";
3428
- HttpFeatureKind2[HttpFeatureKind2["LegacyInterceptors"] = 1] = "LegacyInterceptors";
3429
- HttpFeatureKind2[HttpFeatureKind2["CustomXsrfConfiguration"] = 2] = "CustomXsrfConfiguration";
3430
- HttpFeatureKind2[HttpFeatureKind2["NoXsrfProtection"] = 3] = "NoXsrfProtection";
3431
- HttpFeatureKind2[HttpFeatureKind2["JsonpSupport"] = 4] = "JsonpSupport";
3432
- HttpFeatureKind2[HttpFeatureKind2["RequestsMadeViaParent"] = 5] = "RequestsMadeViaParent";
3433
- HttpFeatureKind2[HttpFeatureKind2["Fetch"] = 6] = "Fetch";
3434
- })(HttpFeatureKind || (HttpFeatureKind = {}));
3435
- function makeHttpFeature(kind, providers) {
3436
- return {
3437
- ɵkind: kind,
3438
- ɵproviders: providers
3439
- };
3440
- }
3441
- function provideHttpClient(...features) {
3442
- if (ngDevMode) {
3443
- const featureKinds = new Set(features.map((f) => f.ɵkind));
3444
- if (featureKinds.has(HttpFeatureKind.NoXsrfProtection) && featureKinds.has(HttpFeatureKind.CustomXsrfConfiguration)) {
3445
- throw new Error(ngDevMode ? `Configuration error: found both withXsrfConfiguration() and withNoXsrfProtection() in the same call to provideHttpClient(), which is a contradiction.` : "");
3446
- }
3447
- }
3448
- const providers = [HttpClient, HttpXhrBackend, HttpInterceptorHandler, {
3449
- provide: HttpHandler,
3450
- useExisting: HttpInterceptorHandler
3451
- }, {
3452
- provide: HttpBackend,
3453
- useFactory: () => {
3454
- return inject(FETCH_BACKEND, {
3455
- optional: true
3456
- }) ?? inject(HttpXhrBackend);
3457
- }
3458
- }, {
3459
- provide: HTTP_INTERCEPTOR_FNS,
3460
- useValue: xsrfInterceptorFn,
3461
- multi: true
3462
- }, {
3463
- provide: XSRF_ENABLED,
3464
- useValue: true
3465
- }, {
3466
- provide: HttpXsrfTokenExtractor,
3467
- useClass: HttpXsrfCookieExtractor
3468
- }];
3469
- for (const feature of features) {
3470
- providers.push(...feature.ɵproviders);
3471
- }
3472
- return makeEnvironmentProviders(providers);
3473
- }
3474
- var LEGACY_INTERCEPTOR_FN = new InjectionToken(ngDevMode ? "LEGACY_INTERCEPTOR_FN" : "");
3475
- function withInterceptorsFromDi() {
3476
- return makeHttpFeature(HttpFeatureKind.LegacyInterceptors, [{
3477
- provide: LEGACY_INTERCEPTOR_FN,
3478
- useFactory: legacyInterceptorFnFactory
3479
- }, {
3480
- provide: HTTP_INTERCEPTOR_FNS,
3481
- useExisting: LEGACY_INTERCEPTOR_FN,
3482
- multi: true
3483
- }]);
3484
- }
3485
- function withXsrfConfiguration({
3486
- cookieName,
3487
- headerName
3488
- }) {
3489
- const providers = [];
3490
- if (cookieName !== void 0) {
3491
- providers.push({
3492
- provide: XSRF_COOKIE_NAME,
3493
- useValue: cookieName
3494
- });
3495
- }
3496
- if (headerName !== void 0) {
3497
- providers.push({
3498
- provide: XSRF_HEADER_NAME,
3499
- useValue: headerName
3500
- });
3501
- }
3502
- return makeHttpFeature(HttpFeatureKind.CustomXsrfConfiguration, providers);
3503
- }
3504
- function withNoXsrfProtection() {
3505
- return makeHttpFeature(HttpFeatureKind.NoXsrfProtection, [{
3506
- provide: XSRF_ENABLED,
3507
- useValue: false
3508
- }]);
3509
- }
3510
- function withJsonpSupport() {
3511
- return makeHttpFeature(HttpFeatureKind.JsonpSupport, [JsonpClientBackend, {
3512
- provide: JsonpCallbackContext,
3513
- useFactory: jsonpCallbackContext
3514
- }, {
3515
- provide: HTTP_INTERCEPTOR_FNS,
3516
- useValue: jsonpInterceptorFn,
3517
- multi: true
3518
- }]);
3519
- }
3520
- var HttpClientXsrfModule = class _HttpClientXsrfModule {
3521
- /**
3522
- * Disable the default XSRF protection.
3523
- */
3524
- static disable() {
3525
- return {
3526
- ngModule: _HttpClientXsrfModule,
3527
- providers: [withNoXsrfProtection().ɵproviders]
3528
- };
3529
- }
3530
- /**
3531
- * Configure XSRF protection.
3532
- * @param options An object that can specify either or both
3533
- * cookie name or header name.
3534
- * - Cookie name default is `XSRF-TOKEN`.
3535
- * - Header name default is `X-XSRF-TOKEN`.
3536
- *
3537
- */
3538
- static withOptions(options = {}) {
3539
- return {
3540
- ngModule: _HttpClientXsrfModule,
3541
- providers: withXsrfConfiguration(options).ɵproviders
3542
- };
3543
- }
3544
- static ɵfac = function HttpClientXsrfModule_Factory(__ngFactoryType__) {
3545
- return new (__ngFactoryType__ || _HttpClientXsrfModule)();
3546
- };
3547
- static ɵmod = ɵɵdefineNgModule({
3548
- type: _HttpClientXsrfModule
3549
- });
3550
- static ɵinj = ɵɵdefineInjector({
3551
- providers: [HttpXsrfInterceptor, {
3552
- provide: HTTP_INTERCEPTORS,
3553
- useExisting: HttpXsrfInterceptor,
3554
- multi: true
3555
- }, {
3556
- provide: HttpXsrfTokenExtractor,
3557
- useClass: HttpXsrfCookieExtractor
3558
- }, withXsrfConfiguration({
3559
- cookieName: XSRF_DEFAULT_COOKIE_NAME,
3560
- headerName: XSRF_DEFAULT_HEADER_NAME
3561
- }).ɵproviders, {
3562
- provide: XSRF_ENABLED,
3563
- useValue: true
3564
- }]
3565
- });
3566
- };
3567
- (() => {
3568
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpClientXsrfModule, [{
3569
- type: NgModule,
3570
- args: [{
3571
- providers: [HttpXsrfInterceptor, {
3572
- provide: HTTP_INTERCEPTORS,
3573
- useExisting: HttpXsrfInterceptor,
3574
- multi: true
3575
- }, {
3576
- provide: HttpXsrfTokenExtractor,
3577
- useClass: HttpXsrfCookieExtractor
3578
- }, withXsrfConfiguration({
3579
- cookieName: XSRF_DEFAULT_COOKIE_NAME,
3580
- headerName: XSRF_DEFAULT_HEADER_NAME
3581
- }).ɵproviders, {
3582
- provide: XSRF_ENABLED,
3583
- useValue: true
3584
- }]
3585
- }]
3586
- }], null, null);
3587
- })();
3588
- var HttpClientModule = class _HttpClientModule {
3589
- static ɵfac = function HttpClientModule_Factory(__ngFactoryType__) {
3590
- return new (__ngFactoryType__ || _HttpClientModule)();
3591
- };
3592
- static ɵmod = ɵɵdefineNgModule({
3593
- type: _HttpClientModule
3594
- });
3595
- static ɵinj = ɵɵdefineInjector({
3596
- providers: [provideHttpClient(withInterceptorsFromDi())]
3597
- });
3598
- };
3599
- (() => {
3600
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpClientModule, [{
3601
- type: NgModule,
3602
- args: [{
3603
- /**
3604
- * Configures the dependency injector where it is imported
3605
- * with supporting services for HTTP communications.
3606
- */
3607
- providers: [provideHttpClient(withInterceptorsFromDi())]
3608
- }]
3609
- }], null, null);
3610
- })();
3611
- var HttpClientJsonpModule = class _HttpClientJsonpModule {
3612
- static ɵfac = function HttpClientJsonpModule_Factory(__ngFactoryType__) {
3613
- return new (__ngFactoryType__ || _HttpClientJsonpModule)();
3614
- };
3615
- static ɵmod = ɵɵdefineNgModule({
3616
- type: _HttpClientJsonpModule
3617
- });
3618
- static ɵinj = ɵɵdefineInjector({
3619
- providers: [withJsonpSupport().ɵproviders]
3620
- });
3621
- };
3622
- (() => {
3623
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpClientJsonpModule, [{
3624
- type: NgModule,
3625
- args: [{
3626
- providers: [withJsonpSupport().ɵproviders]
3627
- }]
3628
- }], null, null);
3629
- })();
3630
-
3631
- // node_modules/@angular/common/fesm2022/http.mjs
3632
- var httpResource = (() => {
3633
- const jsonFn = makeHttpResourceFn("json");
3634
- jsonFn.arrayBuffer = makeHttpResourceFn("arraybuffer");
3635
- jsonFn.blob = makeHttpResourceFn("blob");
3636
- jsonFn.text = makeHttpResourceFn("text");
3637
- return jsonFn;
3638
- })();
3639
- function makeHttpResourceFn(responseType) {
3640
- return function httpResource2(request, options) {
3641
- if (ngDevMode && !options?.injector) {
3642
- assertInInjectionContext(httpResource2);
3643
- }
3644
- const injector = options?.injector ?? inject(Injector);
3645
- return new HttpResourceImpl(injector, () => normalizeRequest(request, responseType), options?.defaultValue, options?.parse, options?.equal);
3646
- };
3647
- }
3648
- function normalizeRequest(request, responseType) {
3649
- let unwrappedRequest = typeof request === "function" ? request() : request;
3650
- if (unwrappedRequest === void 0) {
3651
- return void 0;
3652
- } else if (typeof unwrappedRequest === "string") {
3653
- unwrappedRequest = { url: unwrappedRequest };
3654
- }
3655
- const headers = unwrappedRequest.headers instanceof HttpHeaders ? unwrappedRequest.headers : new HttpHeaders(unwrappedRequest.headers);
3656
- const params = unwrappedRequest.params instanceof HttpParams ? unwrappedRequest.params : new HttpParams({ fromObject: unwrappedRequest.params });
3657
- return new HttpRequest(unwrappedRequest.method ?? "GET", unwrappedRequest.url, unwrappedRequest.body ?? null, {
3658
- headers,
3659
- params,
3660
- reportProgress: unwrappedRequest.reportProgress,
3661
- withCredentials: unwrappedRequest.withCredentials,
3662
- keepalive: unwrappedRequest.keepalive,
3663
- cache: unwrappedRequest.cache,
3664
- priority: unwrappedRequest.priority,
3665
- mode: unwrappedRequest.mode,
3666
- redirect: unwrappedRequest.redirect,
3667
- responseType,
3668
- context: unwrappedRequest.context,
3669
- transferCache: unwrappedRequest.transferCache,
3670
- credentials: unwrappedRequest.credentials,
3671
- referrer: unwrappedRequest.referrer,
3672
- integrity: unwrappedRequest.integrity,
3673
- timeout: unwrappedRequest.timeout
3674
- });
3675
- }
3676
- var HttpResourceImpl = class extends ResourceImpl {
3677
- client;
3678
- _headers = linkedSignal(...ngDevMode ? [{
3679
- debugName: "_headers",
3680
- source: this.extRequest,
3681
- computation: () => void 0
3682
- }] : [{
3683
- source: this.extRequest,
3684
- computation: () => void 0
3685
- }]);
3686
- _progress = linkedSignal(...ngDevMode ? [{
3687
- debugName: "_progress",
3688
- source: this.extRequest,
3689
- computation: () => void 0
3690
- }] : [{
3691
- source: this.extRequest,
3692
- computation: () => void 0
3693
- }]);
3694
- _statusCode = linkedSignal(...ngDevMode ? [{
3695
- debugName: "_statusCode",
3696
- source: this.extRequest,
3697
- computation: () => void 0
3698
- }] : [{
3699
- source: this.extRequest,
3700
- computation: () => void 0
3701
- }]);
3702
- headers = computed(() => this.status() === "resolved" || this.status() === "error" ? this._headers() : void 0, ...ngDevMode ? [{ debugName: "headers" }] : []);
3703
- progress = this._progress.asReadonly();
3704
- statusCode = this._statusCode.asReadonly();
3705
- constructor(injector, request, defaultValue, parse, equal) {
3706
- super(request, ({ params: request2, abortSignal }) => {
3707
- let sub;
3708
- const onAbort = () => sub.unsubscribe();
3709
- abortSignal.addEventListener("abort", onAbort);
3710
- const stream = signal({ value: void 0 }, ...ngDevMode ? [{ debugName: "stream" }] : []);
3711
- let resolve;
3712
- const promise = new Promise((r) => resolve = r);
3713
- const send = (value) => {
3714
- stream.set(value);
3715
- resolve?.(stream);
3716
- resolve = void 0;
3717
- };
3718
- sub = this.client.request(request2).subscribe({
3719
- next: (event) => {
3720
- switch (event.type) {
3721
- case HttpEventType.Response:
3722
- this._headers.set(event.headers);
3723
- this._statusCode.set(event.status);
3724
- try {
3725
- send({ value: parse ? parse(event.body) : event.body });
3726
- } catch (error) {
3727
- send({ error: encapsulateResourceError(error) });
3728
- }
3729
- break;
3730
- case HttpEventType.DownloadProgress:
3731
- this._progress.set(event);
3732
- break;
3733
- }
3734
- },
3735
- error: (error) => {
3736
- if (error instanceof HttpErrorResponse) {
3737
- this._headers.set(error.headers);
3738
- this._statusCode.set(error.status);
3739
- }
3740
- send({ error });
3741
- abortSignal.removeEventListener("abort", onAbort);
3742
- },
3743
- complete: () => {
3744
- if (resolve) {
3745
- send({
3746
- error: new RuntimeError(991, ngDevMode && "Resource completed before producing a value")
3747
- });
3748
- }
3749
- abortSignal.removeEventListener("abort", onAbort);
3750
- }
3751
- });
3752
- return promise;
3753
- }, defaultValue, equal, injector);
3754
- this.client = injector.get(HttpClient);
3755
- }
3756
- set(value) {
3757
- super.set(value);
3758
- this._headers.set(void 0);
3759
- this._progress.set(void 0);
3760
- this._statusCode.set(void 0);
3761
- }
3762
- };
3763
- var HTTP_TRANSFER_CACHE_ORIGIN_MAP = new InjectionToken(ngDevMode ? "HTTP_TRANSFER_CACHE_ORIGIN_MAP" : "");
3764
- var BODY = "b";
3765
- var HEADERS = "h";
3766
- var STATUS = "s";
3767
- var STATUS_TEXT = "st";
3768
- var REQ_URL = "u";
3769
- var RESPONSE_TYPE = "rt";
3770
- var CACHE_OPTIONS = new InjectionToken(ngDevMode ? "HTTP_TRANSFER_STATE_CACHE_OPTIONS" : "");
3771
- var ALLOWED_METHODS = ["GET", "HEAD"];
3772
- function transferCacheInterceptorFn(req, next) {
3773
- const _a = inject(CACHE_OPTIONS), { isCacheActive } = _a, globalOptions = __objRest(_a, ["isCacheActive"]);
3774
- const { transferCache: requestOptions, method: requestMethod } = req;
3775
- if (!isCacheActive || requestOptions === false || // POST requests are allowed either globally or at request level
3776
- requestMethod === "POST" && !globalOptions.includePostRequests && !requestOptions || requestMethod !== "POST" && !ALLOWED_METHODS.includes(requestMethod) || // Do not cache request that require authorization when includeRequestsWithAuthHeaders is falsey
3777
- !globalOptions.includeRequestsWithAuthHeaders && hasAuthHeaders(req) || globalOptions.filter?.(req) === false) {
3778
- return next(req);
3779
- }
3780
- const transferState = inject(TransferState);
3781
- const originMap = inject(HTTP_TRANSFER_CACHE_ORIGIN_MAP, {
3782
- optional: true
3783
- });
3784
- if (originMap) {
3785
- throw new RuntimeError(2803, ngDevMode && "Angular detected that the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token is configured and present in the client side code. Please ensure that this token is only provided in the server code of the application.");
3786
- }
3787
- const requestUrl = false ? mapRequestOriginUrl(req.url, originMap) : req.url;
3788
- const storeKey = makeCacheKey(req, requestUrl);
3789
- const response = transferState.get(storeKey, null);
3790
- let headersToInclude = globalOptions.includeHeaders;
3791
- if (typeof requestOptions === "object" && requestOptions.includeHeaders) {
3792
- headersToInclude = requestOptions.includeHeaders;
3793
- }
3794
- if (response) {
3795
- const { [BODY]: undecodedBody, [RESPONSE_TYPE]: responseType, [HEADERS]: httpHeaders, [STATUS]: status, [STATUS_TEXT]: statusText, [REQ_URL]: url } = response;
3796
- let body = undecodedBody;
3797
- switch (responseType) {
3798
- case "arraybuffer":
3799
- body = new TextEncoder().encode(undecodedBody).buffer;
3800
- break;
3801
- case "blob":
3802
- body = new Blob([undecodedBody]);
3803
- break;
3804
- }
3805
- let headers = new HttpHeaders(httpHeaders);
3806
- if (typeof ngDevMode === "undefined" || ngDevMode) {
3807
- headers = appendMissingHeadersDetection(req.url, headers, headersToInclude ?? []);
3808
- }
3809
- return of(new HttpResponse({
3810
- body,
3811
- headers,
3812
- status,
3813
- statusText,
3814
- url
3815
- }));
3816
- }
3817
- const event$ = next(req);
3818
- if (false) {
3819
- return event$.pipe(tap((event) => {
3820
- if (event instanceof HttpResponse) {
3821
- transferState.set(storeKey, {
3822
- [BODY]: event.body,
3823
- [HEADERS]: getFilteredHeaders(event.headers, headersToInclude),
3824
- [STATUS]: event.status,
3825
- [STATUS_TEXT]: event.statusText,
3826
- [REQ_URL]: requestUrl,
3827
- [RESPONSE_TYPE]: req.responseType
3828
- });
3829
- }
3830
- }));
3831
- }
3832
- return event$;
3833
- }
3834
- function hasAuthHeaders(req) {
3835
- return req.headers.has("authorization") || req.headers.has("proxy-authorization");
3836
- }
3837
- function sortAndConcatParams(params) {
3838
- return [...params.keys()].sort().map((k) => `${k}=${params.getAll(k)}`).join("&");
3839
- }
3840
- function makeCacheKey(request, mappedRequestUrl) {
3841
- const { params, method, responseType } = request;
3842
- const encodedParams = sortAndConcatParams(params);
3843
- let serializedBody = request.serializeBody();
3844
- if (serializedBody instanceof URLSearchParams) {
3845
- serializedBody = sortAndConcatParams(serializedBody);
3846
- } else if (typeof serializedBody !== "string") {
3847
- serializedBody = "";
3848
- }
3849
- const key = [method, responseType, mappedRequestUrl, serializedBody, encodedParams].join("|");
3850
- const hash = generateHash(key);
3851
- return makeStateKey(hash);
3852
- }
3853
- function generateHash(value) {
3854
- let hash = 0;
3855
- for (const char of value) {
3856
- hash = Math.imul(31, hash) + char.charCodeAt(0) << 0;
3857
- }
3858
- hash += 2147483647 + 1;
3859
- return hash.toString();
3860
- }
3861
- function withHttpTransferCache(cacheOptions) {
3862
- return [
3863
- {
3864
- provide: CACHE_OPTIONS,
3865
- useFactory: () => {
3866
- performanceMarkFeature("NgHttpTransferCache");
3867
- return __spreadValues({ isCacheActive: true }, cacheOptions);
3868
- }
3869
- },
3870
- {
3871
- provide: HTTP_ROOT_INTERCEPTOR_FNS,
3872
- useValue: transferCacheInterceptorFn,
3873
- multi: true
3874
- },
3875
- {
3876
- provide: APP_BOOTSTRAP_LISTENER,
3877
- multi: true,
3878
- useFactory: () => {
3879
- const appRef = inject(ApplicationRef);
3880
- const cacheState = inject(CACHE_OPTIONS);
3881
- return () => {
3882
- appRef.whenStable().then(() => {
3883
- cacheState.isCacheActive = false;
3884
- });
3885
- };
3886
- }
3887
- }
3888
- ];
3889
- }
3890
- function appendMissingHeadersDetection(url, headers, headersToInclude) {
3891
- const warningProduced = /* @__PURE__ */ new Set();
3892
- return new Proxy(headers, {
3893
- get(target, prop) {
3894
- const value = Reflect.get(target, prop);
3895
- const methods = /* @__PURE__ */ new Set(["get", "has", "getAll"]);
3896
- if (typeof value !== "function" || !methods.has(prop)) {
3897
- return value;
3898
- }
3899
- return (headerName) => {
3900
- const key = (prop + ":" + headerName).toLowerCase();
3901
- if (!headersToInclude.includes(headerName) && !warningProduced.has(key)) {
3902
- warningProduced.add(key);
3903
- const truncatedUrl = truncateMiddle(url);
3904
- console.warn(formatRuntimeError(-2802, `Angular detected that the \`${headerName}\` header is accessed, but the value of the header was not transferred from the server to the client by the HttpTransferCache. To include the value of the \`${headerName}\` header for the \`${truncatedUrl}\` request, use the \`includeHeaders\` list. The \`includeHeaders\` can be defined either on a request level by adding the \`transferCache\` parameter, or on an application level by adding the \`httpCacheTransfer.includeHeaders\` argument to the \`provideClientHydration()\` call. `));
3905
- }
3906
- return value.apply(target, [headerName]);
3907
- };
3908
- }
3909
- });
3910
- }
3911
-
3912
- // node_modules/@angular/platform-browser/fesm2022/platform-browser.mjs
3913
- var Meta = class _Meta {
3914
- _doc;
3915
- _dom;
3916
- constructor(_doc) {
3917
- this._doc = _doc;
3918
- this._dom = getDOM();
3919
- }
3920
- /**
3921
- * Retrieves or creates a specific `<meta>` tag element in the current HTML document.
3922
- * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute
3923
- * values in the provided tag definition, and verifies that all other attribute values are equal.
3924
- * If an existing element is found, it is returned and is not modified in any way.
3925
- * @param tag The definition of a `<meta>` element to match or create.
3926
- * @param forceCreation True to create a new element without checking whether one already exists.
3927
- * @returns The existing element with the same attributes and values if found,
3928
- * the new element if no match is found, or `null` if the tag parameter is not defined.
3929
- */
3930
- addTag(tag, forceCreation = false) {
3931
- if (!tag) return null;
3932
- return this._getOrCreateElement(tag, forceCreation);
3933
- }
3934
- /**
3935
- * Retrieves or creates a set of `<meta>` tag elements in the current HTML document.
3936
- * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute
3937
- * values in the provided tag definition, and verifies that all other attribute values are equal.
3938
- * @param tags An array of tag definitions to match or create.
3939
- * @param forceCreation True to create new elements without checking whether they already exist.
3940
- * @returns The matching elements if found, or the new elements.
3941
- */
3942
- addTags(tags, forceCreation = false) {
3943
- if (!tags) return [];
3944
- return tags.reduce((result, tag) => {
3945
- if (tag) {
3946
- result.push(this._getOrCreateElement(tag, forceCreation));
3947
- }
3948
- return result;
3949
- }, []);
3950
- }
3951
- /**
3952
- * Retrieves a `<meta>` tag element in the current HTML document.
3953
- * @param attrSelector The tag attribute and value to match against, in the format
3954
- * `"tag_attribute='value string'"`.
3955
- * @returns The matching element, if any.
3956
- */
3957
- getTag(attrSelector) {
3958
- if (!attrSelector) return null;
3959
- return this._doc.querySelector(`meta[${attrSelector}]`) || null;
3960
- }
3961
- /**
3962
- * Retrieves a set of `<meta>` tag elements in the current HTML document.
3963
- * @param attrSelector The tag attribute and value to match against, in the format
3964
- * `"tag_attribute='value string'"`.
3965
- * @returns The matching elements, if any.
3966
- */
3967
- getTags(attrSelector) {
3968
- if (!attrSelector) return [];
3969
- const list = this._doc.querySelectorAll(`meta[${attrSelector}]`);
3970
- return list ? [].slice.call(list) : [];
3971
- }
3972
- /**
3973
- * Modifies an existing `<meta>` tag element in the current HTML document.
3974
- * @param tag The tag description with which to replace the existing tag content.
3975
- * @param selector A tag attribute and value to match against, to identify
3976
- * an existing tag. A string in the format `"tag_attribute=`value string`"`.
3977
- * If not supplied, matches a tag with the same `name` or `property` attribute value as the
3978
- * replacement tag.
3979
- * @return The modified element.
3980
- */
3981
- updateTag(tag, selector) {
3982
- if (!tag) return null;
3983
- selector = selector || this._parseSelector(tag);
3984
- const meta = this.getTag(selector);
3985
- if (meta) {
3986
- return this._setMetaElementAttributes(tag, meta);
3987
- }
3988
- return this._getOrCreateElement(tag, true);
3989
- }
3990
- /**
3991
- * Removes an existing `<meta>` tag element from the current HTML document.
3992
- * @param attrSelector A tag attribute and value to match against, to identify
3993
- * an existing tag. A string in the format `"tag_attribute=`value string`"`.
3994
- */
3995
- removeTag(attrSelector) {
3996
- this.removeTagElement(this.getTag(attrSelector));
3997
- }
3998
- /**
3999
- * Removes an existing `<meta>` tag element from the current HTML document.
4000
- * @param meta The tag definition to match against to identify an existing tag.
4001
- */
4002
- removeTagElement(meta) {
4003
- if (meta) {
4004
- this._dom.remove(meta);
4005
- }
4006
- }
4007
- _getOrCreateElement(meta, forceCreation = false) {
4008
- if (!forceCreation) {
4009
- const selector = this._parseSelector(meta);
4010
- const elem = this.getTags(selector).filter((elem2) => this._containsAttributes(meta, elem2))[0];
4011
- if (elem !== void 0) return elem;
4012
- }
4013
- const element = this._dom.createElement("meta");
4014
- this._setMetaElementAttributes(meta, element);
4015
- const head = this._doc.getElementsByTagName("head")[0];
4016
- head.appendChild(element);
4017
- return element;
4018
- }
4019
- _setMetaElementAttributes(tag, el) {
4020
- Object.keys(tag).forEach((prop) => el.setAttribute(this._getMetaKeyMap(prop), tag[prop]));
4021
- return el;
4022
- }
4023
- _parseSelector(tag) {
4024
- const attr = tag.name ? "name" : "property";
4025
- return `${attr}="${tag[attr]}"`;
4026
- }
4027
- _containsAttributes(tag, elem) {
4028
- return Object.keys(tag).every((key) => elem.getAttribute(this._getMetaKeyMap(key)) === tag[key]);
4029
- }
4030
- _getMetaKeyMap(prop) {
4031
- return META_KEYS_MAP[prop] || prop;
4032
- }
4033
- static ɵfac = function Meta_Factory(__ngFactoryType__) {
4034
- return new (__ngFactoryType__ || _Meta)(ɵɵinject(DOCUMENT));
4035
- };
4036
- static ɵprov = ɵɵdefineInjectable({
4037
- token: _Meta,
4038
- factory: _Meta.ɵfac,
4039
- providedIn: "root"
4040
- });
4041
- };
4042
- (() => {
4043
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Meta, [{
4044
- type: Injectable,
4045
- args: [{
4046
- providedIn: "root"
4047
- }]
4048
- }], () => [{
4049
- type: void 0,
4050
- decorators: [{
4051
- type: Inject,
4052
- args: [DOCUMENT]
4053
- }]
4054
- }], null);
4055
- })();
4056
- var META_KEYS_MAP = {
4057
- httpEquiv: "http-equiv"
4058
- };
4059
- var Title = class _Title {
4060
- _doc;
4061
- constructor(_doc) {
4062
- this._doc = _doc;
4063
- }
4064
- /**
4065
- * Get the title of the current HTML document.
4066
- */
4067
- getTitle() {
4068
- return this._doc.title;
4069
- }
4070
- /**
4071
- * Set the title of the current HTML document.
4072
- * @param newTitle
4073
- */
4074
- setTitle(newTitle) {
4075
- this._doc.title = newTitle || "";
4076
- }
4077
- static ɵfac = function Title_Factory(__ngFactoryType__) {
4078
- return new (__ngFactoryType__ || _Title)(ɵɵinject(DOCUMENT));
4079
- };
4080
- static ɵprov = ɵɵdefineInjectable({
4081
- token: _Title,
4082
- factory: _Title.ɵfac,
4083
- providedIn: "root"
4084
- });
4085
- };
4086
- (() => {
4087
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Title, [{
4088
- type: Injectable,
4089
- args: [{
4090
- providedIn: "root"
4091
- }]
4092
- }], () => [{
4093
- type: void 0,
4094
- decorators: [{
4095
- type: Inject,
4096
- args: [DOCUMENT]
4097
- }]
4098
- }], null);
4099
- })();
4100
- function exportNgVar(name, value) {
4101
- if (typeof COMPILED === "undefined" || !COMPILED) {
4102
- const ng = _global["ng"] = _global["ng"] || {};
4103
- ng[name] = value;
4104
- }
4105
- }
4106
- var ChangeDetectionPerfRecord = class {
4107
- msPerTick;
4108
- numTicks;
4109
- constructor(msPerTick, numTicks) {
4110
- this.msPerTick = msPerTick;
4111
- this.numTicks = numTicks;
4112
- }
4113
- };
4114
- var AngularProfiler = class {
4115
- appRef;
4116
- constructor(ref) {
4117
- this.appRef = ref.injector.get(ApplicationRef);
4118
- }
4119
- // tslint:disable:no-console
4120
- /**
4121
- * Exercises change detection in a loop and then prints the average amount of
4122
- * time in milliseconds how long a single round of change detection takes for
4123
- * the current state of the UI. It runs a minimum of 5 rounds for a minimum
4124
- * of 500 milliseconds.
4125
- *
4126
- * Optionally, a user may pass a `config` parameter containing a map of
4127
- * options. Supported options are:
4128
- *
4129
- * `record` (boolean) - causes the profiler to record a CPU profile while
4130
- * it exercises the change detector. Example:
4131
- *
4132
- * ```ts
4133
- * ng.profiler.timeChangeDetection({record: true})
4134
- * ```
4135
- */
4136
- timeChangeDetection(config) {
4137
- const record = config && config["record"];
4138
- const profileName = "Change Detection";
4139
- if (record && "profile" in console && typeof console.profile === "function") {
4140
- console.profile(profileName);
4141
- }
4142
- const start = performance.now();
4143
- let numTicks = 0;
4144
- while (numTicks < 5 || performance.now() - start < 500) {
4145
- this.appRef.tick();
4146
- numTicks++;
4147
- }
4148
- const end = performance.now();
4149
- if (record && "profileEnd" in console && typeof console.profileEnd === "function") {
4150
- console.profileEnd(profileName);
4151
- }
4152
- const msPerTick = (end - start) / numTicks;
4153
- console.log(`ran ${numTicks} change detection cycles`);
4154
- console.log(`${msPerTick.toFixed(2)} ms per check`);
4155
- return new ChangeDetectionPerfRecord(msPerTick, numTicks);
4156
- }
4157
- };
4158
- var PROFILER_GLOBAL_NAME = "profiler";
4159
- function enableDebugTools(ref) {
4160
- exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));
4161
- return ref;
4162
- }
4163
- function disableDebugTools() {
4164
- exportNgVar(PROFILER_GLOBAL_NAME, null);
4165
- }
4166
- var By = class {
4167
- /**
4168
- * Match all nodes.
4169
- *
4170
- * @usageNotes
4171
- * ### Example
4172
- *
4173
- * {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}
4174
- */
4175
- static all() {
4176
- return () => true;
4177
- }
4178
- /**
4179
- * Match elements by the given CSS selector.
4180
- *
4181
- * @usageNotes
4182
- * ### Example
4183
- *
4184
- * {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}
4185
- */
4186
- static css(selector) {
4187
- return (debugElement) => {
4188
- return debugElement.nativeElement != null ? elementMatches(debugElement.nativeElement, selector) : false;
4189
- };
4190
- }
4191
- /**
4192
- * Match nodes that have the given directive present.
4193
- *
4194
- * @usageNotes
4195
- * ### Example
4196
- *
4197
- * {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}
4198
- */
4199
- static directive(type) {
4200
- return (debugNode) => debugNode.providerTokens.indexOf(type) !== -1;
4201
- }
4202
- };
4203
- function elementMatches(n, selector) {
4204
- if (getDOM().isElementNode(n)) {
4205
- return n.matches && n.matches(selector) || n.msMatchesSelector && n.msMatchesSelector(selector) || n.webkitMatchesSelector && n.webkitMatchesSelector(selector);
4206
- }
4207
- return false;
4208
- }
4209
- var EVENT_NAMES = {
4210
- // pan
4211
- "pan": true,
4212
- "panstart": true,
4213
- "panmove": true,
4214
- "panend": true,
4215
- "pancancel": true,
4216
- "panleft": true,
4217
- "panright": true,
4218
- "panup": true,
4219
- "pandown": true,
4220
- // pinch
4221
- "pinch": true,
4222
- "pinchstart": true,
4223
- "pinchmove": true,
4224
- "pinchend": true,
4225
- "pinchcancel": true,
4226
- "pinchin": true,
4227
- "pinchout": true,
4228
- // press
4229
- "press": true,
4230
- "pressup": true,
4231
- // rotate
4232
- "rotate": true,
4233
- "rotatestart": true,
4234
- "rotatemove": true,
4235
- "rotateend": true,
4236
- "rotatecancel": true,
4237
- // swipe
4238
- "swipe": true,
4239
- "swipeleft": true,
4240
- "swiperight": true,
4241
- "swipeup": true,
4242
- "swipedown": true,
4243
- // tap
4244
- "tap": true,
4245
- "doubletap": true
4246
- };
4247
- var HAMMER_GESTURE_CONFIG = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "HammerGestureConfig" : "");
4248
- var HAMMER_LOADER = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "HammerLoader" : "");
4249
- var HammerGestureConfig = class _HammerGestureConfig {
4250
- /**
4251
- * A set of supported event names for gestures to be used in Angular.
4252
- * Angular supports all built-in recognizers, as listed in
4253
- * [HammerJS documentation](https://hammerjs.github.io/).
4254
- */
4255
- events = [];
4256
- /**
4257
- * Maps gesture event names to a set of configuration options
4258
- * that specify overrides to the default values for specific properties.
4259
- *
4260
- * The key is a supported event name to be configured,
4261
- * and the options object contains a set of properties, with override values
4262
- * to be applied to the named recognizer event.
4263
- * For example, to disable recognition of the rotate event, specify
4264
- * `{"rotate": {"enable": false}}`.
4265
- *
4266
- * Properties that are not present take the HammerJS default values.
4267
- * For information about which properties are supported for which events,
4268
- * and their allowed and default values, see
4269
- * [HammerJS documentation](https://hammerjs.github.io/).
4270
- *
4271
- */
4272
- overrides = {};
4273
- /**
4274
- * Properties whose default values can be overridden for a given event.
4275
- * Different sets of properties apply to different events.
4276
- * For information about which properties are supported for which events,
4277
- * and their allowed and default values, see
4278
- * [HammerJS documentation](https://hammerjs.github.io/).
4279
- */
4280
- options;
4281
- /**
4282
- * Creates a [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
4283
- * and attaches it to a given HTML element.
4284
- * @param element The element that will recognize gestures.
4285
- * @returns A HammerJS event-manager object.
4286
- */
4287
- buildHammer(element) {
4288
- const mc = new Hammer(element, this.options);
4289
- mc.get("pinch").set({
4290
- enable: true
4291
- });
4292
- mc.get("rotate").set({
4293
- enable: true
4294
- });
4295
- for (const eventName in this.overrides) {
4296
- mc.get(eventName).set(this.overrides[eventName]);
4297
- }
4298
- return mc;
4299
- }
4300
- static ɵfac = function HammerGestureConfig_Factory(__ngFactoryType__) {
4301
- return new (__ngFactoryType__ || _HammerGestureConfig)();
4302
- };
4303
- static ɵprov = ɵɵdefineInjectable({
4304
- token: _HammerGestureConfig,
4305
- factory: _HammerGestureConfig.ɵfac
4306
- });
4307
- };
4308
- (() => {
4309
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HammerGestureConfig, [{
4310
- type: Injectable
4311
- }], null, null);
4312
- })();
4313
- var HammerGesturesPlugin = class _HammerGesturesPlugin extends EventManagerPlugin {
4314
- _config;
4315
- _injector;
4316
- loader;
4317
- _loaderPromise = null;
4318
- constructor(doc, _config, _injector, loader) {
4319
- super(doc);
4320
- this._config = _config;
4321
- this._injector = _injector;
4322
- this.loader = loader;
4323
- }
4324
- supports(eventName) {
4325
- if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {
4326
- return false;
4327
- }
4328
- if (!window.Hammer && !this.loader) {
4329
- if (typeof ngDevMode === "undefined" || ngDevMode) {
4330
- const _console = this._injector.get(Console);
4331
- _console.warn(`The "${eventName}" event cannot be bound because Hammer.JS is not loaded and no custom loader has been specified.`);
4332
- }
4333
- return false;
4334
- }
4335
- return true;
4336
- }
4337
- addEventListener(element, eventName, handler) {
4338
- const zone = this.manager.getZone();
4339
- eventName = eventName.toLowerCase();
4340
- if (!window.Hammer && this.loader) {
4341
- this._loaderPromise = this._loaderPromise || zone.runOutsideAngular(() => this.loader());
4342
- let cancelRegistration = false;
4343
- let deregister = () => {
4344
- cancelRegistration = true;
4345
- };
4346
- zone.runOutsideAngular(() => this._loaderPromise.then(() => {
4347
- if (!window.Hammer) {
4348
- if (typeof ngDevMode === "undefined" || ngDevMode) {
4349
- const _console = this._injector.get(Console);
4350
- _console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`);
4351
- }
4352
- deregister = () => {
4353
- };
4354
- return;
4355
- }
4356
- if (!cancelRegistration) {
4357
- deregister = this.addEventListener(element, eventName, handler);
4358
- }
4359
- }).catch(() => {
4360
- if (typeof ngDevMode === "undefined" || ngDevMode) {
4361
- const _console = this._injector.get(Console);
4362
- _console.warn(`The "${eventName}" event cannot be bound because the custom Hammer.JS loader failed.`);
4363
- }
4364
- deregister = () => {
4365
- };
4366
- }));
4367
- return () => {
4368
- deregister();
4369
- };
4370
- }
4371
- return zone.runOutsideAngular(() => {
4372
- const mc = this._config.buildHammer(element);
4373
- const callback = function(eventObj) {
4374
- zone.runGuarded(function() {
4375
- handler(eventObj);
4376
- });
4377
- };
4378
- mc.on(eventName, callback);
4379
- return () => {
4380
- mc.off(eventName, callback);
4381
- if (typeof mc.destroy === "function") {
4382
- mc.destroy();
4383
- }
4384
- };
4385
- });
4386
- }
4387
- isCustomEvent(eventName) {
4388
- return this._config.events.indexOf(eventName) > -1;
4389
- }
4390
- static ɵfac = function HammerGesturesPlugin_Factory(__ngFactoryType__) {
4391
- return new (__ngFactoryType__ || _HammerGesturesPlugin)(ɵɵinject(DOCUMENT), ɵɵinject(HAMMER_GESTURE_CONFIG), ɵɵinject(Injector), ɵɵinject(HAMMER_LOADER, 8));
4392
- };
4393
- static ɵprov = ɵɵdefineInjectable({
4394
- token: _HammerGesturesPlugin,
4395
- factory: _HammerGesturesPlugin.ɵfac
4396
- });
4397
- };
4398
- (() => {
4399
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HammerGesturesPlugin, [{
4400
- type: Injectable
4401
- }], () => [{
4402
- type: void 0,
4403
- decorators: [{
4404
- type: Inject,
4405
- args: [DOCUMENT]
4406
- }]
4407
- }, {
4408
- type: HammerGestureConfig,
4409
- decorators: [{
4410
- type: Inject,
4411
- args: [HAMMER_GESTURE_CONFIG]
4412
- }]
4413
- }, {
4414
- type: Injector
4415
- }, {
4416
- type: void 0,
4417
- decorators: [{
4418
- type: Optional
4419
- }, {
4420
- type: Inject,
4421
- args: [HAMMER_LOADER]
4422
- }]
4423
- }], null);
4424
- })();
4425
- var HammerModule = class _HammerModule {
4426
- static ɵfac = function HammerModule_Factory(__ngFactoryType__) {
4427
- return new (__ngFactoryType__ || _HammerModule)();
4428
- };
4429
- static ɵmod = ɵɵdefineNgModule({
4430
- type: _HammerModule
4431
- });
4432
- static ɵinj = ɵɵdefineInjector({
4433
- providers: [{
4434
- provide: EVENT_MANAGER_PLUGINS,
4435
- useClass: HammerGesturesPlugin,
4436
- multi: true,
4437
- deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, Injector, [new Optional(), HAMMER_LOADER]]
4438
- }, {
4439
- provide: HAMMER_GESTURE_CONFIG,
4440
- useClass: HammerGestureConfig
4441
- }]
4442
- });
4443
- };
4444
- (() => {
4445
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HammerModule, [{
4446
- type: NgModule,
4447
- args: [{
4448
- providers: [{
4449
- provide: EVENT_MANAGER_PLUGINS,
4450
- useClass: HammerGesturesPlugin,
4451
- multi: true,
4452
- deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, Injector, [new Optional(), HAMMER_LOADER]]
4453
- }, {
4454
- provide: HAMMER_GESTURE_CONFIG,
4455
- useClass: HammerGestureConfig
4456
- }]
4457
- }]
4458
- }], null, null);
4459
- })();
4460
- var DomSanitizer = class _DomSanitizer {
4461
- static ɵfac = function DomSanitizer_Factory(__ngFactoryType__) {
4462
- return new (__ngFactoryType__ || _DomSanitizer)();
4463
- };
4464
- static ɵprov = ɵɵdefineInjectable({
4465
- token: _DomSanitizer,
4466
- factory: function DomSanitizer_Factory(__ngFactoryType__) {
4467
- let __ngConditionalFactory__ = null;
4468
- if (__ngFactoryType__) {
4469
- __ngConditionalFactory__ = new (__ngFactoryType__ || _DomSanitizer)();
4470
- } else {
4471
- __ngConditionalFactory__ = ɵɵinject(DomSanitizerImpl);
4472
- }
4473
- return __ngConditionalFactory__;
4474
- },
4475
- providedIn: "root"
4476
- });
4477
- };
4478
- (() => {
4479
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DomSanitizer, [{
4480
- type: Injectable,
4481
- args: [{
4482
- providedIn: "root",
4483
- useExisting: forwardRef(() => DomSanitizerImpl)
4484
- }]
4485
- }], null, null);
4486
- })();
4487
- var DomSanitizerImpl = class _DomSanitizerImpl extends DomSanitizer {
4488
- _doc;
4489
- constructor(_doc) {
4490
- super();
4491
- this._doc = _doc;
4492
- }
4493
- sanitize(ctx, value) {
4494
- if (value == null) return null;
4495
- switch (ctx) {
4496
- case SecurityContext.NONE:
4497
- return value;
4498
- case SecurityContext.HTML:
4499
- if (allowSanitizationBypassAndThrow(
4500
- value,
4501
- "HTML"
4502
- /* BypassType.Html */
4503
- )) {
4504
- return unwrapSafeValue(value);
4505
- }
4506
- return _sanitizeHtml(this._doc, String(value)).toString();
4507
- case SecurityContext.STYLE:
4508
- if (allowSanitizationBypassAndThrow(
4509
- value,
4510
- "Style"
4511
- /* BypassType.Style */
4512
- )) {
4513
- return unwrapSafeValue(value);
4514
- }
4515
- return value;
4516
- case SecurityContext.SCRIPT:
4517
- if (allowSanitizationBypassAndThrow(
4518
- value,
4519
- "Script"
4520
- /* BypassType.Script */
4521
- )) {
4522
- return unwrapSafeValue(value);
4523
- }
4524
- throw new RuntimeError(5200, (typeof ngDevMode === "undefined" || ngDevMode) && "unsafe value used in a script context");
4525
- case SecurityContext.URL:
4526
- if (allowSanitizationBypassAndThrow(
4527
- value,
4528
- "URL"
4529
- /* BypassType.Url */
4530
- )) {
4531
- return unwrapSafeValue(value);
4532
- }
4533
- return _sanitizeUrl(String(value));
4534
- case SecurityContext.RESOURCE_URL:
4535
- if (allowSanitizationBypassAndThrow(
4536
- value,
4537
- "ResourceURL"
4538
- /* BypassType.ResourceUrl */
4539
- )) {
4540
- return unwrapSafeValue(value);
4541
- }
4542
- throw new RuntimeError(5201, (typeof ngDevMode === "undefined" || ngDevMode) && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);
4543
- default:
4544
- throw new RuntimeError(5202, (typeof ngDevMode === "undefined" || ngDevMode) && `Unexpected SecurityContext ${ctx} (see ${XSS_SECURITY_URL})`);
4545
- }
4546
- }
4547
- bypassSecurityTrustHtml(value) {
4548
- return bypassSanitizationTrustHtml(value);
4549
- }
4550
- bypassSecurityTrustStyle(value) {
4551
- return bypassSanitizationTrustStyle(value);
4552
- }
4553
- bypassSecurityTrustScript(value) {
4554
- return bypassSanitizationTrustScript(value);
4555
- }
4556
- bypassSecurityTrustUrl(value) {
4557
- return bypassSanitizationTrustUrl(value);
4558
- }
4559
- bypassSecurityTrustResourceUrl(value) {
4560
- return bypassSanitizationTrustResourceUrl(value);
4561
- }
4562
- static ɵfac = function DomSanitizerImpl_Factory(__ngFactoryType__) {
4563
- return new (__ngFactoryType__ || _DomSanitizerImpl)(ɵɵinject(DOCUMENT));
4564
- };
4565
- static ɵprov = ɵɵdefineInjectable({
4566
- token: _DomSanitizerImpl,
4567
- factory: _DomSanitizerImpl.ɵfac,
4568
- providedIn: "root"
4569
- });
4570
- };
4571
- (() => {
4572
- (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DomSanitizerImpl, [{
4573
- type: Injectable,
4574
- args: [{
4575
- providedIn: "root"
4576
- }]
4577
- }], () => [{
4578
- type: void 0,
4579
- decorators: [{
4580
- type: Inject,
4581
- args: [DOCUMENT]
4582
- }]
4583
- }], null);
4584
- })();
4585
- var HydrationFeatureKind;
4586
- (function(HydrationFeatureKind2) {
4587
- HydrationFeatureKind2[HydrationFeatureKind2["NoHttpTransferCache"] = 0] = "NoHttpTransferCache";
4588
- HydrationFeatureKind2[HydrationFeatureKind2["HttpTransferCacheOptions"] = 1] = "HttpTransferCacheOptions";
4589
- HydrationFeatureKind2[HydrationFeatureKind2["I18nSupport"] = 2] = "I18nSupport";
4590
- HydrationFeatureKind2[HydrationFeatureKind2["EventReplay"] = 3] = "EventReplay";
4591
- HydrationFeatureKind2[HydrationFeatureKind2["IncrementalHydration"] = 4] = "IncrementalHydration";
4592
- })(HydrationFeatureKind || (HydrationFeatureKind = {}));
4593
- function hydrationFeature(ɵkind, ɵproviders = [], ɵoptions = {}) {
4594
- return {
4595
- ɵkind,
4596
- ɵproviders
4597
- };
4598
- }
4599
- function withNoHttpTransferCache() {
4600
- return hydrationFeature(HydrationFeatureKind.NoHttpTransferCache);
4601
- }
4602
- function withHttpTransferCacheOptions(options) {
4603
- return hydrationFeature(HydrationFeatureKind.HttpTransferCacheOptions, withHttpTransferCache(options));
4604
- }
4605
- function withI18nSupport2() {
4606
- return hydrationFeature(HydrationFeatureKind.I18nSupport, withI18nSupport());
4607
- }
4608
- function withEventReplay2() {
4609
- return hydrationFeature(HydrationFeatureKind.EventReplay, withEventReplay());
4610
- }
4611
- function withIncrementalHydration2() {
4612
- return hydrationFeature(HydrationFeatureKind.IncrementalHydration, withIncrementalHydration());
4613
- }
4614
- function provideZoneJsCompatibilityDetector() {
4615
- return [{
4616
- provide: ENVIRONMENT_INITIALIZER,
4617
- useValue: () => {
4618
- const ngZone = inject(NgZone);
4619
- const isZoneless = inject(ZONELESS_ENABLED);
4620
- if (!isZoneless && ngZone.constructor !== NgZone) {
4621
- const console2 = inject(Console);
4622
- const message = formatRuntimeError(-5e3, "Angular detected that hydration was enabled for an application that uses a custom or a noop Zone.js implementation. This is not yet a fully supported configuration.");
4623
- console2.warn(message);
4624
- }
4625
- },
4626
- multi: true
4627
- }];
4628
- }
4629
- function provideEnabledBlockingInitialNavigationDetector() {
4630
- return [{
4631
- provide: ENVIRONMENT_INITIALIZER,
4632
- useValue: () => {
4633
- const isEnabledBlockingInitialNavigation = inject(IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, {
4634
- optional: true
4635
- });
4636
- if (isEnabledBlockingInitialNavigation) {
4637
- const console2 = inject(Console);
4638
- const message = formatRuntimeError(5001, "Configuration error: found both hydration and enabledBlocking initial navigation in the same application, which is a contradiction.");
4639
- console2.warn(message);
4640
- }
4641
- },
4642
- multi: true
4643
- }];
4644
- }
4645
- function provideClientHydration(...features) {
4646
- const providers = [];
4647
- const featuresKind = /* @__PURE__ */ new Set();
4648
- for (const {
4649
- ɵproviders,
4650
- ɵkind
4651
- } of features) {
4652
- featuresKind.add(ɵkind);
4653
- if (ɵproviders.length) {
4654
- providers.push(ɵproviders);
4655
- }
4656
- }
4657
- const hasHttpTransferCacheOptions = featuresKind.has(HydrationFeatureKind.HttpTransferCacheOptions);
4658
- if (typeof ngDevMode !== "undefined" && ngDevMode && featuresKind.has(HydrationFeatureKind.NoHttpTransferCache) && hasHttpTransferCacheOptions) {
4659
- throw new RuntimeError(5001, "Configuration error: found both withHttpTransferCacheOptions() and withNoHttpTransferCache() in the same call to provideClientHydration(), which is a contradiction.");
4660
- }
4661
- return makeEnvironmentProviders([typeof ngDevMode !== "undefined" && ngDevMode ? provideZoneJsCompatibilityDetector() : [], typeof ngDevMode !== "undefined" && ngDevMode ? provideEnabledBlockingInitialNavigationDetector() : [], withDomHydration(), featuresKind.has(HydrationFeatureKind.NoHttpTransferCache) || hasHttpTransferCacheOptions ? [] : withHttpTransferCache({}), providers]);
4662
- }
4663
- var VERSION = new Version("20.3.6");
4664
-
4665
- export {
4666
- EventManagerPlugin,
4667
- DomEventsPlugin,
4668
- EVENT_MANAGER_PLUGINS,
4669
- EventManager,
4670
- SharedStylesHost,
4671
- REMOVE_STYLES_ON_COMPONENT_DESTROY,
4672
- DomRendererFactory2,
4673
- BrowserDomAdapter,
4674
- BrowserGetTestability,
4675
- KeyEventsPlugin,
4676
- bootstrapApplication,
4677
- createApplication,
4678
- provideProtractorTestingSupport,
4679
- platformBrowser,
4680
- BrowserModule,
4681
- Meta,
4682
- Title,
4683
- enableDebugTools,
4684
- disableDebugTools,
4685
- By,
4686
- HAMMER_GESTURE_CONFIG,
4687
- HAMMER_LOADER,
4688
- HammerGestureConfig,
4689
- HammerGesturesPlugin,
4690
- HammerModule,
4691
- DomSanitizer,
4692
- DomSanitizerImpl,
4693
- HydrationFeatureKind,
4694
- withNoHttpTransferCache,
4695
- withHttpTransferCacheOptions,
4696
- withI18nSupport2 as withI18nSupport,
4697
- withEventReplay2 as withEventReplay,
4698
- withIncrementalHydration2 as withIncrementalHydration,
4699
- provideClientHydration,
4700
- VERSION
4701
- };
4702
- /*! Bundled license information:
4703
-
4704
- @angular/platform-browser/fesm2022/dom_renderer.mjs:
4705
- @angular/platform-browser/fesm2022/browser.mjs:
4706
- @angular/common/fesm2022/module.mjs:
4707
- @angular/common/fesm2022/http.mjs:
4708
- @angular/platform-browser/fesm2022/platform-browser.mjs:
4709
- (**
4710
- * @license Angular v20.3.6
4711
- * (c) 2010-2025 Google LLC. https://angular.dev/
4712
- * License: MIT
4713
- *)
4714
- */
4715
- //# sourceMappingURL=chunk-QJUWYUTH.js.map