-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_angular_common_http.8-QATQeJSU.js
More file actions
505 lines (504 loc) · 41 KB
/
_angular_common_http.8-QATQeJSU.js
File metadata and controls
505 lines (504 loc) · 41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
import { a as Ne, b as Me } from "@nf-internal/chunk-INJBHWGE";
import "@nf-internal/chunk-M4JCPEPJ";
import { f as G, y as Pe, z } from "@nf-internal/chunk-STIBVO4O";
import { a as $, d as be, i as se } from "@nf-internal/chunk-2AVGQ2MQ";
import * as l from "@angular/core";
import { \u0275RuntimeError as A, InjectionToken as D, inject as v, NgZone as lt, DestroyRef as ut, \u0275formatRuntimeError as cr, PendingTasks as je, runInInjectionContext as ue, DOCUMENT as Le, makeEnvironmentProviders as ht } from "@angular/core";
import { concatMap as ft, filter as pt, map as W, finalize as Ue, switchMap as yt } from "rxjs/operators";
var j = class {
}, L = class {
}, R = class e {
headers;
normalizedNames = new Map;
lazyInit;
lazyUpdate = null;
constructor(r) {
r ? typeof r == "string" ? this.lazyInit = () => {
this.headers = new Map, r.split(`
`).forEach(t => { let n = t.indexOf(":"); if (n > 0) {
let s = t.slice(0, n), i = t.slice(n + 1).trim();
this.addHeaderEntry(s, i);
} });
} : typeof Headers < "u" && r instanceof Headers ? (this.headers = new Map, r.forEach((t, n) => { this.addHeaderEntry(n, t); })) : this.lazyInit = () => { this.headers = new Map, Object.entries(r).forEach(([t, n]) => { this.setHeaderEntries(t, n); }); } : this.headers = new Map;
}
has(r) { return this.init(), this.headers.has(r.toLowerCase()); }
get(r) { this.init(); let t = this.headers.get(r.toLowerCase()); return t && t.length > 0 ? t[0] : null; }
keys() { return this.init(), Array.from(this.normalizedNames.values()); }
getAll(r) { return this.init(), this.headers.get(r.toLowerCase()) || null; }
append(r, t) { return this.clone({ name: r, value: t, op: "a" }); }
set(r, t) { return this.clone({ name: r, value: t, op: "s" }); }
delete(r, t) { return this.clone({ name: r, value: t, op: "d" }); }
maybeSetNormalizedName(r, t) { this.normalizedNames.has(t) || this.normalizedNames.set(t, r); }
init() { this.lazyInit && (this.lazyInit instanceof e ? this.copyFrom(this.lazyInit) : this.lazyInit(), this.lazyInit = null, this.lazyUpdate && (this.lazyUpdate.forEach(r => this.applyUpdate(r)), this.lazyUpdate = null)); }
copyFrom(r) { r.init(), Array.from(r.headers.keys()).forEach(t => { this.headers.set(t, r.headers.get(t)), this.normalizedNames.set(t, r.normalizedNames.get(t)); }); }
clone(r) { let t = new e; return t.lazyInit = this.lazyInit && this.lazyInit instanceof e ? this.lazyInit : this, t.lazyUpdate = (this.lazyUpdate || []).concat([r]), t; }
applyUpdate(r) { let t = r.name.toLowerCase(); switch (r.op) {
case "a":
case "s":
let n = r.value;
if (typeof n == "string" && (n = [n]), n.length === 0)
return;
this.maybeSetNormalizedName(r.name, t);
let s = (r.op === "a" ? this.headers.get(t) : void 0) || [];
s.push(...n), this.headers.set(t, s);
break;
case "d":
let i = r.value;
if (!i)
this.headers.delete(t), this.normalizedNames.delete(t);
else {
let o = this.headers.get(t);
if (!o)
return;
o = o.filter(d => i.indexOf(d) === -1), o.length === 0 ? (this.headers.delete(t), this.normalizedNames.delete(t)) : this.headers.set(t, o);
}
break;
} }
addHeaderEntry(r, t) { let n = r.toLowerCase(); this.maybeSetNormalizedName(r, n), this.headers.has(n) ? this.headers.get(n).push(t) : this.headers.set(n, [t]); }
setHeaderEntries(r, t) { let n = (Array.isArray(t) ? t : [t]).map(i => i.toString()), s = r.toLowerCase(); this.headers.set(s, n), this.maybeSetNormalizedName(r, s); }
forEach(r) { this.init(), Array.from(this.normalizedNames.keys()).forEach(t => r(this.normalizedNames.get(t), this.headers.get(t))); }
};
var q = class {
encodeKey(r) { return Oe(r); }
encodeValue(r) { return Oe(r); }
decodeKey(r) { return decodeURIComponent(r); }
decodeValue(r) { return decodeURIComponent(r); }
};
function mt(e, r) { let t = new Map; return e.length > 0 && e.replace(/^\?/, "").split("&").forEach(s => { let i = s.indexOf("="), [o, d] = i == -1 ? [r.decodeKey(s), ""] : [r.decodeKey(s.slice(0, i)), r.decodeValue(s.slice(i + 1))], a = t.get(o) || []; a.push(d), t.set(o, a); }), t; }
var gt = /%(\d[a-f0-9])/gi, Tt = { 40: "@", "3A": ":", 24: "$", "2C": ",", "3B": ";", "3D": "=", "3F": "?", "2F": "/" };
function Oe(e) { return encodeURIComponent(e).replace(gt, (r, t) => Tt[t] ?? r); }
function K(e) { return `${e}`; }
var O = class e {
map;
encoder;
updates = null;
cloneFrom = null;
constructor(r = {}) { if (this.encoder = r.encoder || new q, r.fromString) {
if (r.fromObject)
throw new A(2805, !1);
this.map = mt(r.fromString, this.encoder);
}
else
r.fromObject ? (this.map = new Map, Object.keys(r.fromObject).forEach(t => { let n = r.fromObject[t], s = Array.isArray(n) ? n.map(K) : [K(n)]; this.map.set(t, s); })) : this.map = null; }
has(r) { return this.init(), this.map.has(r); }
get(r) { this.init(); let t = this.map.get(r); return t ? t[0] : null; }
getAll(r) { return this.init(), this.map.get(r) || null; }
keys() { return this.init(), Array.from(this.map.keys()); }
append(r, t) { return this.clone({ param: r, value: t, op: "a" }); }
appendAll(r) { let t = []; return Object.keys(r).forEach(n => { let s = r[n]; Array.isArray(s) ? s.forEach(i => { t.push({ param: n, value: i, op: "a" }); }) : t.push({ param: n, value: s, op: "a" }); }), this.clone(t); }
set(r, t) { return this.clone({ param: r, value: t, op: "s" }); }
delete(r, t) { return this.clone({ param: r, value: t, op: "d" }); }
toString() { return this.init(), this.keys().map(r => { let t = this.encoder.encodeKey(r); return this.map.get(r).map(n => t + "=" + this.encoder.encodeValue(n)).join("&"); }).filter(r => r !== "").join("&"); }
clone(r) { let t = new e({ encoder: this.encoder }); return t.cloneFrom = this.cloneFrom || this, t.updates = (this.updates || []).concat(r), t; }
init() { this.map === null && (this.map = new Map), this.cloneFrom !== null && (this.cloneFrom.init(), this.cloneFrom.keys().forEach(r => this.map.set(r, this.cloneFrom.map.get(r))), this.updates.forEach(r => { switch (r.op) {
case "a":
case "s":
let t = (r.op === "a" ? this.map.get(r.param) : void 0) || [];
t.push(K(r.value)), this.map.set(r.param, t);
break;
case "d": if (r.value !== void 0) {
let n = this.map.get(r.param) || [], s = n.indexOf(K(r.value));
s !== -1 && n.splice(s, 1), n.length > 0 ? this.map.set(r.param, n) : this.map.delete(r.param);
}
else {
this.map.delete(r.param);
break;
}
} }), this.cloneFrom = this.updates = null); }
}, ie = class {
defaultValue;
constructor(r) { this.defaultValue = r; }
}, Z = class {
map = new Map;
set(r, t) { return this.map.set(r, t), this; }
get(r) { return this.map.has(r) || this.map.set(r, r.defaultValue()), this.map.get(r); }
delete(r) { return this.map.delete(r), this; }
has(r) { return this.map.has(r); }
keys() { return this.map.keys(); }
};
function Et(e) { switch (e) {
case "DELETE":
case "GET":
case "HEAD":
case "OPTIONS":
case "JSONP": return !1;
default: return !0;
} }
function Ae(e) { return typeof ArrayBuffer < "u" && e instanceof ArrayBuffer; }
function Ie(e) { return typeof Blob < "u" && e instanceof Blob; }
function _e(e) { return typeof FormData < "u" && e instanceof FormData; }
function vt(e) { return typeof URLSearchParams < "u" && e instanceof URLSearchParams; }
var X = "Content-Type", Q = "Accept", he = "X-Request-URL", Ce = "text/plain", Be = "application/json", Se = `${Be}, ${Ce}, */*`, F = class e {
url;
body = null;
headers;
context;
reportProgress = !1;
withCredentials = !1;
credentials;
keepalive = !1;
cache;
priority;
mode;
redirect;
referrer;
integrity;
responseType = "json";
method;
params;
urlWithParams;
transferCache;
timeout;
constructor(r, t, n, s) { this.url = t, this.method = r.toUpperCase(); let i; if (Et(this.method) || s ? (this.body = n !== void 0 ? n : null, i = s) : i = n, i) {
if (this.reportProgress = !!i.reportProgress, this.withCredentials = !!i.withCredentials, this.keepalive = !!i.keepalive, i.responseType && (this.responseType = i.responseType), i.headers && (this.headers = i.headers), i.context && (this.context = i.context), i.params && (this.params = i.params), i.priority && (this.priority = i.priority), i.cache && (this.cache = i.cache), i.credentials && (this.credentials = i.credentials), typeof i.timeout == "number") {
if (i.timeout < 1 || !Number.isInteger(i.timeout))
throw new A(2822, "");
this.timeout = i.timeout;
}
i.mode && (this.mode = i.mode), i.redirect && (this.redirect = i.redirect), i.integrity && (this.integrity = i.integrity), i.referrer && (this.referrer = i.referrer), this.transferCache = i.transferCache;
} if (this.headers ??= new R, this.context ??= new Z, !this.params)
this.params = new O, this.urlWithParams = t;
else {
let o = this.params.toString();
if (o.length === 0)
this.urlWithParams = t;
else {
let d = t.indexOf("?"), a = d === -1 ? "?" : d < t.length - 1 ? "&" : "";
this.urlWithParams = t + a + o;
}
} }
serializeBody() { return this.body === null ? null : typeof this.body == "string" || Ae(this.body) || Ie(this.body) || _e(this.body) || vt(this.body) ? this.body : this.body instanceof O ? this.body.toString() : typeof this.body == "object" || typeof this.body == "boolean" || Array.isArray(this.body) ? JSON.stringify(this.body) : this.body.toString(); }
detectContentTypeHeader() { return this.body === null || _e(this.body) ? null : Ie(this.body) ? this.body.type || null : Ae(this.body) ? null : typeof this.body == "string" ? Ce : this.body instanceof O ? "application/x-www-form-urlencoded;charset=UTF-8" : typeof this.body == "object" || typeof this.body == "number" || typeof this.body == "boolean" ? Be : null; }
clone(r = {}) { let t = r.method || this.method, n = r.url || this.url, s = r.responseType || this.responseType, i = r.keepalive ?? this.keepalive, o = r.priority || this.priority, d = r.cache || this.cache, a = r.mode || this.mode, f = r.redirect || this.redirect, m = r.credentials || this.credentials, p = r.referrer || this.referrer, g = r.integrity || this.integrity, E = r.transferCache ?? this.transferCache, c = r.timeout ?? this.timeout, M = r.body !== void 0 ? r.body : this.body, u = r.withCredentials ?? this.withCredentials, h = r.reportProgress ?? this.reportProgress, T = r.headers || this.headers, b = r.params || this.params, y = r.context ?? this.context; return r.setHeaders !== void 0 && (T = Object.keys(r.setHeaders).reduce((P, I) => P.set(I, r.setHeaders[I]), T)), r.setParams && (b = Object.keys(r.setParams).reduce((P, I) => P.set(I, r.setParams[I]), b)), new e(t, n, M, { params: b, headers: T, context: y, reportProgress: h, responseType: s, withCredentials: u, transferCache: E, keepalive: i, cache: d, priority: o, timeout: c, mode: a, redirect: f, credentials: m, referrer: p, integrity: g }); }
}, N = (function (e) { return e[e.Sent = 0] = "Sent", e[e.UploadProgress = 1] = "UploadProgress", e[e.ResponseHeader = 2] = "ResponseHeader", e[e.DownloadProgress = 3] = "DownloadProgress", e[e.Response = 4] = "Response", e[e.User = 5] = "User", e; })(N || {}), C = class {
headers;
status;
statusText;
url;
ok;
type;
redirected;
constructor(r, t = 200, n = "OK") { this.headers = r.headers || new R, this.status = r.status !== void 0 ? r.status : t, this.statusText = r.statusText || n, this.url = r.url || null, this.redirected = r.redirected, this.ok = this.status >= 200 && this.status < 300; }
}, J = class e extends C {
constructor(r = {}) { super(r); }
type = N.ResponseHeader;
clone(r = {}) { return new e({ headers: r.headers || this.headers, status: r.status !== void 0 ? r.status : this.status, statusText: r.statusText || this.statusText, url: r.url || this.url || void 0 }); }
}, _ = class e extends C {
body;
constructor(r = {}) { super(r), this.body = r.body !== void 0 ? r.body : null; }
type = N.Response;
clone(r = {}) { return new e({ body: r.body !== void 0 ? r.body : this.body, headers: r.headers || this.headers, status: r.status !== void 0 ? r.status : this.status, statusText: r.statusText || this.statusText, url: r.url || this.url || void 0, redirected: r.redirected ?? this.redirected }); }
}, w = class extends C {
name = "HttpErrorResponse";
message;
error;
ok = !1;
constructor(r) { super(r, 0, "Unknown Error"), this.status >= 200 && this.status < 300 ? this.message = `Http failure during parsing for ${r.url || "(unknown url)"}` : this.message = `Http failure response for ${r.url || "(unknown url)"}: ${r.status} ${r.statusText}`, this.error = r.error || null; }
}, fe = 200, wt = 204, ze = (function (e) { return e[e.Continue = 100] = "Continue", e[e.SwitchingProtocols = 101] = "SwitchingProtocols", e[e.Processing = 102] = "Processing", e[e.EarlyHints = 103] = "EarlyHints", e[e.Ok = 200] = "Ok", e[e.Created = 201] = "Created", e[e.Accepted = 202] = "Accepted", e[e.NonAuthoritativeInformation = 203] = "NonAuthoritativeInformation", e[e.NoContent = 204] = "NoContent", e[e.ResetContent = 205] = "ResetContent", e[e.PartialContent = 206] = "PartialContent", e[e.MultiStatus = 207] = "MultiStatus", e[e.AlreadyReported = 208] = "AlreadyReported", e[e.ImUsed = 226] = "ImUsed", e[e.MultipleChoices = 300] = "MultipleChoices", e[e.MovedPermanently = 301] = "MovedPermanently", e[e.Found = 302] = "Found", e[e.SeeOther = 303] = "SeeOther", e[e.NotModified = 304] = "NotModified", e[e.UseProxy = 305] = "UseProxy", e[e.Unused = 306] = "Unused", e[e.TemporaryRedirect = 307] = "TemporaryRedirect", e[e.PermanentRedirect = 308] = "PermanentRedirect", e[e.BadRequest = 400] = "BadRequest", e[e.Unauthorized = 401] = "Unauthorized", e[e.PaymentRequired = 402] = "PaymentRequired", e[e.Forbidden = 403] = "Forbidden", e[e.NotFound = 404] = "NotFound", e[e.MethodNotAllowed = 405] = "MethodNotAllowed", e[e.NotAcceptable = 406] = "NotAcceptable", e[e.ProxyAuthenticationRequired = 407] = "ProxyAuthenticationRequired", e[e.RequestTimeout = 408] = "RequestTimeout", e[e.Conflict = 409] = "Conflict", e[e.Gone = 410] = "Gone", e[e.LengthRequired = 411] = "LengthRequired", e[e.PreconditionFailed = 412] = "PreconditionFailed", e[e.PayloadTooLarge = 413] = "PayloadTooLarge", e[e.UriTooLong = 414] = "UriTooLong", e[e.UnsupportedMediaType = 415] = "UnsupportedMediaType", e[e.RangeNotSatisfiable = 416] = "RangeNotSatisfiable", e[e.ExpectationFailed = 417] = "ExpectationFailed", e[e.ImATeapot = 418] = "ImATeapot", e[e.MisdirectedRequest = 421] = "MisdirectedRequest", e[e.UnprocessableEntity = 422] = "UnprocessableEntity", e[e.Locked = 423] = "Locked", e[e.FailedDependency = 424] = "FailedDependency", e[e.TooEarly = 425] = "TooEarly", e[e.UpgradeRequired = 426] = "UpgradeRequired", e[e.PreconditionRequired = 428] = "PreconditionRequired", e[e.TooManyRequests = 429] = "TooManyRequests", e[e.RequestHeaderFieldsTooLarge = 431] = "RequestHeaderFieldsTooLarge", e[e.UnavailableForLegalReasons = 451] = "UnavailableForLegalReasons", e[e.InternalServerError = 500] = "InternalServerError", e[e.NotImplemented = 501] = "NotImplemented", e[e.BadGateway = 502] = "BadGateway", e[e.ServiceUnavailable = 503] = "ServiceUnavailable", e[e.GatewayTimeout = 504] = "GatewayTimeout", e[e.HttpVersionNotSupported = 505] = "HttpVersionNotSupported", e[e.VariantAlsoNegotiates = 506] = "VariantAlsoNegotiates", e[e.InsufficientStorage = 507] = "InsufficientStorage", e[e.LoopDetected = 508] = "LoopDetected", e[e.NotExtended = 510] = "NotExtended", e[e.NetworkAuthenticationRequired = 511] = "NetworkAuthenticationRequired", e; })(ze || {});
function oe(e, r) { return { body: r, headers: e.headers, context: e.context, observe: e.observe, params: e.params, reportProgress: e.reportProgress, responseType: e.responseType, withCredentials: e.withCredentials, credentials: e.credentials, transferCache: e.transferCache, timeout: e.timeout, keepalive: e.keepalive, priority: e.priority, cache: e.cache, mode: e.mode, redirect: e.redirect, integrity: e.integrity, referrer: e.referrer }; }
var pe = (() => { class e {
handler;
constructor(t) { this.handler = t; }
request(t, n, s = {}) { let i; if (t instanceof F)
i = t;
else {
let a;
s.headers instanceof R ? a = s.headers : a = new R(s.headers);
let f;
s.params && (s.params instanceof O ? f = s.params : f = new O({ fromObject: s.params })), i = new F(t, n, s.body !== void 0 ? s.body : null, { headers: a, context: s.context, params: f, reportProgress: s.reportProgress, responseType: s.responseType || "json", withCredentials: s.withCredentials, transferCache: s.transferCache, keepalive: s.keepalive, priority: s.priority, cache: s.cache, mode: s.mode, redirect: s.redirect, credentials: s.credentials, referrer: s.referrer, integrity: s.integrity, timeout: s.timeout });
} let o = z(i).pipe(ft(a => this.handler.handle(a))); if (t instanceof F || s.observe === "events")
return o; let d = o.pipe(pt(a => a instanceof _)); switch (s.observe || "body") {
case "body": switch (i.responseType) {
case "arraybuffer": return d.pipe(W(a => { if (a.body !== null && !(a.body instanceof ArrayBuffer))
throw new A(2806, !1); return a.body; }));
case "blob": return d.pipe(W(a => { if (a.body !== null && !(a.body instanceof Blob))
throw new A(2807, !1); return a.body; }));
case "text": return d.pipe(W(a => { if (a.body !== null && typeof a.body != "string")
throw new A(2808, !1); return a.body; }));
case "json":
default: return d.pipe(W(a => a.body));
}
case "response": return d;
default: throw new A(2809, !1);
} }
delete(t, n = {}) { return this.request("DELETE", t, n); }
get(t, n = {}) { return this.request("GET", t, n); }
head(t, n = {}) { return this.request("HEAD", t, n); }
jsonp(t, n) { return this.request("JSONP", t, { params: new O().append(n, "JSONP_CALLBACK"), observe: "body", responseType: "json" }); }
options(t, n = {}) { return this.request("OPTIONS", t, n); }
patch(t, n, s = {}) { return this.request("PATCH", t, oe(s, n)); }
post(t, n, s = {}) { return this.request("POST", t, oe(s, n)); }
put(t, n, s = {}) { return this.request("PUT", t, oe(s, n)); }
static \u0275fac = function (n) { return new (n || e)(l.\u0275\u0275inject(j)); };
static \u0275prov = l.\u0275\u0275defineInjectable({ token: e, factory: e.\u0275fac });
} return e; })(), Rt = /^\)\]\}',?\n/;
function De(e) { if (e.url)
return e.url; let r = he.toLocaleLowerCase(); return e.headers.get(r); }
var Xe = new D(""), Y = (() => { class e {
fetchImpl = v(ae, { optional: !0 })?.fetch ?? ((...t) => globalThis.fetch(...t));
ngZone = v(lt);
destroyRef = v(ut);
destroyed = !1;
constructor() { this.destroyRef.onDestroy(() => { this.destroyed = !0; }); }
handle(t) { return new G(n => { let s = new AbortController; this.doRequest(t, s.signal, n).then(ce, o => n.error(new w({ error: o }))); let i; return t.timeout && (i = this.ngZone.runOutsideAngular(() => setTimeout(() => { s.signal.aborted || s.abort(new DOMException("signal timed out", "TimeoutError")); }, t.timeout))), () => { i !== void 0 && clearTimeout(i), s.abort(); }; }); }
doRequest(t, n, s) { return se(this, null, function* () { let i = this.createRequestInit(t), o; try {
let c = this.ngZone.runOutsideAngular(() => this.fetchImpl(t.urlWithParams, $({ signal: n }, i)));
bt(c), s.next({ type: N.Sent }), o = yield c;
}
catch (c) {
s.error(new w({ error: c, status: c.status ?? 0, statusText: c.statusText, url: t.urlWithParams, headers: c.headers }));
return;
} let d = new R(o.headers), a = o.statusText, f = De(o) ?? t.urlWithParams, m = o.status, p = null; if (t.reportProgress && s.next(new J({ headers: d, status: m, statusText: a, url: f })), o.body) {
let c = o.headers.get("content-length"), M = [], u = o.body.getReader(), h = 0, T, b, y = typeof Zone < "u" && Zone.current, P = !1;
if (yield this.ngZone.runOutsideAngular(() => se(this, null, function* () { for (;;) {
if (this.destroyed) {
yield u.cancel(), P = !0;
break;
}
let { done: x, value: ne } = yield u.read();
if (x)
break;
if (M.push(ne), h += ne.length, t.reportProgress) {
b = t.responseType === "text" ? (b ?? "") + (T ??= new TextDecoder).decode(ne, { stream: !0 }) : void 0;
let Re = () => s.next({ type: N.DownloadProgress, total: c ? +c : void 0, loaded: h, partialText: b });
y ? y.run(Re) : Re();
}
} })), P) {
s.complete();
return;
}
let I = this.concatChunks(M, h);
try {
let x = o.headers.get(X) ?? "";
p = this.parseBody(t, I, x, m);
}
catch (x) {
s.error(new w({ error: x, headers: new R(o.headers), status: o.status, statusText: o.statusText, url: De(o) ?? t.urlWithParams }));
return;
}
} m === 0 && (m = p ? fe : 0); let g = m >= 200 && m < 300, E = o.redirected; g ? (s.next(new _({ body: p, headers: d, status: m, statusText: a, url: f, redirected: E })), s.complete()) : s.error(new w({ error: p, headers: d, status: m, statusText: a, url: f, redirected: E })); }); }
parseBody(t, n, s, i) { switch (t.responseType) {
case "json":
let o = new TextDecoder().decode(n).replace(Rt, "");
if (o === "")
return null;
try {
return JSON.parse(o);
}
catch (d) {
if (i < 200 || i >= 300)
return o;
throw d;
}
case "text": return new TextDecoder().decode(n);
case "blob": return new Blob([n], { type: s });
case "arraybuffer": return n.buffer;
} }
createRequestInit(t) { let n = {}, s; if (s = t.credentials, t.withCredentials && (s = "include"), t.headers.forEach((i, o) => n[i] = o.join(",")), t.headers.has(Q) || (n[Q] = Se), !t.headers.has(X)) {
let i = t.detectContentTypeHeader();
i !== null && (n[X] = i);
} return { body: t.serializeBody(), method: t.method, headers: n, credentials: s, keepalive: t.keepalive, cache: t.cache, priority: t.priority, mode: t.mode, redirect: t.redirect, referrer: t.referrer, integrity: t.integrity }; }
concatChunks(t, n) { let s = new Uint8Array(n), i = 0; for (let o of t)
s.set(o, i), i += o.length; return s; }
static \u0275fac = function (n) { return new (n || e); };
static \u0275prov = l.\u0275\u0275defineInjectable({ token: e, factory: e.\u0275fac });
} return e; })(), ae = class {
};
function ce() { }
function bt(e) { e.then(ce, ce); }
function Je(e, r) { return r(e); }
function Pt(e, r) { return (t, n) => r.intercept(t, { handle: s => e(s, n) }); }
function Nt(e, r, t) { return (n, s) => ue(t, () => r(n, i => e(i, s))); }
var ye = new D(""), V = new D(""), me = new D(""), ge = new D("", { providedIn: "root", factory: () => !0 });
function Mt() { let e = null; return (r, t) => { e === null && (e = (v(ye, { optional: !0 }) ?? []).reduceRight(Pt, Je)); let n = v(je); if (v(ge)) {
let i = n.add();
return e(r, t).pipe(Ue(i));
}
else
return e(r, t); }; }
var H = (() => { class e extends j {
backend;
injector;
chain = null;
pendingTasks = v(je);
contributeToStability = v(ge);
constructor(t, n) { super(), this.backend = t, this.injector = n; }
handle(t) { if (this.chain === null) {
let n = Array.from(new Set([...this.injector.get(V), ...this.injector.get(me, [])]));
this.chain = n.reduceRight((s, i) => Nt(s, i, this.injector), Je);
} if (this.contributeToStability) {
let n = this.pendingTasks.add();
return this.chain(t, s => this.backend.handle(s)).pipe(Ue(n));
}
else
return this.chain(t, n => this.backend.handle(n)); }
static \u0275fac = function (n) { return new (n || e)(l.\u0275\u0275inject(L), l.\u0275\u0275inject(l.EnvironmentInjector)); };
static \u0275prov = l.\u0275\u0275defineInjectable({ token: e, factory: e.\u0275fac });
} return e; })(), Ot = 0, ke, At = "JSONP injected script did not invoke callback.";
var ee = class {
};
function It() { return typeof window == "object" ? window : {}; }
var Te = (() => { class e {
callbackMap;
document;
resolvedPromise = Promise.resolve();
constructor(t, n) { this.callbackMap = t, this.document = n; }
nextCallback() { return `ng_jsonp_callback_${Ot++}`; }
handle(t) { if (t.method !== "JSONP")
throw new A(2810, !1); if (t.responseType !== "json")
throw new A(2811, !1); if (t.headers.keys().length > 0)
throw new A(2812, !1); return new G(n => { let s = this.nextCallback(), i = t.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/, `=${s}$1`), o = this.document.createElement("script"); o.src = i; let d = null, a = !1; this.callbackMap[s] = g => { delete this.callbackMap[s], d = g, a = !0; }; let f = () => { o.removeEventListener("load", m), o.removeEventListener("error", p), o.remove(), delete this.callbackMap[s]; }, m = () => { this.resolvedPromise.then(() => { if (f(), !a) {
n.error(new w({ url: i, status: 0, statusText: "JSONP Error", error: new Error(At) }));
return;
} n.next(new _({ body: d, status: fe, statusText: "OK", url: i })), n.complete(); }); }, p = g => { f(), n.error(new w({ error: g, status: 0, statusText: "JSONP Error", url: i })); }; return o.addEventListener("load", m), o.addEventListener("error", p), this.document.body.appendChild(o), n.next({ type: N.Sent }), () => { a || this.removeListeners(o), f(); }; }); }
removeListeners(t) { ke ??= this.document.implementation.createHTMLDocument(), ke.adoptNode(t); }
static \u0275fac = function (n) { return new (n || e)(l.\u0275\u0275inject(ee), l.\u0275\u0275inject(Le)); };
static \u0275prov = l.\u0275\u0275defineInjectable({ token: e, factory: e.\u0275fac });
} return e; })();
function Ve(e, r) { return e.method === "JSONP" ? v(Te).handle(e) : r(e); }
var _t = (() => { class e {
injector;
constructor(t) { this.injector = t; }
intercept(t, n) { return ue(this.injector, () => Ve(t, s => n.handle(s))); }
static \u0275fac = function (n) { return new (n || e)(l.\u0275\u0275inject(l.EnvironmentInjector)); };
static \u0275prov = l.\u0275\u0275defineInjectable({ token: e, factory: e.\u0275fac });
} return e; })(), Dt = /^\)\]\}',?\n/, kt = RegExp(`^${he}:`, "m");
function xt(e) { return "responseURL" in e && e.responseURL ? e.responseURL : kt.test(e.getAllResponseHeaders()) ? e.getResponseHeader(he) : null; }
var de = (() => { class e {
xhrFactory;
constructor(t) { this.xhrFactory = t; }
handle(t) { if (t.method === "JSONP")
throw new A(-2800, !1); let n = this.xhrFactory; return (typeof ngServerMode < "u" && ngServerMode && n.\u0275loadImpl ? Pe(n.\u0275loadImpl()) : z(null)).pipe(yt(() => new G(i => { let o = n.build(); if (o.open(t.method, t.urlWithParams), t.withCredentials && (o.withCredentials = !0), t.headers.forEach((u, h) => o.setRequestHeader(u, h.join(","))), t.headers.has(Q) || o.setRequestHeader(Q, Se), !t.headers.has(X)) {
let u = t.detectContentTypeHeader();
u !== null && o.setRequestHeader(X, u);
} if (t.timeout && (o.timeout = t.timeout), t.responseType) {
let u = t.responseType.toLowerCase();
o.responseType = u !== "json" ? u : "text";
} let d = t.serializeBody(), a = null, f = () => { if (a !== null)
return a; let u = o.statusText || "OK", h = new R(o.getAllResponseHeaders()), T = xt(o) || t.url; return a = new J({ headers: h, status: o.status, statusText: u, url: T }), a; }, m = () => { let { headers: u, status: h, statusText: T, url: b } = f(), y = null; h !== wt && (y = typeof o.response > "u" ? o.responseText : o.response), h === 0 && (h = y ? fe : 0); let P = h >= 200 && h < 300; if (t.responseType === "json" && typeof y == "string") {
let I = y;
y = y.replace(Dt, "");
try {
y = y !== "" ? JSON.parse(y) : null;
}
catch (x) {
y = I, P && (P = !1, y = { error: x, text: y });
}
} P ? (i.next(new _({ body: y, headers: u, status: h, statusText: T, url: b || void 0 })), i.complete()) : i.error(new w({ error: y, headers: u, status: h, statusText: T, url: b || void 0 })); }, p = u => { let { url: h } = f(), T = new w({ error: u, status: o.status || 0, statusText: o.statusText || "Unknown Error", url: h || void 0 }); i.error(T); }, g = p; t.timeout && (g = u => { let { url: h } = f(), T = new w({ error: new DOMException("Request timed out", "TimeoutError"), status: o.status || 0, statusText: o.statusText || "Request timeout", url: h || void 0 }); i.error(T); }); let E = !1, c = u => { E || (i.next(f()), E = !0); let h = { type: N.DownloadProgress, loaded: u.loaded }; u.lengthComputable && (h.total = u.total), t.responseType === "text" && o.responseText && (h.partialText = o.responseText), i.next(h); }, M = u => { let h = { type: N.UploadProgress, loaded: u.loaded }; u.lengthComputable && (h.total = u.total), i.next(h); }; return o.addEventListener("load", m), o.addEventListener("error", p), o.addEventListener("timeout", g), o.addEventListener("abort", p), t.reportProgress && (o.addEventListener("progress", c), d !== null && o.upload && o.upload.addEventListener("progress", M)), o.send(d), i.next({ type: N.Sent }), () => { o.removeEventListener("error", p), o.removeEventListener("abort", p), o.removeEventListener("load", m), o.removeEventListener("timeout", g), t.reportProgress && (o.removeEventListener("progress", c), d !== null && o.upload && o.upload.removeEventListener("progress", M)), o.readyState !== o.DONE && o.abort(); }; }))); }
static \u0275fac = function (n) { return new (n || e)(l.\u0275\u0275inject(Me)); };
static \u0275prov = l.\u0275\u0275defineInjectable({ token: e, factory: e.\u0275fac });
} return e; })(), te = new D(""), $e = "XSRF-TOKEN", Ge = new D("", { providedIn: "root", factory: () => $e }), We = "X-XSRF-TOKEN", Ke = new D("", { providedIn: "root", factory: () => We }), B = class {
}, Ye = (() => { class e {
doc;
cookieName;
lastCookieString = "";
lastToken = null;
parseCount = 0;
constructor(t, n) { this.doc = t, this.cookieName = n; }
getToken() { if (typeof ngServerMode < "u" && ngServerMode)
return null; let t = this.doc.cookie || ""; return t !== this.lastCookieString && (this.parseCount++, this.lastToken = Ne(t, this.cookieName), this.lastCookieString = t), this.lastToken; }
static \u0275fac = function (n) { return new (n || e)(l.\u0275\u0275inject(Le), l.\u0275\u0275inject(Ge)); };
static \u0275prov = l.\u0275\u0275defineInjectable({ token: e, factory: e.\u0275fac });
} return e; })();
function qe(e, r) { let t = e.url.toLowerCase(); if (!v(te) || e.method === "GET" || e.method === "HEAD" || t.startsWith("http://") || t.startsWith("https://"))
return r(e); let n = v(B).getToken(), s = v(Ke); return n != null && !e.headers.has(s) && (e = e.clone({ headers: e.headers.set(s, n) })), r(e); }
var xe = (() => { class e {
injector;
constructor(t) { this.injector = t; }
intercept(t, n) { return ue(this.injector, () => qe(t, s => n.handle(s))); }
static \u0275fac = function (n) { return new (n || e)(l.\u0275\u0275inject(l.EnvironmentInjector)); };
static \u0275prov = l.\u0275\u0275defineInjectable({ token: e, factory: e.\u0275fac });
} return e; })(), k = (function (e) { return e[e.Interceptors = 0] = "Interceptors", e[e.LegacyInterceptors = 1] = "LegacyInterceptors", e[e.CustomXsrfConfiguration = 2] = "CustomXsrfConfiguration", e[e.NoXsrfProtection = 3] = "NoXsrfProtection", e[e.JsonpSupport = 4] = "JsonpSupport", e[e.RequestsMadeViaParent = 5] = "RequestsMadeViaParent", e[e.Fetch = 6] = "Fetch", e; })(k || {});
function U(e, r) { return { \u0275kind: e, \u0275providers: r }; }
function Ze(...e) { let r = [pe, de, H, { provide: j, useExisting: H }, { provide: L, useFactory: () => v(Xe, { optional: !0 }) ?? v(de) }, { provide: V, useValue: qe, multi: !0 }, { provide: te, useValue: !0 }, { provide: B, useClass: Ye }]; for (let t of e)
r.push(...t.\u0275providers); return ht(r); }
function Ft(e) { return U(k.Interceptors, e.map(r => ({ provide: V, useValue: r, multi: !0 }))); }
var Fe = new D("");
function Qe() { return U(k.LegacyInterceptors, [{ provide: Fe, useFactory: Mt }, { provide: V, useExisting: Fe, multi: !0 }]); }
function le({ cookieName: e, headerName: r }) { let t = []; return e !== void 0 && t.push({ provide: Ge, useValue: e }), r !== void 0 && t.push({ provide: Ke, useValue: r }), U(k.CustomXsrfConfiguration, t); }
function He() { return U(k.NoXsrfProtection, [{ provide: te, useValue: !1 }]); }
function et() { return U(k.JsonpSupport, [Te, { provide: ee, useFactory: It }, { provide: V, useValue: Ve, multi: !0 }]); }
function jt() { return U(k.RequestsMadeViaParent, [{ provide: L, useFactory: () => v(j, { skipSelf: !0, optional: !0 }) }]); }
function Lt() { return U(k.Fetch, [Y, { provide: Xe, useExisting: Y }, { provide: L, useExisting: Y }]); }
var Ut = (() => { class e {
static disable() { return { ngModule: e, providers: [He().\u0275providers] }; }
static withOptions(t = {}) { return { ngModule: e, providers: le(t).\u0275providers }; }
static \u0275fac = function (n) { return new (n || e); };
static \u0275mod = l.\u0275\u0275defineNgModule({ type: e });
static \u0275inj = l.\u0275\u0275defineInjector({ providers: [xe, { provide: ye, useExisting: xe, multi: !0 }, { provide: B, useClass: Ye }, le({ cookieName: $e, headerName: We }).\u0275providers, { provide: te, useValue: !0 }] });
} return e; })(), Ct = (() => { class e {
static \u0275fac = function (n) { return new (n || e); };
static \u0275mod = l.\u0275\u0275defineNgModule({ type: e });
static \u0275inj = l.\u0275\u0275defineInjector({ providers: [Ze(Qe())] });
} return e; })(), Bt = (() => { class e {
static \u0275fac = function (n) { return new (n || e); };
static \u0275mod = l.\u0275\u0275defineNgModule({ type: e });
static \u0275inj = l.\u0275\u0275defineInjector({ providers: [et().\u0275providers] });
} return e; })();
import { inject as S, Injector as St, \u0275ResourceImpl as zt, linkedSignal as Ee, computed as Xt, signal as Jt, \u0275encapsulateResourceError as Vt, \u0275RuntimeError as ct, InjectionToken as dt, \u0275performanceMarkFeature as $t, APP_BOOTSTRAP_LISTENER as Gt, ApplicationRef as Wt, TransferState as Kt, makeStateKey as Yt, \u0275truncateMiddle as vr, \u0275formatRuntimeError as wr } from "@angular/core";
import { tap as qt } from "rxjs/operators";
var Pr = (() => { let e = re("json"); return e.arrayBuffer = re("arraybuffer"), e.blob = re("blob"), e.text = re("text"), e; })();
function re(e) { return function (t, n) { let s = n?.injector ?? S(St); return new ve(s, () => Zt(t, e), n?.defaultValue, n?.parse, n?.equal); }; }
function Zt(e, r) { let t = typeof e == "function" ? e() : e; if (t === void 0)
return; typeof t == "string" && (t = { url: t }); let n = t.headers instanceof R ? t.headers : new R(t.headers), s = t.params instanceof O ? t.params : new O({ fromObject: t.params }); return new F(t.method ?? "GET", t.url, t.body ?? null, { headers: n, params: s, reportProgress: t.reportProgress, withCredentials: t.withCredentials, keepalive: t.keepalive, cache: t.cache, priority: t.priority, mode: t.mode, redirect: t.redirect, responseType: r, context: t.context, transferCache: t.transferCache, credentials: t.credentials, referrer: t.referrer, integrity: t.integrity, timeout: t.timeout }); }
var ve = class extends zt {
client;
_headers = Ee({ source: this.extRequest, computation: () => { } });
_progress = Ee({ source: this.extRequest, computation: () => { } });
_statusCode = Ee({ source: this.extRequest, computation: () => { } });
headers = Xt(() => this.status() === "resolved" || this.status() === "error" ? this._headers() : void 0);
progress = this._progress.asReadonly();
statusCode = this._statusCode.asReadonly();
constructor(r, t, n, s, i) { super(t, ({ params: o, abortSignal: d }) => { let a, f = () => a.unsubscribe(); d.addEventListener("abort", f); let m = Jt({ value: void 0 }), p, g = new Promise(c => p = c), E = c => { m.set(c), p?.(m), p = void 0; }; return a = this.client.request(o).subscribe({ next: c => { switch (c.type) {
case N.Response:
this._headers.set(c.headers), this._statusCode.set(c.status);
try {
E({ value: s ? s(c.body) : c.body });
}
catch (M) {
E({ error: Vt(M) });
}
break;
case N.DownloadProgress:
this._progress.set(c);
break;
} }, error: c => { c instanceof w && (this._headers.set(c.headers), this._statusCode.set(c.status)), E({ error: c }), d.removeEventListener("abort", f); }, complete: () => { p && E({ error: new ct(991, !1) }), d.removeEventListener("abort", f); } }), g; }, n, i, r), this.client = r.get(pe); }
set(r) { super.set(r), this._headers.set(void 0), this._progress.set(void 0), this._statusCode.set(void 0); }
}, Qt = new dt(""), tt = "b", rt = "h", nt = "s", st = "st", ot = "u", it = "rt", we = new dt(""), Ht = ["GET", "HEAD"];
function er(e, r) { let E = S(we), { isCacheActive: t } = E, n = be(E, ["isCacheActive"]), { transferCache: s, method: i } = e; if (!t || s === !1 || i === "POST" && !n.includePostRequests && !s || i !== "POST" && !Ht.includes(i) || !n.includeRequestsWithAuthHeaders && tr(e) || n.filter?.(e) === !1)
return r(e); let o = S(Kt), d = S(Qt, { optional: !0 }); if (typeof ngServerMode < "u" && !ngServerMode && d)
throw new ct(2803, !1); let a = typeof ngServerMode < "u" && ngServerMode && d ? or(e.url, d) : e.url, f = nr(e, a), m = o.get(f, null), p = n.includeHeaders; if (typeof s == "object" && s.includeHeaders && (p = s.includeHeaders), m) {
let { [tt]: c, [it]: M, [rt]: u, [nt]: h, [st]: T, [ot]: b } = m, y = c;
switch (M) {
case "arraybuffer":
y = new TextEncoder().encode(c).buffer;
break;
case "blob":
y = new Blob([c]);
break;
}
let P = new R(u);
return z(new _({ body: y, headers: P, status: h, statusText: T, url: b }));
} let g = r(e); return typeof ngServerMode < "u" && ngServerMode ? g.pipe(qt(c => { c instanceof _ && o.set(f, { [tt]: c.body, [rt]: rr(c.headers, p), [nt]: c.status, [st]: c.statusText, [ot]: a, [it]: e.responseType }); })) : g; }
function tr(e) { return e.headers.has("authorization") || e.headers.has("proxy-authorization"); }
function rr(e, r) { if (!r)
return {}; let t = {}; for (let n of r) {
let s = e.getAll(n);
s !== null && (t[n] = s);
} return t; }
function at(e) { return [...e.keys()].sort().map(r => `${r}=${e.getAll(r)}`).join("&"); }
function nr(e, r) { let { params: t, method: n, responseType: s } = e, i = at(t), o = e.serializeBody(); o instanceof URLSearchParams ? o = at(o) : typeof o != "string" && (o = ""); let d = [n, s, r, o, i].join("|"), a = sr(d); return Yt(a); }
function sr(e) { let r = 0; for (let t of e)
r = Math.imul(31, r) + t.charCodeAt(0) << 0; return r += 2147483648, r.toString(); }
function Nr(e) { return [{ provide: we, useFactory: () => ($t("NgHttpTransferCache"), $({ isCacheActive: !0 }, e)) }, { provide: me, useValue: er, multi: !0 }, { provide: Gt, multi: !0, useFactory: () => { let r = S(Wt), t = S(we); return () => { r.whenStable().then(() => { t.isCacheActive = !1; }); }; } }]; }
function or(e, r) { let t = new URL(e, "resolve://").origin, n = r[t]; return n ? e.replace(t, n) : e; }
export { Y as FetchBackend, ye as HTTP_INTERCEPTORS, Qt as HTTP_TRANSFER_CACHE_ORIGIN_MAP, L as HttpBackend, pe as HttpClient, Bt as HttpClientJsonpModule, Ct as HttpClientModule, Ut as HttpClientXsrfModule, Z as HttpContext, ie as HttpContextToken, w as HttpErrorResponse, N as HttpEventType, k as HttpFeatureKind, j as HttpHandler, J as HttpHeaderResponse, R as HttpHeaders, O as HttpParams, F as HttpRequest, _ as HttpResponse, C as HttpResponseBase, ze as HttpStatusCode, q as HttpUrlEncodingCodec, de as HttpXhrBackend, B as HttpXsrfTokenExtractor, Te as JsonpClientBackend, _t as JsonpInterceptor, Pr as httpResource, Ze as provideHttpClient, Lt as withFetch, Ft as withInterceptors, Qe as withInterceptorsFromDi, et as withJsonpSupport, He as withNoXsrfProtection, jt as withRequestsMadeViaParent, le as withXsrfConfiguration, me as \u0275HTTP_ROOT_INTERCEPTOR_FNS, H as \u0275HttpInterceptingHandler, H as \u0275HttpInterceptorHandler, ge as \u0275REQUESTS_CONTRIBUTE_TO_STABILITY, Nr as \u0275withHttpTransferCache };
/*! Bundled license information:
@angular/common/fesm2022/module.mjs:
@angular/common/fesm2022/http.mjs:
(**
* @license Angular v20.3.7
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*)
*/