@ichaingo/header 1.3.87 → 1.3.89

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.
@@ -0,0 +1,2095 @@
1
+ import { jsxs as Q, jsx as Se } from "react/jsx-runtime";
2
+ import { twMerge as lt } from "tailwind-merge";
3
+ import dt from "@ichaingo/request";
4
+ import Ke from "react";
5
+ import Re from "next/dynamic";
6
+ var L = {}, H = {}, ee = {}, te = {}, re, Ee;
7
+ function ft() {
8
+ if (Ee) return re;
9
+ Ee = 1;
10
+ var f = Object.defineProperty, y = Object.getOwnPropertyDescriptor, g = Object.getOwnPropertyNames, _ = Object.prototype.hasOwnProperty, d = (e, s) => {
11
+ for (var a in s)
12
+ f(e, a, { get: s[a], enumerable: !0 });
13
+ }, k = (e, s, a, t) => {
14
+ if (s && typeof s == "object" || typeof s == "function")
15
+ for (let r of g(s))
16
+ !_.call(e, r) && r !== a && f(e, r, { get: () => s[r], enumerable: !(t = y(s, r)) || t.enumerable });
17
+ return e;
18
+ }, o = (e) => k(f({}, "__esModule", { value: !0 }), e), i = {};
19
+ d(i, {
20
+ RequestCookies: () => v,
21
+ ResponseCookies: () => m,
22
+ parseCookie: () => b,
23
+ parseSetCookie: () => x,
24
+ stringifyCookie: () => p
25
+ }), re = o(i);
26
+ function p(e) {
27
+ var s;
28
+ const a = [
29
+ "path" in e && e.path && `Path=${e.path}`,
30
+ "expires" in e && (e.expires || e.expires === 0) && `Expires=${(typeof e.expires == "number" ? new Date(e.expires) : e.expires).toUTCString()}`,
31
+ "maxAge" in e && typeof e.maxAge == "number" && `Max-Age=${e.maxAge}`,
32
+ "domain" in e && e.domain && `Domain=${e.domain}`,
33
+ "secure" in e && e.secure && "Secure",
34
+ "httpOnly" in e && e.httpOnly && "HttpOnly",
35
+ "sameSite" in e && e.sameSite && `SameSite=${e.sameSite}`,
36
+ "partitioned" in e && e.partitioned && "Partitioned",
37
+ "priority" in e && e.priority && `Priority=${e.priority}`
38
+ ].filter(Boolean), t = `${e.name}=${encodeURIComponent((s = e.value) != null ? s : "")}`;
39
+ return a.length === 0 ? t : `${t}; ${a.join("; ")}`;
40
+ }
41
+ function b(e) {
42
+ const s = /* @__PURE__ */ new Map();
43
+ for (const a of e.split(/; */)) {
44
+ if (!a)
45
+ continue;
46
+ const t = a.indexOf("=");
47
+ if (t === -1) {
48
+ s.set(a, "true");
49
+ continue;
50
+ }
51
+ const [r, l] = [a.slice(0, t), a.slice(t + 1)];
52
+ try {
53
+ s.set(r, decodeURIComponent(l ?? "true"));
54
+ } catch {
55
+ }
56
+ }
57
+ return s;
58
+ }
59
+ function x(e) {
60
+ if (!e)
61
+ return;
62
+ const [[s, a], ...t] = b(e), {
63
+ domain: r,
64
+ expires: l,
65
+ httponly: O,
66
+ maxage: R,
67
+ path: w,
68
+ samesite: C,
69
+ secure: M,
70
+ partitioned: F,
71
+ priority: G
72
+ } = Object.fromEntries(
73
+ t.map(([X, J]) => [
74
+ X.toLowerCase().replace(/-/g, ""),
75
+ J
76
+ ])
77
+ ), Y = {
78
+ name: s,
79
+ value: decodeURIComponent(a),
80
+ domain: r,
81
+ ...l && { expires: new Date(l) },
82
+ ...O && { httpOnly: !0 },
83
+ ...typeof R == "string" && { maxAge: Number(R) },
84
+ path: w,
85
+ ...C && { sameSite: P(C) },
86
+ ...M && { secure: !0 },
87
+ ...G && { priority: q(G) },
88
+ ...F && { partitioned: !0 }
89
+ };
90
+ return S(Y);
91
+ }
92
+ function S(e) {
93
+ const s = {};
94
+ for (const a in e)
95
+ e[a] && (s[a] = e[a]);
96
+ return s;
97
+ }
98
+ var E = ["strict", "lax", "none"];
99
+ function P(e) {
100
+ return e = e.toLowerCase(), E.includes(e) ? e : void 0;
101
+ }
102
+ var I = ["low", "medium", "high"];
103
+ function q(e) {
104
+ return e = e.toLowerCase(), I.includes(e) ? e : void 0;
105
+ }
106
+ function D(e) {
107
+ if (!e)
108
+ return [];
109
+ var s = [], a = 0, t, r, l, O, R;
110
+ function w() {
111
+ for (; a < e.length && /\s/.test(e.charAt(a)); )
112
+ a += 1;
113
+ return a < e.length;
114
+ }
115
+ function C() {
116
+ return r = e.charAt(a), r !== "=" && r !== ";" && r !== ",";
117
+ }
118
+ for (; a < e.length; ) {
119
+ for (t = a, R = !1; w(); )
120
+ if (r = e.charAt(a), r === ",") {
121
+ for (l = a, a += 1, w(), O = a; a < e.length && C(); )
122
+ a += 1;
123
+ a < e.length && e.charAt(a) === "=" ? (R = !0, a = O, s.push(e.substring(t, l)), t = a) : a = l + 1;
124
+ } else
125
+ a += 1;
126
+ (!R || a >= e.length) && s.push(e.substring(t, e.length));
127
+ }
128
+ return s;
129
+ }
130
+ var v = class {
131
+ constructor(e) {
132
+ this._parsed = /* @__PURE__ */ new Map(), this._headers = e;
133
+ const s = e.get("cookie");
134
+ if (s) {
135
+ const a = b(s);
136
+ for (const [t, r] of a)
137
+ this._parsed.set(t, { name: t, value: r });
138
+ }
139
+ }
140
+ [Symbol.iterator]() {
141
+ return this._parsed[Symbol.iterator]();
142
+ }
143
+ /**
144
+ * The amount of cookies received from the client
145
+ */
146
+ get size() {
147
+ return this._parsed.size;
148
+ }
149
+ get(...e) {
150
+ const s = typeof e[0] == "string" ? e[0] : e[0].name;
151
+ return this._parsed.get(s);
152
+ }
153
+ getAll(...e) {
154
+ var s;
155
+ const a = Array.from(this._parsed);
156
+ if (!e.length)
157
+ return a.map(([r, l]) => l);
158
+ const t = typeof e[0] == "string" ? e[0] : (s = e[0]) == null ? void 0 : s.name;
159
+ return a.filter(([r]) => r === t).map(([r, l]) => l);
160
+ }
161
+ has(e) {
162
+ return this._parsed.has(e);
163
+ }
164
+ set(...e) {
165
+ const [s, a] = e.length === 1 ? [e[0].name, e[0].value] : e, t = this._parsed;
166
+ return t.set(s, { name: s, value: a }), this._headers.set(
167
+ "cookie",
168
+ Array.from(t).map(([r, l]) => p(l)).join("; ")
169
+ ), this;
170
+ }
171
+ /**
172
+ * Delete the cookies matching the passed name or names in the request.
173
+ */
174
+ delete(e) {
175
+ const s = this._parsed, a = Array.isArray(e) ? e.map((t) => s.delete(t)) : s.delete(e);
176
+ return this._headers.set(
177
+ "cookie",
178
+ Array.from(s).map(([t, r]) => p(r)).join("; ")
179
+ ), a;
180
+ }
181
+ /**
182
+ * Delete all the cookies in the cookies in the request.
183
+ */
184
+ clear() {
185
+ return this.delete(Array.from(this._parsed.keys())), this;
186
+ }
187
+ /**
188
+ * Format the cookies in the request as a string for logging
189
+ */
190
+ [Symbol.for("edge-runtime.inspect.custom")]() {
191
+ return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
192
+ }
193
+ toString() {
194
+ return [...this._parsed.values()].map((e) => `${e.name}=${encodeURIComponent(e.value)}`).join("; ");
195
+ }
196
+ }, m = class {
197
+ constructor(e) {
198
+ this._parsed = /* @__PURE__ */ new Map();
199
+ var s, a, t;
200
+ this._headers = e;
201
+ const r = (t = (a = (s = e.getSetCookie) == null ? void 0 : s.call(e)) != null ? a : e.get("set-cookie")) != null ? t : [], l = Array.isArray(r) ? r : D(r);
202
+ for (const O of l) {
203
+ const R = x(O);
204
+ R && this._parsed.set(R.name, R);
205
+ }
206
+ }
207
+ /**
208
+ * {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise.
209
+ */
210
+ get(...e) {
211
+ const s = typeof e[0] == "string" ? e[0] : e[0].name;
212
+ return this._parsed.get(s);
213
+ }
214
+ /**
215
+ * {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise.
216
+ */
217
+ getAll(...e) {
218
+ var s;
219
+ const a = Array.from(this._parsed.values());
220
+ if (!e.length)
221
+ return a;
222
+ const t = typeof e[0] == "string" ? e[0] : (s = e[0]) == null ? void 0 : s.name;
223
+ return a.filter((r) => r.name === t);
224
+ }
225
+ has(e) {
226
+ return this._parsed.has(e);
227
+ }
228
+ /**
229
+ * {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise.
230
+ */
231
+ set(...e) {
232
+ const [s, a, t] = e.length === 1 ? [e[0].name, e[0].value, e[0]] : e, r = this._parsed;
233
+ return r.set(s, n({ name: s, value: a, ...t })), h(r, this._headers), this;
234
+ }
235
+ /**
236
+ * {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.
237
+ */
238
+ delete(...e) {
239
+ const [s, a] = typeof e[0] == "string" ? [e[0]] : [e[0].name, e[0]];
240
+ return this.set({ ...a, name: s, value: "", expires: /* @__PURE__ */ new Date(0) });
241
+ }
242
+ [Symbol.for("edge-runtime.inspect.custom")]() {
243
+ return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
244
+ }
245
+ toString() {
246
+ return [...this._parsed.values()].map(p).join("; ");
247
+ }
248
+ };
249
+ function h(e, s) {
250
+ s.delete("set-cookie");
251
+ for (const [, a] of e) {
252
+ const t = p(a);
253
+ s.append("set-cookie", t);
254
+ }
255
+ }
256
+ function n(e = { name: "", value: "" }) {
257
+ return typeof e.expires == "number" && (e.expires = new Date(e.expires)), e.maxAge && (e.expires = new Date(Date.now() + e.maxAge * 1e3)), (e.path === null || e.path === void 0) && (e.path = "/"), e;
258
+ }
259
+ return re;
260
+ }
261
+ var De;
262
+ function Ze() {
263
+ return De || (De = 1, (function(f) {
264
+ Object.defineProperty(f, "__esModule", {
265
+ value: !0
266
+ });
267
+ function y(_, d) {
268
+ for (var k in d) Object.defineProperty(_, k, {
269
+ enumerable: !0,
270
+ get: d[k]
271
+ });
272
+ }
273
+ y(f, {
274
+ RequestCookies: function() {
275
+ return g.RequestCookies;
276
+ },
277
+ ResponseCookies: function() {
278
+ return g.ResponseCookies;
279
+ },
280
+ stringifyCookie: function() {
281
+ return g.stringifyCookie;
282
+ }
283
+ });
284
+ const g = ft();
285
+ })(te)), te;
286
+ }
287
+ var ne = {}, xe;
288
+ function Qe() {
289
+ return xe || (xe = 1, (function(f) {
290
+ Object.defineProperty(f, "__esModule", {
291
+ value: !0
292
+ }), Object.defineProperty(f, "ReflectAdapter", {
293
+ enumerable: !0,
294
+ get: function() {
295
+ return y;
296
+ }
297
+ });
298
+ class y {
299
+ static get(_, d, k) {
300
+ const o = Reflect.get(_, d, k);
301
+ return typeof o == "function" ? o.bind(_) : o;
302
+ }
303
+ static set(_, d, k, o) {
304
+ return Reflect.set(_, d, k, o);
305
+ }
306
+ static has(_, d) {
307
+ return Reflect.has(_, d);
308
+ }
309
+ static deleteProperty(_, d) {
310
+ return Reflect.deleteProperty(_, d);
311
+ }
312
+ }
313
+ })(ne)), ne;
314
+ }
315
+ var oe = {}, se = {}, ae = {}, Oe;
316
+ function we() {
317
+ return Oe || (Oe = 1, (function(f) {
318
+ Object.defineProperty(f, "__esModule", {
319
+ value: !0
320
+ });
321
+ function y(p, b) {
322
+ for (var x in b) Object.defineProperty(p, x, {
323
+ enumerable: !0,
324
+ get: b[x]
325
+ });
326
+ }
327
+ y(f, {
328
+ bindSnapshot: function() {
329
+ return o;
330
+ },
331
+ createAsyncLocalStorage: function() {
332
+ return k;
333
+ },
334
+ createSnapshot: function() {
335
+ return i;
336
+ }
337
+ });
338
+ const g = new Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");
339
+ class _ {
340
+ disable() {
341
+ throw g;
342
+ }
343
+ getStore() {
344
+ }
345
+ run() {
346
+ throw g;
347
+ }
348
+ exit() {
349
+ throw g;
350
+ }
351
+ enterWith() {
352
+ throw g;
353
+ }
354
+ static bind(b) {
355
+ return b;
356
+ }
357
+ }
358
+ const d = typeof globalThis < "u" && globalThis.AsyncLocalStorage;
359
+ function k() {
360
+ return d ? new d() : new _();
361
+ }
362
+ function o(p) {
363
+ return d ? d.bind(p) : _.bind(p);
364
+ }
365
+ function i() {
366
+ return d ? d.snapshot() : function(p, ...b) {
367
+ return p(...b);
368
+ };
369
+ }
370
+ })(ae)), ae;
371
+ }
372
+ var Pe;
373
+ function pt() {
374
+ return Pe || (Pe = 1, (function(f) {
375
+ Object.defineProperty(f, "__esModule", {
376
+ value: !0
377
+ }), Object.defineProperty(f, "workAsyncStorageInstance", {
378
+ enumerable: !0,
379
+ get: function() {
380
+ return g;
381
+ }
382
+ });
383
+ const g = (0, we().createAsyncLocalStorage)();
384
+ })(se)), se;
385
+ }
386
+ var qe;
387
+ function U() {
388
+ return qe || (qe = 1, (function(f) {
389
+ Object.defineProperty(f, "__esModule", {
390
+ value: !0
391
+ }), Object.defineProperty(f, "workAsyncStorage", {
392
+ enumerable: !0,
393
+ get: function() {
394
+ return y.workAsyncStorageInstance;
395
+ }
396
+ });
397
+ const y = pt();
398
+ })(oe)), oe;
399
+ }
400
+ var ie = {}, ce = {}, Te;
401
+ function ht() {
402
+ return Te || (Te = 1, (function(f) {
403
+ Object.defineProperty(f, "__esModule", {
404
+ value: !0
405
+ }), Object.defineProperty(f, "workUnitAsyncStorageInstance", {
406
+ enumerable: !0,
407
+ get: function() {
408
+ return g;
409
+ }
410
+ });
411
+ const g = (0, we().createAsyncLocalStorage)();
412
+ })(ce)), ce;
413
+ }
414
+ var $e;
415
+ function W() {
416
+ return $e || ($e = 1, (function(f) {
417
+ Object.defineProperty(f, "__esModule", {
418
+ value: !0
419
+ });
420
+ function y(o, i) {
421
+ for (var p in i) Object.defineProperty(o, p, {
422
+ enumerable: !0,
423
+ get: i[p]
424
+ });
425
+ }
426
+ y(f, {
427
+ getExpectedRequestStore: function() {
428
+ return _;
429
+ },
430
+ getPrerenderResumeDataCache: function() {
431
+ return d;
432
+ },
433
+ getRenderResumeDataCache: function() {
434
+ return k;
435
+ },
436
+ workUnitAsyncStorage: function() {
437
+ return g.workUnitAsyncStorageInstance;
438
+ }
439
+ });
440
+ const g = ht();
441
+ function _(o) {
442
+ const i = g.workUnitAsyncStorageInstance.getStore();
443
+ if (i) {
444
+ if (i.type === "request")
445
+ return i;
446
+ if (i.type === "prerender" || i.type === "prerender-ppr" || i.type === "prerender-legacy")
447
+ throw new Error(`\`${o}\` cannot be called inside a prerender. This is a bug in Next.js.`);
448
+ if (i.type === "cache")
449
+ throw new Error(`\`${o}\` cannot be called inside "use cache". Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/messages/next-request-in-use-cache`);
450
+ if (i.type === "unstable-cache")
451
+ throw new Error(`\`${o}\` cannot be called inside unstable_cache. Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`);
452
+ }
453
+ throw new Error(`\`${o}\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`);
454
+ }
455
+ function d(o) {
456
+ return o.type === "prerender" || o.type === "prerender-ppr" ? o.prerenderResumeDataCache : null;
457
+ }
458
+ function k(o) {
459
+ return o.type !== "prerender-legacy" && o.type !== "cache" && o.type !== "unstable-cache" ? o.type === "request" ? o.renderResumeDataCache : o.prerenderResumeDataCache : null;
460
+ }
461
+ })(ie)), ie;
462
+ }
463
+ var Ie;
464
+ function yt() {
465
+ return Ie || (Ie = 1, (function(f) {
466
+ Object.defineProperty(f, "__esModule", {
467
+ value: !0
468
+ });
469
+ function y(D, v) {
470
+ for (var m in v) Object.defineProperty(D, m, {
471
+ enumerable: !0,
472
+ get: v[m]
473
+ });
474
+ }
475
+ y(f, {
476
+ MutableRequestCookiesAdapter: function() {
477
+ return S;
478
+ },
479
+ ReadonlyRequestCookiesError: function() {
480
+ return o;
481
+ },
482
+ RequestCookiesAdapter: function() {
483
+ return i;
484
+ },
485
+ appendMutableCookies: function() {
486
+ return x;
487
+ },
488
+ areCookiesMutableInCurrentPhase: function() {
489
+ return P;
490
+ },
491
+ getModifiedCookieValues: function() {
492
+ return b;
493
+ },
494
+ responseCookiesToRequestCookies: function() {
495
+ return q;
496
+ },
497
+ wrapWithMutableAccessCheck: function() {
498
+ return E;
499
+ }
500
+ });
501
+ const g = Ze(), _ = Qe(), d = U(), k = W();
502
+ class o extends Error {
503
+ constructor() {
504
+ super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options");
505
+ }
506
+ static callable() {
507
+ throw new o();
508
+ }
509
+ }
510
+ class i {
511
+ static seal(v) {
512
+ return new Proxy(v, {
513
+ get(m, h, n) {
514
+ switch (h) {
515
+ case "clear":
516
+ case "delete":
517
+ case "set":
518
+ return o.callable;
519
+ default:
520
+ return _.ReflectAdapter.get(m, h, n);
521
+ }
522
+ }
523
+ });
524
+ }
525
+ }
526
+ const p = Symbol.for("next.mutated.cookies");
527
+ function b(D) {
528
+ const v = D[p];
529
+ return !v || !Array.isArray(v) || v.length === 0 ? [] : v;
530
+ }
531
+ function x(D, v) {
532
+ const m = b(v);
533
+ if (m.length === 0)
534
+ return !1;
535
+ const h = new g.ResponseCookies(D), n = h.getAll();
536
+ for (const e of m)
537
+ h.set(e);
538
+ for (const e of n)
539
+ h.set(e);
540
+ return !0;
541
+ }
542
+ class S {
543
+ static wrap(v, m) {
544
+ const h = new g.ResponseCookies(new Headers());
545
+ for (const t of v.getAll())
546
+ h.set(t);
547
+ let n = [];
548
+ const e = /* @__PURE__ */ new Set(), s = () => {
549
+ const t = d.workAsyncStorage.getStore();
550
+ if (t && (t.pathWasRevalidated = !0), n = h.getAll().filter((l) => e.has(l.name)), m) {
551
+ const l = [];
552
+ for (const O of n) {
553
+ const R = new g.ResponseCookies(new Headers());
554
+ R.set(O), l.push(R.toString());
555
+ }
556
+ m(l);
557
+ }
558
+ }, a = new Proxy(h, {
559
+ get(t, r, l) {
560
+ switch (r) {
561
+ // A special symbol to get the modified cookie values
562
+ case p:
563
+ return n;
564
+ // TODO: Throw error if trying to set a cookie after the response
565
+ // headers have been set.
566
+ case "delete":
567
+ return function(...O) {
568
+ e.add(typeof O[0] == "string" ? O[0] : O[0].name);
569
+ try {
570
+ return t.delete(...O), a;
571
+ } finally {
572
+ s();
573
+ }
574
+ };
575
+ case "set":
576
+ return function(...O) {
577
+ e.add(typeof O[0] == "string" ? O[0] : O[0].name);
578
+ try {
579
+ return t.set(...O), a;
580
+ } finally {
581
+ s();
582
+ }
583
+ };
584
+ default:
585
+ return _.ReflectAdapter.get(t, r, l);
586
+ }
587
+ }
588
+ });
589
+ return a;
590
+ }
591
+ }
592
+ function E(D) {
593
+ const v = new Proxy(D, {
594
+ get(m, h, n) {
595
+ switch (h) {
596
+ case "delete":
597
+ return function(...e) {
598
+ return I("cookies().delete"), m.delete(...e), v;
599
+ };
600
+ case "set":
601
+ return function(...e) {
602
+ return I("cookies().set"), m.set(...e), v;
603
+ };
604
+ default:
605
+ return _.ReflectAdapter.get(m, h, n);
606
+ }
607
+ }
608
+ });
609
+ return v;
610
+ }
611
+ function P(D) {
612
+ return D.phase === "action";
613
+ }
614
+ function I(D) {
615
+ const v = (0, k.getExpectedRequestStore)(D);
616
+ if (!P(v))
617
+ throw new o();
618
+ }
619
+ function q(D) {
620
+ const v = new g.RequestCookies(new Headers());
621
+ for (const m of D.getAll())
622
+ v.set(m);
623
+ return v;
624
+ }
625
+ })(ee)), ee;
626
+ }
627
+ var ue = {}, V = { exports: {} }, Ce;
628
+ function He() {
629
+ return Ce || (Ce = 1, (function(f, y) {
630
+ Object.defineProperty(y, "__esModule", {
631
+ value: !0
632
+ });
633
+ function g(o, i) {
634
+ for (var p in i) Object.defineProperty(o, p, {
635
+ enumerable: !0,
636
+ get: i[p]
637
+ });
638
+ }
639
+ g(y, {
640
+ DynamicServerError: function() {
641
+ return d;
642
+ },
643
+ isDynamicServerError: function() {
644
+ return k;
645
+ }
646
+ });
647
+ const _ = "DYNAMIC_SERVER_USAGE";
648
+ class d extends Error {
649
+ constructor(i) {
650
+ super("Dynamic server usage: " + i), this.description = i, this.digest = _;
651
+ }
652
+ }
653
+ function k(o) {
654
+ return typeof o != "object" || o === null || !("digest" in o) || typeof o.digest != "string" ? !1 : o.digest === _;
655
+ }
656
+ (typeof y.default == "function" || typeof y.default == "object" && y.default !== null) && typeof y.default.__esModule > "u" && (Object.defineProperty(y.default, "__esModule", { value: !0 }), Object.assign(y.default, y), f.exports = y.default);
657
+ })(V, V.exports)), V.exports;
658
+ }
659
+ var z = { exports: {} }, je;
660
+ function B() {
661
+ return je || (je = 1, (function(f, y) {
662
+ Object.defineProperty(y, "__esModule", {
663
+ value: !0
664
+ });
665
+ function g(o, i) {
666
+ for (var p in i) Object.defineProperty(o, p, {
667
+ enumerable: !0,
668
+ get: i[p]
669
+ });
670
+ }
671
+ g(y, {
672
+ StaticGenBailoutError: function() {
673
+ return d;
674
+ },
675
+ isStaticGenBailoutError: function() {
676
+ return k;
677
+ }
678
+ });
679
+ const _ = "NEXT_STATIC_GEN_BAILOUT";
680
+ class d extends Error {
681
+ constructor(...i) {
682
+ super(...i), this.code = _;
683
+ }
684
+ }
685
+ function k(o) {
686
+ return typeof o != "object" || o === null || !("code" in o) ? !1 : o.code === _;
687
+ }
688
+ (typeof y.default == "function" || typeof y.default == "object" && y.default !== null) && typeof y.default.__esModule > "u" && (Object.defineProperty(y.default, "__esModule", { value: !0 }), Object.assign(y.default, y), f.exports = y.default);
689
+ })(z, z.exports)), z.exports;
690
+ }
691
+ var le = {}, Me;
692
+ function _e() {
693
+ return Me || (Me = 1, (function(f) {
694
+ Object.defineProperty(f, "__esModule", {
695
+ value: !0
696
+ }), Object.defineProperty(f, "makeHangingPromise", {
697
+ enumerable: !0,
698
+ get: function() {
699
+ return y;
700
+ }
701
+ });
702
+ function y(_, d) {
703
+ const k = new Promise((o, i) => {
704
+ _.addEventListener("abort", () => {
705
+ i(new Error(`During prerendering, ${d} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${d} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context.`));
706
+ }, {
707
+ once: !0
708
+ });
709
+ });
710
+ return k.catch(g), k;
711
+ }
712
+ function g() {
713
+ }
714
+ })(le)), le;
715
+ }
716
+ var de = {}, Ne;
717
+ function mt() {
718
+ return Ne || (Ne = 1, (function(f) {
719
+ Object.defineProperty(f, "__esModule", {
720
+ value: !0
721
+ });
722
+ function y(k, o) {
723
+ for (var i in o) Object.defineProperty(k, i, {
724
+ enumerable: !0,
725
+ get: o[i]
726
+ });
727
+ }
728
+ y(f, {
729
+ METADATA_BOUNDARY_NAME: function() {
730
+ return g;
731
+ },
732
+ OUTLET_BOUNDARY_NAME: function() {
733
+ return d;
734
+ },
735
+ VIEWPORT_BOUNDARY_NAME: function() {
736
+ return _;
737
+ }
738
+ });
739
+ const g = "__next_metadata_boundary__", _ = "__next_viewport_boundary__", d = "__next_outlet_boundary__";
740
+ })(de)), de;
741
+ }
742
+ var Le;
743
+ function Ae() {
744
+ return Le || (Le = 1, (function(f) {
745
+ Object.defineProperty(f, "__esModule", {
746
+ value: !0
747
+ });
748
+ function y(u, c) {
749
+ for (var A in c) Object.defineProperty(u, A, {
750
+ enumerable: !0,
751
+ get: c[A]
752
+ });
753
+ }
754
+ y(f, {
755
+ Postpone: function() {
756
+ return a;
757
+ },
758
+ abortAndThrowOnSynchronousRequestDataAccess: function() {
759
+ return e;
760
+ },
761
+ abortOnSynchronousPlatformIOAccess: function() {
762
+ return h;
763
+ },
764
+ accessedDynamicData: function() {
765
+ return M;
766
+ },
767
+ annotateDynamicAccess: function() {
768
+ return J;
769
+ },
770
+ consumeDynamicAccess: function() {
771
+ return F;
772
+ },
773
+ createDynamicTrackingState: function() {
774
+ return S;
775
+ },
776
+ createDynamicValidationState: function() {
777
+ return E;
778
+ },
779
+ createPostponedAbortSignal: function() {
780
+ return X;
781
+ },
782
+ formatDynamicAPIAccesses: function() {
783
+ return G;
784
+ },
785
+ getFirstDynamicReason: function() {
786
+ return P;
787
+ },
788
+ isDynamicPostpone: function() {
789
+ return l;
790
+ },
791
+ isPrerenderInterruptedError: function() {
792
+ return C;
793
+ },
794
+ markCurrentScopeAsDynamic: function() {
795
+ return I;
796
+ },
797
+ postponeWithTracking: function() {
798
+ return t;
799
+ },
800
+ throwIfDisallowedDynamic: function() {
801
+ return ut;
802
+ },
803
+ throwToInterruptStaticGeneration: function() {
804
+ return D;
805
+ },
806
+ trackAllowedDynamicAccess: function() {
807
+ return it;
808
+ },
809
+ trackDynamicDataInDynamicRender: function() {
810
+ return v;
811
+ },
812
+ trackFallbackParamAccessed: function() {
813
+ return q;
814
+ },
815
+ trackSynchronousPlatformIOAccessInDev: function() {
816
+ return n;
817
+ },
818
+ trackSynchronousRequestDataAccessInDev: function() {
819
+ return s;
820
+ },
821
+ useDynamicRouteParams: function() {
822
+ return rt;
823
+ }
824
+ });
825
+ const g = /* @__PURE__ */ b(Ke), _ = He(), d = B(), k = W(), o = U(), i = _e(), p = mt();
826
+ function b(u) {
827
+ return u && u.__esModule ? u : {
828
+ default: u
829
+ };
830
+ }
831
+ const x = typeof g.default.unstable_postpone == "function";
832
+ function S(u) {
833
+ return {
834
+ isDebugDynamicAccesses: u,
835
+ dynamicAccesses: [],
836
+ syncDynamicExpression: void 0,
837
+ syncDynamicErrorWithStack: null
838
+ };
839
+ }
840
+ function E() {
841
+ return {
842
+ hasSuspendedDynamic: !1,
843
+ hasDynamicMetadata: !1,
844
+ hasDynamicViewport: !1,
845
+ hasSyncDynamicErrors: !1,
846
+ dynamicErrors: []
847
+ };
848
+ }
849
+ function P(u) {
850
+ var c;
851
+ return (c = u.dynamicAccesses[0]) == null ? void 0 : c.expression;
852
+ }
853
+ function I(u, c, A) {
854
+ if (!(c && (c.type === "cache" || c.type === "unstable-cache")) && !(u.forceDynamic || u.forceStatic)) {
855
+ if (u.dynamicShouldError)
856
+ throw new d.StaticGenBailoutError(`Route ${u.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${A}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);
857
+ if (c)
858
+ if (c.type === "prerender-ppr")
859
+ t(u.route, A, c.dynamicTracking);
860
+ else if (c.type === "prerender-legacy") {
861
+ c.revalidate = 0;
862
+ const T = new _.DynamicServerError(`Route ${u.route} couldn't be rendered statically because it used ${A}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);
863
+ throw u.dynamicUsageDescription = A, u.dynamicUsageStack = T.stack, T;
864
+ } else process.env.NODE_ENV === "development" && c && c.type === "request" && (c.usedDynamic = !0);
865
+ }
866
+ }
867
+ function q(u, c) {
868
+ const A = k.workUnitAsyncStorage.getStore();
869
+ !A || A.type !== "prerender-ppr" || t(u.route, c, A.dynamicTracking);
870
+ }
871
+ function D(u, c, A) {
872
+ const T = new _.DynamicServerError(`Route ${c.route} couldn't be rendered statically because it used \`${u}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);
873
+ throw A.revalidate = 0, c.dynamicUsageDescription = u, c.dynamicUsageStack = T.stack, T;
874
+ }
875
+ function v(u, c) {
876
+ if (c) {
877
+ if (c.type === "cache" || c.type === "unstable-cache")
878
+ return;
879
+ (c.type === "prerender" || c.type === "prerender-legacy") && (c.revalidate = 0), process.env.NODE_ENV === "development" && c.type === "request" && (c.usedDynamic = !0);
880
+ }
881
+ }
882
+ function m(u, c, A) {
883
+ const T = `Route ${u} needs to bail out of prerendering at this point because it used ${c}.`, $ = w(T);
884
+ A.controller.abort($);
885
+ const j = A.dynamicTracking;
886
+ j && j.dynamicAccesses.push({
887
+ // When we aren't debugging, we don't need to create another error for the
888
+ // stack trace.
889
+ stack: j.isDebugDynamicAccesses ? new Error().stack : void 0,
890
+ expression: c
891
+ });
892
+ }
893
+ function h(u, c, A, T) {
894
+ const $ = T.dynamicTracking;
895
+ return $ && $.syncDynamicErrorWithStack === null && ($.syncDynamicExpression = c, $.syncDynamicErrorWithStack = A), m(u, c, T);
896
+ }
897
+ function n(u) {
898
+ u.prerenderPhase = !1;
899
+ }
900
+ function e(u, c, A, T) {
901
+ const $ = T.dynamicTracking;
902
+ throw $ && $.syncDynamicErrorWithStack === null && ($.syncDynamicExpression = c, $.syncDynamicErrorWithStack = A, T.validating === !0 && ($.syncDynamicLogged = !0)), m(u, c, T), w(`Route ${u} needs to bail out of prerendering at this point because it used ${c}.`);
903
+ }
904
+ const s = n;
905
+ function a({ reason: u, route: c }) {
906
+ const A = k.workUnitAsyncStorage.getStore(), T = A && A.type === "prerender-ppr" ? A.dynamicTracking : null;
907
+ t(c, u, T);
908
+ }
909
+ function t(u, c, A) {
910
+ Y(), A && A.dynamicAccesses.push({
911
+ // When we aren't debugging, we don't need to create another error for the
912
+ // stack trace.
913
+ stack: A.isDebugDynamicAccesses ? new Error().stack : void 0,
914
+ expression: c
915
+ }), g.default.unstable_postpone(r(u, c));
916
+ }
917
+ function r(u, c) {
918
+ return `Route ${u} needs to bail out of prerendering at this point because it used ${c}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`;
919
+ }
920
+ function l(u) {
921
+ return typeof u == "object" && u !== null && typeof u.message == "string" ? O(u.message) : !1;
922
+ }
923
+ function O(u) {
924
+ return u.includes("needs to bail out of prerendering at this point because it used") && u.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error");
925
+ }
926
+ if (O(r("%%%", "^^^")) === !1)
927
+ throw new Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js");
928
+ const R = "NEXT_PRERENDER_INTERRUPTED";
929
+ function w(u) {
930
+ const c = new Error(u);
931
+ return c.digest = R, c;
932
+ }
933
+ function C(u) {
934
+ return typeof u == "object" && u !== null && u.digest === R && "name" in u && "message" in u && u instanceof Error;
935
+ }
936
+ function M(u) {
937
+ return u.length > 0;
938
+ }
939
+ function F(u, c) {
940
+ return u.dynamicAccesses.push(...c.dynamicAccesses), u.dynamicAccesses;
941
+ }
942
+ function G(u) {
943
+ return u.filter((c) => typeof c.stack == "string" && c.stack.length > 0).map(({ expression: c, stack: A }) => (A = A.split(`
944
+ `).slice(4).filter((T) => !(T.includes("node_modules/next/") || T.includes(" (<anonymous>)") || T.includes(" (node:"))).join(`
945
+ `), `Dynamic API Usage Debug - ${c}:
946
+ ${A}`));
947
+ }
948
+ function Y() {
949
+ if (!x)
950
+ throw new Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js");
951
+ }
952
+ function X(u) {
953
+ Y();
954
+ const c = new AbortController();
955
+ try {
956
+ g.default.unstable_postpone(u);
957
+ } catch (A) {
958
+ c.abort(A);
959
+ }
960
+ return c.signal;
961
+ }
962
+ function J(u, c) {
963
+ const A = c.dynamicTracking;
964
+ A && A.dynamicAccesses.push({
965
+ stack: A.isDebugDynamicAccesses ? new Error().stack : void 0,
966
+ expression: u
967
+ });
968
+ }
969
+ function rt(u) {
970
+ if (typeof window > "u") {
971
+ const c = o.workAsyncStorage.getStore();
972
+ if (c && c.isStaticGeneration && c.fallbackRouteParams && c.fallbackRouteParams.size > 0) {
973
+ const A = k.workUnitAsyncStorage.getStore();
974
+ A && (A.type === "prerender" ? g.default.use((0, i.makeHangingPromise)(A.renderSignal, u)) : A.type === "prerender-ppr" ? t(c.route, u, A.dynamicTracking) : A.type === "prerender-legacy" && D(u, c, A));
975
+ }
976
+ }
977
+ }
978
+ const nt = /\n\s+at Suspense \(<anonymous>\)/, ot = new RegExp(`\\n\\s+at ${p.METADATA_BOUNDARY_NAME}[\\n\\s]`), st = new RegExp(`\\n\\s+at ${p.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`), at = new RegExp(`\\n\\s+at ${p.OUTLET_BOUNDARY_NAME}[\\n\\s]`);
979
+ function it(u, c, A, T, $) {
980
+ if (!at.test(c))
981
+ if (ot.test(c)) {
982
+ A.hasDynamicMetadata = !0;
983
+ return;
984
+ } else if (st.test(c)) {
985
+ A.hasDynamicViewport = !0;
986
+ return;
987
+ } else if (nt.test(c)) {
988
+ A.hasSuspendedDynamic = !0;
989
+ return;
990
+ } else if (T.syncDynamicErrorWithStack || $.syncDynamicErrorWithStack) {
991
+ A.hasSyncDynamicErrors = !0;
992
+ return;
993
+ } else {
994
+ const j = `Route "${u}": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. We don't have the exact line number added to error messages yet but you can see which component in the stack below. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`, N = ct(j, c);
995
+ A.dynamicErrors.push(N);
996
+ return;
997
+ }
998
+ }
999
+ function ct(u, c) {
1000
+ const A = new Error(u);
1001
+ return A.stack = "Error: " + u + c, A;
1002
+ }
1003
+ function ut(u, c, A, T) {
1004
+ let $, j, N;
1005
+ if (A.syncDynamicErrorWithStack ? ($ = A.syncDynamicErrorWithStack, j = A.syncDynamicExpression, N = A.syncDynamicLogged === !0) : T.syncDynamicErrorWithStack ? ($ = T.syncDynamicErrorWithStack, j = T.syncDynamicExpression, N = T.syncDynamicLogged === !0) : ($ = null, j = void 0, N = !1), c.hasSyncDynamicErrors && $)
1006
+ throw N || console.error($), new d.StaticGenBailoutError();
1007
+ const K = c.dynamicErrors;
1008
+ if (K.length) {
1009
+ for (let Z = 0; Z < K.length; Z++)
1010
+ console.error(K[Z]);
1011
+ throw new d.StaticGenBailoutError();
1012
+ }
1013
+ if (!c.hasSuspendedDynamic) {
1014
+ if (c.hasDynamicMetadata)
1015
+ throw $ ? (console.error($), new d.StaticGenBailoutError(`Route "${u}" has a \`generateMetadata\` that could not finish rendering before ${j} was used. Follow the instructions in the error for this expression to resolve.`)) : new d.StaticGenBailoutError(`Route "${u}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or external data (\`fetch(...)\`, etc...) but the rest of the route was static or only used cached data (\`"use cache"\`). If you expected this route to be prerenderable update your \`generateMetadata\` to not use Request data and only use cached external data. Otherwise, add \`await connection()\` somewhere within this route to indicate explicitly it should not be prerendered.`);
1016
+ if (c.hasDynamicViewport)
1017
+ throw $ ? (console.error($), new d.StaticGenBailoutError(`Route "${u}" has a \`generateViewport\` that could not finish rendering before ${j} was used. Follow the instructions in the error for this expression to resolve.`)) : new d.StaticGenBailoutError(`Route "${u}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or external data (\`fetch(...)\`, etc...) but the rest of the route was static or only used cached data (\`"use cache"\`). If you expected this route to be prerenderable update your \`generateViewport\` to not use Request data and only use cached external data. Otherwise, add \`await connection()\` somewhere within this route to indicate explicitly it should not be prerendered.`);
1018
+ }
1019
+ }
1020
+ })(ue)), ue;
1021
+ }
1022
+ var fe = {}, Ue;
1023
+ function ke() {
1024
+ return Ue || (Ue = 1, (function(f) {
1025
+ Object.defineProperty(f, "__esModule", {
1026
+ value: !0
1027
+ }), Object.defineProperty(f, "createDedupedByCallsiteServerErrorLoggerDev", {
1028
+ enumerable: !0,
1029
+ get: function() {
1030
+ return p;
1031
+ }
1032
+ });
1033
+ const y = /* @__PURE__ */ _(Ke);
1034
+ function g(b) {
1035
+ if (typeof WeakMap != "function") return null;
1036
+ var x = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap();
1037
+ return (g = function(E) {
1038
+ return E ? S : x;
1039
+ })(b);
1040
+ }
1041
+ function _(b, x) {
1042
+ if (b && b.__esModule)
1043
+ return b;
1044
+ if (b === null || typeof b != "object" && typeof b != "function")
1045
+ return {
1046
+ default: b
1047
+ };
1048
+ var S = g(x);
1049
+ if (S && S.has(b))
1050
+ return S.get(b);
1051
+ var E = {
1052
+ __proto__: null
1053
+ }, P = Object.defineProperty && Object.getOwnPropertyDescriptor;
1054
+ for (var I in b)
1055
+ if (I !== "default" && Object.prototype.hasOwnProperty.call(b, I)) {
1056
+ var q = P ? Object.getOwnPropertyDescriptor(b, I) : null;
1057
+ q && (q.get || q.set) ? Object.defineProperty(E, I, q) : E[I] = b[I];
1058
+ }
1059
+ return E.default = b, S && S.set(b, E), E;
1060
+ }
1061
+ const d = {
1062
+ current: null
1063
+ }, k = typeof y.cache == "function" ? y.cache : (b) => b, o = process.env.__NEXT_DYNAMIC_IO ? console.error : console.warn, i = k(
1064
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- cache key
1065
+ (b) => {
1066
+ try {
1067
+ o(d.current);
1068
+ } finally {
1069
+ d.current = null;
1070
+ }
1071
+ }
1072
+ );
1073
+ function p(b) {
1074
+ return function(...S) {
1075
+ const E = b(...S);
1076
+ if (process.env.NODE_ENV !== "production") {
1077
+ var P;
1078
+ const I = (P = new Error().stack) == null ? void 0 : P.split(`
1079
+ `);
1080
+ if (I === void 0 || I.length < 4)
1081
+ o(E);
1082
+ else {
1083
+ const q = I[4];
1084
+ d.current = E, i(q);
1085
+ }
1086
+ } else
1087
+ o(E);
1088
+ };
1089
+ }
1090
+ })(fe)), fe;
1091
+ }
1092
+ var pe = {}, We;
1093
+ function et() {
1094
+ return We || (We = 1, (function(f) {
1095
+ Object.defineProperty(f, "__esModule", {
1096
+ value: !0
1097
+ });
1098
+ function y(o, i) {
1099
+ for (var p in i) Object.defineProperty(o, p, {
1100
+ enumerable: !0,
1101
+ get: i[p]
1102
+ });
1103
+ }
1104
+ y(f, {
1105
+ atLeastOneTask: function() {
1106
+ return d;
1107
+ },
1108
+ scheduleImmediate: function() {
1109
+ return _;
1110
+ },
1111
+ scheduleOnNextTick: function() {
1112
+ return g;
1113
+ },
1114
+ waitAtLeastOneReactRenderTask: function() {
1115
+ return k;
1116
+ }
1117
+ });
1118
+ const g = (o) => {
1119
+ Promise.resolve().then(() => {
1120
+ process.env.NEXT_RUNTIME === "edge" ? setTimeout(o, 0) : process.nextTick(o);
1121
+ });
1122
+ }, _ = (o) => {
1123
+ process.env.NEXT_RUNTIME === "edge" ? setTimeout(o, 0) : setImmediate(o);
1124
+ };
1125
+ function d() {
1126
+ return new Promise((o) => _(o));
1127
+ }
1128
+ function k() {
1129
+ return process.env.NEXT_RUNTIME === "edge" ? new Promise((o) => setTimeout(o, 0)) : new Promise((o) => setImmediate(o));
1130
+ }
1131
+ })(pe)), pe;
1132
+ }
1133
+ var he = {}, ye = {}, me = {}, Be;
1134
+ function gt() {
1135
+ return Be || (Be = 1, (function(f) {
1136
+ Object.defineProperty(f, "__esModule", {
1137
+ value: !0
1138
+ }), Object.defineProperty(f, "afterTaskAsyncStorageInstance", {
1139
+ enumerable: !0,
1140
+ get: function() {
1141
+ return g;
1142
+ }
1143
+ });
1144
+ const g = (0, we().createAsyncLocalStorage)();
1145
+ })(me)), me;
1146
+ }
1147
+ var Ge;
1148
+ function bt() {
1149
+ return Ge || (Ge = 1, (function(f) {
1150
+ Object.defineProperty(f, "__esModule", {
1151
+ value: !0
1152
+ }), Object.defineProperty(f, "afterTaskAsyncStorage", {
1153
+ enumerable: !0,
1154
+ get: function() {
1155
+ return y.afterTaskAsyncStorageInstance;
1156
+ }
1157
+ });
1158
+ const y = gt();
1159
+ })(ye)), ye;
1160
+ }
1161
+ var Ye;
1162
+ function tt() {
1163
+ return Ye || (Ye = 1, (function(f) {
1164
+ Object.defineProperty(f, "__esModule", {
1165
+ value: !0
1166
+ });
1167
+ function y(S, E) {
1168
+ for (var P in E) Object.defineProperty(S, P, {
1169
+ enumerable: !0,
1170
+ get: E[P]
1171
+ });
1172
+ }
1173
+ y(f, {
1174
+ describeHasCheckingStringProperty: function() {
1175
+ return o;
1176
+ },
1177
+ describeStringPropertyAccess: function() {
1178
+ return k;
1179
+ },
1180
+ isRequestAPICallableInsideAfter: function() {
1181
+ return b;
1182
+ },
1183
+ throwWithStaticGenerationBailoutError: function() {
1184
+ return i;
1185
+ },
1186
+ throwWithStaticGenerationBailoutErrorWithDynamicError: function() {
1187
+ return p;
1188
+ },
1189
+ wellKnownProperties: function() {
1190
+ return x;
1191
+ }
1192
+ });
1193
+ const g = B(), _ = bt(), d = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
1194
+ function k(S, E) {
1195
+ return d.test(E) ? `\`${S}.${E}\`` : `\`${S}[${JSON.stringify(E)}]\``;
1196
+ }
1197
+ function o(S, E) {
1198
+ const P = JSON.stringify(E);
1199
+ return `\`Reflect.has(${S}, ${P})\`, \`${P} in ${S}\`, or similar`;
1200
+ }
1201
+ function i(S, E) {
1202
+ throw new g.StaticGenBailoutError(`Route ${S} couldn't be rendered statically because it used ${E}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);
1203
+ }
1204
+ function p(S, E) {
1205
+ throw new g.StaticGenBailoutError(`Route ${S} with \`dynamic = "error"\` couldn't be rendered statically because it used ${E}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);
1206
+ }
1207
+ function b() {
1208
+ const S = _.afterTaskAsyncStorage.getStore();
1209
+ return (S == null ? void 0 : S.rootTaskSpawnPhase) === "action";
1210
+ }
1211
+ const x = /* @__PURE__ */ new Set([
1212
+ "hasOwnProperty",
1213
+ "isPrototypeOf",
1214
+ "propertyIsEnumerable",
1215
+ "toString",
1216
+ "valueOf",
1217
+ "toLocaleString",
1218
+ // Promise prototype
1219
+ // fallthrough
1220
+ "then",
1221
+ "catch",
1222
+ "finally",
1223
+ // React Promise extension
1224
+ // fallthrough
1225
+ "status",
1226
+ // React introspection
1227
+ "displayName",
1228
+ // Common tested properties
1229
+ // fallthrough
1230
+ "toJSON",
1231
+ "$$typeof",
1232
+ "__esModule"
1233
+ ]);
1234
+ })(he)), he;
1235
+ }
1236
+ var Ve;
1237
+ function vt() {
1238
+ return Ve || (Ve = 1, (function(f) {
1239
+ Object.defineProperty(f, "__esModule", {
1240
+ value: !0
1241
+ }), Object.defineProperty(f, "cookies", {
1242
+ enumerable: !0,
1243
+ get: function() {
1244
+ return S;
1245
+ }
1246
+ });
1247
+ const y = yt(), g = Ze(), _ = U(), d = W(), k = Ae(), o = B(), i = _e(), p = ke(), b = et(), x = tt();
1248
+ function S() {
1249
+ const t = "cookies", r = _.workAsyncStorage.getStore(), l = d.workUnitAsyncStorage.getStore();
1250
+ if (r) {
1251
+ if (l && l.phase === "after" && !(0, x.isRequestAPICallableInsideAfter)())
1252
+ throw new Error(
1253
+ // TODO(after): clarify that this only applies to pages?
1254
+ `Route ${r.route} used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`
1255
+ );
1256
+ if (r.forceStatic) {
1257
+ const w = E();
1258
+ return q(w);
1259
+ }
1260
+ if (l) {
1261
+ if (l.type === "cache")
1262
+ throw new Error(`Route ${r.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`);
1263
+ if (l.type === "unstable-cache")
1264
+ throw new Error(`Route ${r.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`);
1265
+ }
1266
+ if (r.dynamicShouldError)
1267
+ throw new o.StaticGenBailoutError(`Route ${r.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);
1268
+ if (l) {
1269
+ if (l.type === "prerender")
1270
+ return I(r.route, l);
1271
+ l.type === "prerender-ppr" ? (0, k.postponeWithTracking)(r.route, t, l.dynamicTracking) : l.type === "prerender-legacy" && (0, k.throwToInterruptStaticGeneration)(t, r, l);
1272
+ }
1273
+ (0, k.trackDynamicDataInDynamicRender)(r, l);
1274
+ }
1275
+ const O = (0, d.getExpectedRequestStore)(t);
1276
+ let R;
1277
+ return (0, y.areCookiesMutableInCurrentPhase)(O) ? R = O.userspaceMutableCookies : R = O.cookies, process.env.NODE_ENV === "development" && !(r != null && r.isPrefetchRequest) ? D(R, r == null ? void 0 : r.route) : q(R);
1278
+ }
1279
+ function E() {
1280
+ return y.RequestCookiesAdapter.seal(new g.RequestCookies(new Headers({})));
1281
+ }
1282
+ const P = /* @__PURE__ */ new WeakMap();
1283
+ function I(t, r) {
1284
+ const l = P.get(r);
1285
+ if (l)
1286
+ return l;
1287
+ const O = (0, i.makeHangingPromise)(r.renderSignal, "`cookies()`");
1288
+ return P.set(r, O), Object.defineProperties(O, {
1289
+ [Symbol.iterator]: {
1290
+ value: function() {
1291
+ const R = "`cookies()[Symbol.iterator]()`", w = e(t, R);
1292
+ (0, k.abortAndThrowOnSynchronousRequestDataAccess)(t, R, w, r);
1293
+ }
1294
+ },
1295
+ size: {
1296
+ get() {
1297
+ const R = "`cookies().size`", w = e(t, R);
1298
+ (0, k.abortAndThrowOnSynchronousRequestDataAccess)(t, R, w, r);
1299
+ }
1300
+ },
1301
+ get: {
1302
+ value: function() {
1303
+ let w;
1304
+ arguments.length === 0 ? w = "`cookies().get()`" : w = `\`cookies().get(${v(arguments[0])})\``;
1305
+ const C = e(t, w);
1306
+ (0, k.abortAndThrowOnSynchronousRequestDataAccess)(t, w, C, r);
1307
+ }
1308
+ },
1309
+ getAll: {
1310
+ value: function() {
1311
+ let w;
1312
+ arguments.length === 0 ? w = "`cookies().getAll()`" : w = `\`cookies().getAll(${v(arguments[0])})\``;
1313
+ const C = e(t, w);
1314
+ (0, k.abortAndThrowOnSynchronousRequestDataAccess)(t, w, C, r);
1315
+ }
1316
+ },
1317
+ has: {
1318
+ value: function() {
1319
+ let w;
1320
+ arguments.length === 0 ? w = "`cookies().has()`" : w = `\`cookies().has(${v(arguments[0])})\``;
1321
+ const C = e(t, w);
1322
+ (0, k.abortAndThrowOnSynchronousRequestDataAccess)(t, w, C, r);
1323
+ }
1324
+ },
1325
+ set: {
1326
+ value: function() {
1327
+ let w;
1328
+ if (arguments.length === 0)
1329
+ w = "`cookies().set()`";
1330
+ else {
1331
+ const M = arguments[0];
1332
+ M ? w = `\`cookies().set(${v(M)}, ...)\`` : w = "`cookies().set(...)`";
1333
+ }
1334
+ const C = e(t, w);
1335
+ (0, k.abortAndThrowOnSynchronousRequestDataAccess)(t, w, C, r);
1336
+ }
1337
+ },
1338
+ delete: {
1339
+ value: function() {
1340
+ let R;
1341
+ arguments.length === 0 ? R = "`cookies().delete()`" : arguments.length === 1 ? R = `\`cookies().delete(${v(arguments[0])})\`` : R = `\`cookies().delete(${v(arguments[0])}, ...)\``;
1342
+ const w = e(t, R);
1343
+ (0, k.abortAndThrowOnSynchronousRequestDataAccess)(t, R, w, r);
1344
+ }
1345
+ },
1346
+ clear: {
1347
+ value: function() {
1348
+ const w = "`cookies().clear()`", C = e(t, w);
1349
+ (0, k.abortAndThrowOnSynchronousRequestDataAccess)(t, w, C, r);
1350
+ }
1351
+ },
1352
+ toString: {
1353
+ value: function() {
1354
+ const w = "`cookies().toString()`", C = e(t, w);
1355
+ (0, k.abortAndThrowOnSynchronousRequestDataAccess)(t, w, C, r);
1356
+ }
1357
+ }
1358
+ }), O;
1359
+ }
1360
+ function q(t) {
1361
+ const r = P.get(t);
1362
+ if (r)
1363
+ return r;
1364
+ const l = Promise.resolve(t);
1365
+ return P.set(t, l), Object.defineProperties(l, {
1366
+ [Symbol.iterator]: {
1367
+ value: t[Symbol.iterator] ? t[Symbol.iterator].bind(t) : (
1368
+ // We should remove this and unify our cookies types. We could just let this continue to throw lazily
1369
+ // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with
1370
+ // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it
1371
+ // has extra properties not available on RequestCookie instances.
1372
+ s.bind(t)
1373
+ )
1374
+ },
1375
+ size: {
1376
+ get() {
1377
+ return t.size;
1378
+ }
1379
+ },
1380
+ get: {
1381
+ value: t.get.bind(t)
1382
+ },
1383
+ getAll: {
1384
+ value: t.getAll.bind(t)
1385
+ },
1386
+ has: {
1387
+ value: t.has.bind(t)
1388
+ },
1389
+ set: {
1390
+ value: t.set.bind(t)
1391
+ },
1392
+ delete: {
1393
+ value: t.delete.bind(t)
1394
+ },
1395
+ clear: {
1396
+ value: (
1397
+ // @ts-expect-error clear is defined in RequestCookies implementation but not in the type
1398
+ typeof t.clear == "function" ? t.clear.bind(t) : (
1399
+ // We should remove this and unify our cookies types. We could just let this continue to throw lazily
1400
+ // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with
1401
+ // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it
1402
+ // has extra properties not available on RequestCookie instances.
1403
+ a.bind(t, l)
1404
+ )
1405
+ )
1406
+ },
1407
+ toString: {
1408
+ value: t.toString.bind(t)
1409
+ }
1410
+ }), l;
1411
+ }
1412
+ function D(t, r) {
1413
+ const l = P.get(t);
1414
+ if (l)
1415
+ return l;
1416
+ const O = new Promise((R) => (0, b.scheduleImmediate)(() => R(t)));
1417
+ return P.set(t, O), Object.defineProperties(O, {
1418
+ [Symbol.iterator]: {
1419
+ value: function() {
1420
+ return m(r, "`...cookies()` or similar iteration"), t[Symbol.iterator] ? t[Symbol.iterator].apply(t, arguments) : (
1421
+ // We should remove this and unify our cookies types. We could just let this continue to throw lazily
1422
+ // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with
1423
+ // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it
1424
+ // has extra properties not available on RequestCookie instances.
1425
+ s.call(t)
1426
+ );
1427
+ },
1428
+ writable: !1
1429
+ },
1430
+ size: {
1431
+ get() {
1432
+ return m(r, "`cookies().size`"), t.size;
1433
+ }
1434
+ },
1435
+ get: {
1436
+ value: function() {
1437
+ let w;
1438
+ return arguments.length === 0 ? w = "`cookies().get()`" : w = `\`cookies().get(${v(arguments[0])})\``, m(r, w), t.get.apply(t, arguments);
1439
+ },
1440
+ writable: !1
1441
+ },
1442
+ getAll: {
1443
+ value: function() {
1444
+ let w;
1445
+ return arguments.length === 0 ? w = "`cookies().getAll()`" : w = `\`cookies().getAll(${v(arguments[0])})\``, m(r, w), t.getAll.apply(t, arguments);
1446
+ },
1447
+ writable: !1
1448
+ },
1449
+ has: {
1450
+ value: function() {
1451
+ let w;
1452
+ return arguments.length === 0 ? w = "`cookies().has()`" : w = `\`cookies().has(${v(arguments[0])})\``, m(r, w), t.has.apply(t, arguments);
1453
+ },
1454
+ writable: !1
1455
+ },
1456
+ set: {
1457
+ value: function() {
1458
+ let w;
1459
+ if (arguments.length === 0)
1460
+ w = "`cookies().set()`";
1461
+ else {
1462
+ const C = arguments[0];
1463
+ C ? w = `\`cookies().set(${v(C)}, ...)\`` : w = "`cookies().set(...)`";
1464
+ }
1465
+ return m(r, w), t.set.apply(t, arguments);
1466
+ },
1467
+ writable: !1
1468
+ },
1469
+ delete: {
1470
+ value: function() {
1471
+ let R;
1472
+ return arguments.length === 0 ? R = "`cookies().delete()`" : arguments.length === 1 ? R = `\`cookies().delete(${v(arguments[0])})\`` : R = `\`cookies().delete(${v(arguments[0])}, ...)\``, m(r, R), t.delete.apply(t, arguments);
1473
+ },
1474
+ writable: !1
1475
+ },
1476
+ clear: {
1477
+ value: function() {
1478
+ return m(r, "`cookies().clear()`"), typeof t.clear == "function" ? t.clear.apply(t, arguments) : (
1479
+ // We should remove this and unify our cookies types. We could just let this continue to throw lazily
1480
+ // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with
1481
+ // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it
1482
+ // has extra properties not available on RequestCookie instances.
1483
+ a.call(t, O)
1484
+ );
1485
+ },
1486
+ writable: !1
1487
+ },
1488
+ toString: {
1489
+ value: function() {
1490
+ return m(r, "`cookies().toString()` or implicit casting"), t.toString.apply(t, arguments);
1491
+ },
1492
+ writable: !1
1493
+ }
1494
+ }), O;
1495
+ }
1496
+ function v(t) {
1497
+ return typeof t == "object" && t !== null && typeof t.name == "string" ? `'${t.name}'` : typeof t == "string" ? `'${t}'` : "...";
1498
+ }
1499
+ function m(t, r) {
1500
+ const l = d.workUnitAsyncStorage.getStore();
1501
+ if (l && l.type === "request" && l.prerenderPhase === !0) {
1502
+ const O = l;
1503
+ (0, k.trackSynchronousRequestDataAccessInDev)(O);
1504
+ }
1505
+ n(t, r);
1506
+ }
1507
+ const h = () => {
1508
+ }, n = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? h : (0, p.createDedupedByCallsiteServerErrorLoggerDev)(e);
1509
+ function e(t, r) {
1510
+ const l = t ? `Route "${t}" ` : "This route ";
1511
+ return new Error(`${l}used ${r}. \`cookies()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);
1512
+ }
1513
+ function s() {
1514
+ return this.getAll().map((t) => [
1515
+ t.name,
1516
+ t
1517
+ ]).values();
1518
+ }
1519
+ function a(t) {
1520
+ for (const r of this.getAll())
1521
+ this.delete(r.name);
1522
+ return t;
1523
+ }
1524
+ })(H)), H;
1525
+ }
1526
+ var ge = {}, be = {}, ze;
1527
+ function wt() {
1528
+ return ze || (ze = 1, (function(f) {
1529
+ Object.defineProperty(f, "__esModule", {
1530
+ value: !0
1531
+ });
1532
+ function y(k, o) {
1533
+ for (var i in o) Object.defineProperty(k, i, {
1534
+ enumerable: !0,
1535
+ get: o[i]
1536
+ });
1537
+ }
1538
+ y(f, {
1539
+ HeadersAdapter: function() {
1540
+ return d;
1541
+ },
1542
+ ReadonlyHeadersError: function() {
1543
+ return _;
1544
+ }
1545
+ });
1546
+ const g = Qe();
1547
+ class _ extends Error {
1548
+ constructor() {
1549
+ super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers");
1550
+ }
1551
+ static callable() {
1552
+ throw new _();
1553
+ }
1554
+ }
1555
+ class d extends Headers {
1556
+ constructor(o) {
1557
+ super(), this.headers = new Proxy(o, {
1558
+ get(i, p, b) {
1559
+ if (typeof p == "symbol")
1560
+ return g.ReflectAdapter.get(i, p, b);
1561
+ const x = p.toLowerCase(), S = Object.keys(o).find((E) => E.toLowerCase() === x);
1562
+ if (!(typeof S > "u"))
1563
+ return g.ReflectAdapter.get(i, S, b);
1564
+ },
1565
+ set(i, p, b, x) {
1566
+ if (typeof p == "symbol")
1567
+ return g.ReflectAdapter.set(i, p, b, x);
1568
+ const S = p.toLowerCase(), E = Object.keys(o).find((P) => P.toLowerCase() === S);
1569
+ return g.ReflectAdapter.set(i, E ?? p, b, x);
1570
+ },
1571
+ has(i, p) {
1572
+ if (typeof p == "symbol") return g.ReflectAdapter.has(i, p);
1573
+ const b = p.toLowerCase(), x = Object.keys(o).find((S) => S.toLowerCase() === b);
1574
+ return typeof x > "u" ? !1 : g.ReflectAdapter.has(i, x);
1575
+ },
1576
+ deleteProperty(i, p) {
1577
+ if (typeof p == "symbol") return g.ReflectAdapter.deleteProperty(i, p);
1578
+ const b = p.toLowerCase(), x = Object.keys(o).find((S) => S.toLowerCase() === b);
1579
+ return typeof x > "u" ? !0 : g.ReflectAdapter.deleteProperty(i, x);
1580
+ }
1581
+ });
1582
+ }
1583
+ /**
1584
+ * Seals a Headers instance to prevent modification by throwing an error when
1585
+ * any mutating method is called.
1586
+ */
1587
+ static seal(o) {
1588
+ return new Proxy(o, {
1589
+ get(i, p, b) {
1590
+ switch (p) {
1591
+ case "append":
1592
+ case "delete":
1593
+ case "set":
1594
+ return _.callable;
1595
+ default:
1596
+ return g.ReflectAdapter.get(i, p, b);
1597
+ }
1598
+ }
1599
+ });
1600
+ }
1601
+ /**
1602
+ * Merges a header value into a string. This stores multiple values as an
1603
+ * array, so we need to merge them into a string.
1604
+ *
1605
+ * @param value a header value
1606
+ * @returns a merged header value (a string)
1607
+ */
1608
+ merge(o) {
1609
+ return Array.isArray(o) ? o.join(", ") : o;
1610
+ }
1611
+ /**
1612
+ * Creates a Headers instance from a plain object or a Headers instance.
1613
+ *
1614
+ * @param headers a plain object or a Headers instance
1615
+ * @returns a headers instance
1616
+ */
1617
+ static from(o) {
1618
+ return o instanceof Headers ? o : new d(o);
1619
+ }
1620
+ append(o, i) {
1621
+ const p = this.headers[o];
1622
+ typeof p == "string" ? this.headers[o] = [
1623
+ p,
1624
+ i
1625
+ ] : Array.isArray(p) ? p.push(i) : this.headers[o] = i;
1626
+ }
1627
+ delete(o) {
1628
+ delete this.headers[o];
1629
+ }
1630
+ get(o) {
1631
+ const i = this.headers[o];
1632
+ return typeof i < "u" ? this.merge(i) : null;
1633
+ }
1634
+ has(o) {
1635
+ return typeof this.headers[o] < "u";
1636
+ }
1637
+ set(o, i) {
1638
+ this.headers[o] = i;
1639
+ }
1640
+ forEach(o, i) {
1641
+ for (const [p, b] of this.entries())
1642
+ o.call(i, b, p, this);
1643
+ }
1644
+ *entries() {
1645
+ for (const o of Object.keys(this.headers)) {
1646
+ const i = o.toLowerCase(), p = this.get(i);
1647
+ yield [
1648
+ i,
1649
+ p
1650
+ ];
1651
+ }
1652
+ }
1653
+ *keys() {
1654
+ for (const o of Object.keys(this.headers))
1655
+ yield o.toLowerCase();
1656
+ }
1657
+ *values() {
1658
+ for (const o of Object.keys(this.headers))
1659
+ yield this.get(o);
1660
+ }
1661
+ [Symbol.iterator]() {
1662
+ return this.entries();
1663
+ }
1664
+ }
1665
+ })(be)), be;
1666
+ }
1667
+ var Fe;
1668
+ function _t() {
1669
+ return Fe || (Fe = 1, (function(f) {
1670
+ Object.defineProperty(f, "__esModule", {
1671
+ value: !0
1672
+ }), Object.defineProperty(f, "headers", {
1673
+ enumerable: !0,
1674
+ get: function() {
1675
+ return x;
1676
+ }
1677
+ });
1678
+ const y = wt(), g = U(), _ = W(), d = Ae(), k = B(), o = _e(), i = ke(), p = et(), b = tt();
1679
+ function x() {
1680
+ const n = g.workAsyncStorage.getStore(), e = _.workUnitAsyncStorage.getStore();
1681
+ if (n) {
1682
+ if (e && e.phase === "after" && !(0, b.isRequestAPICallableInsideAfter)())
1683
+ throw new Error(`Route ${n.route} used "headers" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "headers" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`);
1684
+ if (n.forceStatic) {
1685
+ const a = y.HeadersAdapter.seal(new Headers({}));
1686
+ return P(a);
1687
+ }
1688
+ if (e) {
1689
+ if (e.type === "cache")
1690
+ throw new Error(`Route ${n.route} used "headers" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`);
1691
+ if (e.type === "unstable-cache")
1692
+ throw new Error(`Route ${n.route} used "headers" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`);
1693
+ }
1694
+ if (n.dynamicShouldError)
1695
+ throw new k.StaticGenBailoutError(`Route ${n.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);
1696
+ if (e) {
1697
+ if (e.type === "prerender")
1698
+ return E(n.route, e);
1699
+ e.type === "prerender-ppr" ? (0, d.postponeWithTracking)(n.route, "headers", e.dynamicTracking) : e.type === "prerender-legacy" && (0, d.throwToInterruptStaticGeneration)("headers", n, e);
1700
+ }
1701
+ (0, d.trackDynamicDataInDynamicRender)(n, e);
1702
+ }
1703
+ const s = (0, _.getExpectedRequestStore)("headers");
1704
+ return process.env.NODE_ENV === "development" && !(n != null && n.isPrefetchRequest) ? I(s.headers, n == null ? void 0 : n.route) : P(s.headers);
1705
+ }
1706
+ const S = /* @__PURE__ */ new WeakMap();
1707
+ function E(n, e) {
1708
+ const s = S.get(e);
1709
+ if (s)
1710
+ return s;
1711
+ const a = (0, o.makeHangingPromise)(e.renderSignal, "`headers()`");
1712
+ return S.set(e, a), Object.defineProperties(a, {
1713
+ append: {
1714
+ value: function() {
1715
+ const r = `\`headers().append(${q(arguments[0])}, ...)\``, l = h(n, r);
1716
+ (0, d.abortAndThrowOnSynchronousRequestDataAccess)(n, r, l, e);
1717
+ }
1718
+ },
1719
+ delete: {
1720
+ value: function() {
1721
+ const r = `\`headers().delete(${q(arguments[0])})\``, l = h(n, r);
1722
+ (0, d.abortAndThrowOnSynchronousRequestDataAccess)(n, r, l, e);
1723
+ }
1724
+ },
1725
+ get: {
1726
+ value: function() {
1727
+ const r = `\`headers().get(${q(arguments[0])})\``, l = h(n, r);
1728
+ (0, d.abortAndThrowOnSynchronousRequestDataAccess)(n, r, l, e);
1729
+ }
1730
+ },
1731
+ has: {
1732
+ value: function() {
1733
+ const r = `\`headers().has(${q(arguments[0])})\``, l = h(n, r);
1734
+ (0, d.abortAndThrowOnSynchronousRequestDataAccess)(n, r, l, e);
1735
+ }
1736
+ },
1737
+ set: {
1738
+ value: function() {
1739
+ const r = `\`headers().set(${q(arguments[0])}, ...)\``, l = h(n, r);
1740
+ (0, d.abortAndThrowOnSynchronousRequestDataAccess)(n, r, l, e);
1741
+ }
1742
+ },
1743
+ getSetCookie: {
1744
+ value: function() {
1745
+ const r = "`headers().getSetCookie()`", l = h(n, r);
1746
+ (0, d.abortAndThrowOnSynchronousRequestDataAccess)(n, r, l, e);
1747
+ }
1748
+ },
1749
+ forEach: {
1750
+ value: function() {
1751
+ const r = "`headers().forEach(...)`", l = h(n, r);
1752
+ (0, d.abortAndThrowOnSynchronousRequestDataAccess)(n, r, l, e);
1753
+ }
1754
+ },
1755
+ keys: {
1756
+ value: function() {
1757
+ const r = "`headers().keys()`", l = h(n, r);
1758
+ (0, d.abortAndThrowOnSynchronousRequestDataAccess)(n, r, l, e);
1759
+ }
1760
+ },
1761
+ values: {
1762
+ value: function() {
1763
+ const r = "`headers().values()`", l = h(n, r);
1764
+ (0, d.abortAndThrowOnSynchronousRequestDataAccess)(n, r, l, e);
1765
+ }
1766
+ },
1767
+ entries: {
1768
+ value: function() {
1769
+ const r = "`headers().entries()`", l = h(n, r);
1770
+ (0, d.abortAndThrowOnSynchronousRequestDataAccess)(n, r, l, e);
1771
+ }
1772
+ },
1773
+ [Symbol.iterator]: {
1774
+ value: function() {
1775
+ const t = "`headers()[Symbol.iterator]()`", r = h(n, t);
1776
+ (0, d.abortAndThrowOnSynchronousRequestDataAccess)(n, t, r, e);
1777
+ }
1778
+ }
1779
+ }), a;
1780
+ }
1781
+ function P(n) {
1782
+ const e = S.get(n);
1783
+ if (e)
1784
+ return e;
1785
+ const s = Promise.resolve(n);
1786
+ return S.set(n, s), Object.defineProperties(s, {
1787
+ append: {
1788
+ value: n.append.bind(n)
1789
+ },
1790
+ delete: {
1791
+ value: n.delete.bind(n)
1792
+ },
1793
+ get: {
1794
+ value: n.get.bind(n)
1795
+ },
1796
+ has: {
1797
+ value: n.has.bind(n)
1798
+ },
1799
+ set: {
1800
+ value: n.set.bind(n)
1801
+ },
1802
+ getSetCookie: {
1803
+ value: n.getSetCookie.bind(n)
1804
+ },
1805
+ forEach: {
1806
+ value: n.forEach.bind(n)
1807
+ },
1808
+ keys: {
1809
+ value: n.keys.bind(n)
1810
+ },
1811
+ values: {
1812
+ value: n.values.bind(n)
1813
+ },
1814
+ entries: {
1815
+ value: n.entries.bind(n)
1816
+ },
1817
+ [Symbol.iterator]: {
1818
+ value: n[Symbol.iterator].bind(n)
1819
+ }
1820
+ }), s;
1821
+ }
1822
+ function I(n, e) {
1823
+ const s = S.get(n);
1824
+ if (s)
1825
+ return s;
1826
+ const a = new Promise((t) => (0, p.scheduleImmediate)(() => t(n)));
1827
+ return S.set(n, a), Object.defineProperties(a, {
1828
+ append: {
1829
+ value: function() {
1830
+ const r = `\`headers().append(${q(arguments[0])}, ...)\``;
1831
+ return D(e, r), n.append.apply(n, arguments);
1832
+ }
1833
+ },
1834
+ delete: {
1835
+ value: function() {
1836
+ const r = `\`headers().delete(${q(arguments[0])})\``;
1837
+ return D(e, r), n.delete.apply(n, arguments);
1838
+ }
1839
+ },
1840
+ get: {
1841
+ value: function() {
1842
+ const r = `\`headers().get(${q(arguments[0])})\``;
1843
+ return D(e, r), n.get.apply(n, arguments);
1844
+ }
1845
+ },
1846
+ has: {
1847
+ value: function() {
1848
+ const r = `\`headers().has(${q(arguments[0])})\``;
1849
+ return D(e, r), n.has.apply(n, arguments);
1850
+ }
1851
+ },
1852
+ set: {
1853
+ value: function() {
1854
+ const r = `\`headers().set(${q(arguments[0])}, ...)\``;
1855
+ return D(e, r), n.set.apply(n, arguments);
1856
+ }
1857
+ },
1858
+ getSetCookie: {
1859
+ value: function() {
1860
+ return D(e, "`headers().getSetCookie()`"), n.getSetCookie.apply(n, arguments);
1861
+ }
1862
+ },
1863
+ forEach: {
1864
+ value: function() {
1865
+ return D(e, "`headers().forEach(...)`"), n.forEach.apply(n, arguments);
1866
+ }
1867
+ },
1868
+ keys: {
1869
+ value: function() {
1870
+ return D(e, "`headers().keys()`"), n.keys.apply(n, arguments);
1871
+ }
1872
+ },
1873
+ values: {
1874
+ value: function() {
1875
+ return D(e, "`headers().values()`"), n.values.apply(n, arguments);
1876
+ }
1877
+ },
1878
+ entries: {
1879
+ value: function() {
1880
+ return D(e, "`headers().entries()`"), n.entries.apply(n, arguments);
1881
+ }
1882
+ },
1883
+ [Symbol.iterator]: {
1884
+ value: function() {
1885
+ return D(e, "`...headers()` or similar iteration"), n[Symbol.iterator].apply(n, arguments);
1886
+ }
1887
+ }
1888
+ }), a;
1889
+ }
1890
+ function q(n) {
1891
+ return typeof n == "string" ? `'${n}'` : "...";
1892
+ }
1893
+ function D(n, e) {
1894
+ const s = _.workUnitAsyncStorage.getStore();
1895
+ if (s && s.type === "request" && s.prerenderPhase === !0) {
1896
+ const a = s;
1897
+ (0, d.trackSynchronousRequestDataAccessInDev)(a);
1898
+ }
1899
+ m(n, e);
1900
+ }
1901
+ const v = () => {
1902
+ }, m = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? v : (0, i.createDedupedByCallsiteServerErrorLoggerDev)(h);
1903
+ function h(n, e) {
1904
+ const s = n ? `Route "${n}" ` : "This route ";
1905
+ return new Error(`${s}used ${e}. \`headers()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);
1906
+ }
1907
+ })(ge)), ge;
1908
+ }
1909
+ var ve = {}, Xe;
1910
+ function At() {
1911
+ return Xe || (Xe = 1, (function(f) {
1912
+ Object.defineProperty(f, "__esModule", {
1913
+ value: !0
1914
+ }), Object.defineProperty(f, "draftMode", {
1915
+ enumerable: !0,
1916
+ get: function() {
1917
+ return i;
1918
+ }
1919
+ });
1920
+ const y = W(), g = U(), _ = Ae(), d = ke(), k = B(), o = He();
1921
+ function i() {
1922
+ const v = "draftMode", m = g.workAsyncStorage.getStore(), h = y.workUnitAsyncStorage.getStore();
1923
+ if (h && (h.type === "cache" || h.type === "unstable-cache" || h.type === "prerender" || h.type === "prerender-ppr" || h.type === "prerender-legacy"))
1924
+ if (process.env.NODE_ENV === "development" && !(m != null && m.isPrefetchRequest)) {
1925
+ const a = m == null ? void 0 : m.route;
1926
+ return x(null, a);
1927
+ } else
1928
+ return b(null);
1929
+ const n = (0, y.getExpectedRequestStore)(v), e = p.get(n.draftMode);
1930
+ if (e)
1931
+ return e;
1932
+ let s;
1933
+ if (process.env.NODE_ENV === "development" && !(m != null && m.isPrefetchRequest)) {
1934
+ const a = m == null ? void 0 : m.route;
1935
+ s = x(n.draftMode, a);
1936
+ } else
1937
+ s = b(n.draftMode);
1938
+ return p.set(n.draftMode, s), s;
1939
+ }
1940
+ const p = /* @__PURE__ */ new WeakMap();
1941
+ function b(v) {
1942
+ const m = new S(v), h = Promise.resolve(m);
1943
+ return Object.defineProperty(h, "isEnabled", {
1944
+ get() {
1945
+ return m.isEnabled;
1946
+ },
1947
+ set(n) {
1948
+ Object.defineProperty(h, "isEnabled", {
1949
+ value: n,
1950
+ writable: !0,
1951
+ enumerable: !0
1952
+ });
1953
+ },
1954
+ enumerable: !0,
1955
+ configurable: !0
1956
+ }), h.enable = m.enable.bind(m), h.disable = m.disable.bind(m), h;
1957
+ }
1958
+ function x(v, m) {
1959
+ const h = new S(v), n = Promise.resolve(h);
1960
+ return Object.defineProperty(n, "isEnabled", {
1961
+ get() {
1962
+ return E(m, "`draftMode().isEnabled`"), h.isEnabled;
1963
+ },
1964
+ set(e) {
1965
+ Object.defineProperty(n, "isEnabled", {
1966
+ value: e,
1967
+ writable: !0,
1968
+ enumerable: !0
1969
+ });
1970
+ },
1971
+ enumerable: !0,
1972
+ configurable: !0
1973
+ }), Object.defineProperty(n, "enable", {
1974
+ value: function() {
1975
+ return E(m, "`draftMode().enable()`"), h.enable.apply(h, arguments);
1976
+ }
1977
+ }), Object.defineProperty(n, "disable", {
1978
+ value: function() {
1979
+ return E(m, "`draftMode().disable()`"), h.disable.apply(h, arguments);
1980
+ }
1981
+ }), n;
1982
+ }
1983
+ class S {
1984
+ constructor(m) {
1985
+ this._provider = m;
1986
+ }
1987
+ get isEnabled() {
1988
+ return this._provider !== null ? this._provider.isEnabled : !1;
1989
+ }
1990
+ enable() {
1991
+ D("draftMode().enable()"), this._provider !== null && this._provider.enable();
1992
+ }
1993
+ disable() {
1994
+ D("draftMode().disable()"), this._provider !== null && this._provider.disable();
1995
+ }
1996
+ }
1997
+ function E(v, m) {
1998
+ const h = y.workUnitAsyncStorage.getStore();
1999
+ if (h && h.type === "request" && h.prerenderPhase === !0) {
2000
+ const n = h;
2001
+ (0, _.trackSynchronousRequestDataAccessInDev)(n);
2002
+ }
2003
+ I(v, m);
2004
+ }
2005
+ const P = () => {
2006
+ }, I = process.env.__NEXT_DISABLE_SYNC_DYNAMIC_API_WARNINGS ? P : (0, d.createDedupedByCallsiteServerErrorLoggerDev)(q);
2007
+ function q(v, m) {
2008
+ const h = v ? `Route "${v}" ` : "This route ";
2009
+ return new Error(`${h}used ${m}. \`draftMode()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);
2010
+ }
2011
+ function D(v) {
2012
+ const m = g.workAsyncStorage.getStore(), h = y.workUnitAsyncStorage.getStore();
2013
+ if (m) {
2014
+ if (h) {
2015
+ if (h.type === "cache")
2016
+ throw new Error(`Route ${m.route} used "${v}" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`);
2017
+ if (h.type === "unstable-cache")
2018
+ throw new Error(`Route ${m.route} used "${v}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`);
2019
+ if (h.phase === "after")
2020
+ throw new Error(`Route ${m.route} used "${v}" inside \`after\`. The enabled status of draftMode can be read inside \`after\` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`);
2021
+ }
2022
+ if (m.dynamicShouldError)
2023
+ throw new k.StaticGenBailoutError(`Route ${m.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${v}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);
2024
+ if (h)
2025
+ if (h.type === "prerender") {
2026
+ const n = new Error(`Route ${m.route} used ${v} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`);
2027
+ (0, _.abortAndThrowOnSynchronousRequestDataAccess)(m.route, v, n, h);
2028
+ } else if (h.type === "prerender-ppr")
2029
+ (0, _.postponeWithTracking)(m.route, v, h.dynamicTracking);
2030
+ else if (h.type === "prerender-legacy") {
2031
+ h.revalidate = 0;
2032
+ const n = new o.DynamicServerError(`Route ${m.route} couldn't be rendered statically because it used \`${v}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);
2033
+ throw m.dynamicUsageDescription = v, m.dynamicUsageStack = n.stack, n;
2034
+ } else process.env.NODE_ENV === "development" && h && h.type === "request" && (h.usedDynamic = !0);
2035
+ }
2036
+ }
2037
+ })(ve)), ve;
2038
+ }
2039
+ var Je;
2040
+ function kt() {
2041
+ return Je || (Je = 1, L.cookies = vt().cookies, L.headers = _t().headers, L.draftMode = At().draftMode), L;
2042
+ }
2043
+ var St = kt();
2044
+ const Pt = {
2045
+ PROFILE_UPDATED: "user-profile-updated",
2046
+ LOGGED_IN: "user-logged-in",
2047
+ LOGGED_OUT: "user-logged-out"
2048
+ };
2049
+ function qt(f, y) {
2050
+ const g = new CustomEvent(f, { detail: y });
2051
+ window.dispatchEvent(g);
2052
+ }
2053
+ function Tt(f, y) {
2054
+ const g = (_) => {
2055
+ y(_.detail);
2056
+ };
2057
+ return window.addEventListener(f, g), () => window.removeEventListener(f, g);
2058
+ }
2059
+ function $t(f, y) {
2060
+ window.removeEventListener(f, y);
2061
+ }
2062
+ async function It({ extra: f, children: y, className: g, hideNews: _, hideLogin: d }) {
2063
+ var S;
2064
+ let k = {
2065
+ data: {}
2066
+ };
2067
+ const i = (S = (await St.cookies()).get("refresh_token")) == null ? void 0 : S.value, p = typeof i < "u" && i !== "";
2068
+ try {
2069
+ p && (k = await dt.get("/v2/users/profile", {
2070
+ baseURL: process.env.ICHAINGO_AUTH_INNER_API_URL
2071
+ }));
2072
+ } catch (E) {
2073
+ console.error(E), k = {
2074
+ data: {}
2075
+ };
2076
+ }
2077
+ const b = Re(() => import("./Right-Duk1k2Xj.js"), { ssr: !0 }), x = Re(() => import("./Logo-BxSWGm8n.js"), { ssr: !0 });
2078
+ return /* @__PURE__ */ Q("div", { className: lt("sticky left-0 right-0 top-0 bg-background h-16 z-999", g), children: [
2079
+ /* @__PURE__ */ Q("div", { className: "md:bg-module h-13 text-center flex flex-wrap justify-between items-center gap-2 px-4", children: [
2080
+ /* @__PURE__ */ Q("div", { className: "flex items-center flex-1 gap-6", children: [
2081
+ /* @__PURE__ */ Se(x, {}),
2082
+ y
2083
+ ] }),
2084
+ /* @__PURE__ */ Se(b, { hideNews: _, hideLogin: d, user: (k == null ? void 0 : k.data) || {} })
2085
+ ] }),
2086
+ f
2087
+ ] });
2088
+ }
2089
+ export {
2090
+ It as H,
2091
+ Pt as U,
2092
+ $t as c,
2093
+ qt as e,
2094
+ Tt as o
2095
+ };