ambient-display 1.1.12 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/_app/immutable/chunks/-6v_nyr3.js +5 -0
- package/build/client/_app/immutable/chunks/-6v_nyr3.js.br +0 -0
- package/build/client/_app/immutable/chunks/-6v_nyr3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bfhjek-f.js +3 -0
- package/build/client/_app/immutable/chunks/Bfhjek-f.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bfhjek-f.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C7I4vMbc.js +1 -0
- package/build/client/_app/immutable/chunks/C7I4vMbc.js.br +2 -0
- package/build/client/_app/immutable/chunks/C7I4vMbc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CDVeMiAl.js +1 -0
- package/build/client/_app/immutable/chunks/CDVeMiAl.js.br +0 -0
- package/build/client/_app/immutable/chunks/CDVeMiAl.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CvUX3i4L.js +1 -0
- package/build/client/_app/immutable/chunks/CvUX3i4L.js.br +0 -0
- package/build/client/_app/immutable/chunks/CvUX3i4L.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D1JCCJf3.js +4 -0
- package/build/client/_app/immutable/chunks/D1JCCJf3.js.br +0 -0
- package/build/client/_app/immutable/chunks/D1JCCJf3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DGTGMr-5.js +2 -0
- package/build/client/_app/immutable/chunks/DGTGMr-5.js.br +0 -0
- package/build/client/_app/immutable/chunks/DGTGMr-5.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DnG2xkSB.js +1 -0
- package/build/client/_app/immutable/chunks/DnG2xkSB.js.br +2 -0
- package/build/client/_app/immutable/chunks/DnG2xkSB.js.gz +0 -0
- package/build/client/_app/immutable/chunks/EvVuwjft.js +1 -0
- package/build/client/_app/immutable/chunks/EvVuwjft.js.br +0 -0
- package/build/client/_app/immutable/chunks/EvVuwjft.js.gz +0 -0
- package/build/client/_app/immutable/chunks/qSIFE6bv.js +1 -0
- package/build/client/_app/immutable/chunks/qSIFE6bv.js.br +0 -0
- package/build/client/_app/immutable/chunks/qSIFE6bv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/ynvIH2CR.js +1 -0
- package/build/client/_app/immutable/chunks/ynvIH2CR.js.br +0 -0
- package/build/client/_app/immutable/chunks/ynvIH2CR.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.BnYS1ESK.js +2 -0
- package/build/client/_app/immutable/entry/app.BnYS1ESK.js.br +0 -0
- package/build/client/_app/immutable/entry/app.BnYS1ESK.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.GAUDqQZ9.js +1 -0
- package/build/client/_app/immutable/entry/start.GAUDqQZ9.js.br +2 -0
- package/build/client/_app/immutable/entry/start.GAUDqQZ9.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.B1ZZMXc6.js +2 -0
- package/build/client/_app/immutable/nodes/0.B1ZZMXc6.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.B1ZZMXc6.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.CRiXPoo7.js +1 -0
- package/build/client/_app/immutable/nodes/1.CRiXPoo7.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.CRiXPoo7.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.BCvH_-7k.js +1 -0
- package/build/client/_app/immutable/nodes/2.BCvH_-7k.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.BCvH_-7k.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.CkzNUk9P.js +1 -0
- package/build/client/_app/immutable/nodes/3.CkzNUk9P.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.CkzNUk9P.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/server/chunks/{0-CcOQpCXU.js → 0-Bedes_cv.js} +3 -3
- package/build/server/chunks/0-Bedes_cv.js.map +1 -0
- package/build/server/chunks/1-BRZwGoSV.js +9 -0
- package/build/server/chunks/1-BRZwGoSV.js.map +1 -0
- package/build/server/chunks/2-B3ii1avX.js +9 -0
- package/build/server/chunks/2-B3ii1avX.js.map +1 -0
- package/build/server/chunks/3-Cz5Rp48l.js +9 -0
- package/build/server/chunks/3-Cz5Rp48l.js.map +1 -0
- package/build/server/chunks/LoadingIndicator-BjVqwEwa.js +10 -0
- package/build/server/chunks/LoadingIndicator-BjVqwEwa.js.map +1 -0
- package/build/server/chunks/{LoadingIndicator.svelte_svelte_type_style_lang-DEM6cLRl.js → LoadingIndicator.svelte_svelte_type_style_lang-CzuFb3Rb.js} +2 -2
- package/build/server/chunks/{LoadingIndicator.svelte_svelte_type_style_lang-DEM6cLRl.js.map → LoadingIndicator.svelte_svelte_type_style_lang-CzuFb3Rb.js.map} +1 -1
- package/build/server/chunks/{PlayingTracker-CNLMY2hy.js → PlayingTracker-DagWUwKl.js} +3 -3
- package/build/server/chunks/{PlayingTracker-CNLMY2hy.js.map → PlayingTracker-DagWUwKl.js.map} +1 -1
- package/build/server/chunks/{_layout.svelte-BHhTC2tp.js → _layout.svelte-D_Vfu08M.js} +5 -4
- package/build/server/chunks/_layout.svelte-D_Vfu08M.js.map +1 -0
- package/build/server/chunks/{_page.svelte-D9L5iBit.js → _page.svelte-CY_oFa2x.js} +15 -16
- package/build/server/chunks/_page.svelte-CY_oFa2x.js.map +1 -0
- package/build/server/chunks/_page.svelte-Csehl0cs.js +114 -0
- package/build/server/chunks/_page.svelte-Csehl0cs.js.map +1 -0
- package/build/server/chunks/error.svelte-DGl1DMvJ.js +55 -0
- package/build/server/chunks/error.svelte-DGl1DMvJ.js.map +1 -0
- package/build/server/chunks/{exports-DAjI6ZSp.js → exports-D0QHgeSL.js} +2 -17
- package/build/server/chunks/exports-D0QHgeSL.js.map +1 -0
- package/build/server/chunks/{index2-BA59f76P.js → index2-DObisaVF.js} +337 -297
- package/build/server/chunks/index2-DObisaVF.js.map +1 -0
- package/build/server/index.js +345 -156
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +6 -5
- package/build/server/manifest.js.map +1 -1
- package/package.json +1 -1
- package/server/spotify/auth.js +26 -20
- package/server/spotify/index.js +5 -3
- package/server/spotify/sdk.js +21 -14
- package/server/spotify_auth.json +7 -1
- package/build/client/_app/immutable/chunks/LoadingIndicator.BukS53i0.js +0 -1
- package/build/client/_app/immutable/chunks/LoadingIndicator.BukS53i0.js.br +0 -0
- package/build/client/_app/immutable/chunks/LoadingIndicator.BukS53i0.js.gz +0 -0
- package/build/client/_app/immutable/chunks/PlayingTracker.98fc0gbU.js +0 -5
- package/build/client/_app/immutable/chunks/PlayingTracker.98fc0gbU.js.br +0 -0
- package/build/client/_app/immutable/chunks/PlayingTracker.98fc0gbU.js.gz +0 -0
- package/build/client/_app/immutable/chunks/disclose-version.N57b1q78.js +0 -1
- package/build/client/_app/immutable/chunks/disclose-version.N57b1q78.js.br +0 -0
- package/build/client/_app/immutable/chunks/disclose-version.N57b1q78.js.gz +0 -0
- package/build/client/_app/immutable/chunks/entry.ejCVhezY.js +0 -3
- package/build/client/_app/immutable/chunks/entry.ejCVhezY.js.br +0 -0
- package/build/client/_app/immutable/chunks/entry.ejCVhezY.js.gz +0 -0
- package/build/client/_app/immutable/chunks/index-client.DV07uIiZ.js +0 -1
- package/build/client/_app/immutable/chunks/index-client.DV07uIiZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/index-client.DV07uIiZ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/index.CSSyc5xk.js +0 -4
- package/build/client/_app/immutable/chunks/index.CSSyc5xk.js.br +0 -0
- package/build/client/_app/immutable/chunks/index.CSSyc5xk.js.gz +0 -0
- package/build/client/_app/immutable/chunks/index.DFULH2AN.js +0 -1
- package/build/client/_app/immutable/chunks/index.DFULH2AN.js.br +0 -0
- package/build/client/_app/immutable/chunks/index.DFULH2AN.js.gz +0 -0
- package/build/client/_app/immutable/chunks/legacy.DZgMwYuQ.js +0 -1
- package/build/client/_app/immutable/chunks/legacy.DZgMwYuQ.js.br +0 -0
- package/build/client/_app/immutable/chunks/legacy.DZgMwYuQ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/props.DYfFZGja.js +0 -1
- package/build/client/_app/immutable/chunks/props.DYfFZGja.js.br +0 -0
- package/build/client/_app/immutable/chunks/props.DYfFZGja.js.gz +0 -0
- package/build/client/_app/immutable/chunks/snippet.BVSCguOu.js +0 -1
- package/build/client/_app/immutable/chunks/snippet.BVSCguOu.js.br +0 -0
- package/build/client/_app/immutable/chunks/snippet.BVSCguOu.js.gz +0 -0
- package/build/client/_app/immutable/chunks/this.EZLWgc5v.js +0 -1
- package/build/client/_app/immutable/chunks/this.EZLWgc5v.js.br +0 -0
- package/build/client/_app/immutable/chunks/this.EZLWgc5v.js.gz +0 -0
- package/build/client/_app/immutable/chunks/utils.BXcQV2KO.js +0 -1
- package/build/client/_app/immutable/chunks/utils.BXcQV2KO.js.br +0 -0
- package/build/client/_app/immutable/chunks/utils.BXcQV2KO.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.RUcGX1JI.js +0 -2
- package/build/client/_app/immutable/entry/app.RUcGX1JI.js.br +0 -0
- package/build/client/_app/immutable/entry/app.RUcGX1JI.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.BESP6Y2s.js +0 -1
- package/build/client/_app/immutable/entry/start.BESP6Y2s.js.br +0 -2
- package/build/client/_app/immutable/entry/start.BESP6Y2s.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.YOQIp7Zo.js +0 -2
- package/build/client/_app/immutable/nodes/0.YOQIp7Zo.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.YOQIp7Zo.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.LDqagCtz.js +0 -1
- package/build/client/_app/immutable/nodes/1.LDqagCtz.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.LDqagCtz.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.D6pNjKYR.js +0 -1
- package/build/client/_app/immutable/nodes/2.D6pNjKYR.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.D6pNjKYR.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.C7gikcXT.js +0 -1
- package/build/client/_app/immutable/nodes/3.C7gikcXT.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.C7gikcXT.js.gz +0 -0
- package/build/server/chunks/0-CcOQpCXU.js.map +0 -1
- package/build/server/chunks/1-BOId0K8p.js +0 -9
- package/build/server/chunks/1-BOId0K8p.js.map +0 -1
- package/build/server/chunks/2-Bn-uEZm1.js +0 -9
- package/build/server/chunks/2-Bn-uEZm1.js.map +0 -1
- package/build/server/chunks/3-D5OhaZz4.js +0 -9
- package/build/server/chunks/3-D5OhaZz4.js.map +0 -1
- package/build/server/chunks/LoadingIndicator-CW4ord-4.js +0 -10
- package/build/server/chunks/LoadingIndicator-CW4ord-4.js.map +0 -1
- package/build/server/chunks/_layout.svelte-BHhTC2tp.js.map +0 -1
- package/build/server/chunks/_page.svelte-D9L5iBit.js.map +0 -1
- package/build/server/chunks/_page.svelte-IR8zDMaR.js +0 -115
- package/build/server/chunks/_page.svelte-IR8zDMaR.js.map +0 -1
- package/build/server/chunks/error.svelte-BZE1ioPX.js +0 -116
- package/build/server/chunks/error.svelte-BZE1ioPX.js.map +0 -1
- package/build/server/chunks/exports-DAjI6ZSp.js.map +0 -1
- package/build/server/chunks/index2-BA59f76P.js.map +0 -1
package/build/server/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { r as render,
|
|
2
|
-
import { d as decode_pathname,
|
|
1
|
+
import { r as render, L as LEGACY_PROPS, g as get, f as flushSync, d as define_property, i as init_operations, a as get_first_child, H as HYDRATION_START, b as get_next_sibling, c as HYDRATION_ERROR, e as HYDRATION_END, h as hydration_failed, j as clear_text_content, s as safe_equals, k as increment_write_version, l as array_from, m as component_root, n as equals, D as DIRTY, o as set_signal_status, C as CLEAN, U as UNOWNED, p as DERIVED, q as schedule_effect, t as is_passive_event, u as set_active_reaction, v as set_active_effect, w as is_array, x as active_effect, y as active_reaction, z as untracking, A as is_runes, B as BLOCK_EFFECT, E as derived_sources, F as state_unsafe_mutation, G as BRANCH_EFFECT, R as ROOT_EFFECT, I as untracked_writes, J as set_untracked_writes, M as MAYBE_DIRTY, K as create_text, N as branch, O as push, P as setContext, Q as pop, S as push$1, T as component_context, V as pop$1, W as BROWSER, X as readable, Y as writable } from './chunks/index2-DObisaVF.js';
|
|
2
|
+
import { d as decode_pathname, a as decode_params, n as normalize_path, b as disable_search, r as resolve, m as make_trackable } from './chunks/exports-D0QHgeSL.js';
|
|
3
3
|
|
|
4
4
|
let base = "";
|
|
5
5
|
let assets = base;
|
|
6
|
+
const app_dir = "_app";
|
|
6
7
|
const initial = { base, assets };
|
|
7
8
|
function override(paths) {
|
|
8
9
|
base = paths.base;
|
|
@@ -20,6 +21,11 @@ function set_public_env(environment) {
|
|
|
20
21
|
function set_safe_public_env(environment) {
|
|
21
22
|
safe_public_env = environment;
|
|
22
23
|
}
|
|
24
|
+
function hydration_mismatch(location) {
|
|
25
|
+
{
|
|
26
|
+
console.warn(`https://svelte.dev/e/hydration_mismatch`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
23
29
|
function source(v, stack) {
|
|
24
30
|
var signal = {
|
|
25
31
|
f: 0,
|
|
@@ -27,7 +33,8 @@ function source(v, stack) {
|
|
|
27
33
|
v,
|
|
28
34
|
reactions: null,
|
|
29
35
|
equals,
|
|
30
|
-
|
|
36
|
+
rv: 0,
|
|
37
|
+
wv: 0
|
|
31
38
|
};
|
|
32
39
|
return signal;
|
|
33
40
|
}
|
|
@@ -40,7 +47,7 @@ function mutable_source(initial_value, immutable = false) {
|
|
|
40
47
|
return s;
|
|
41
48
|
}
|
|
42
49
|
function set(source2, value) {
|
|
43
|
-
if (active_reaction !== null && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT)) !== 0 && // If the source was created locally within the current derived, then
|
|
50
|
+
if (active_reaction !== null && !untracking && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT)) !== 0 && // If the source was created locally within the current derived, then
|
|
44
51
|
// we allow the mutation.
|
|
45
52
|
(derived_sources === null || !derived_sources.includes(source2))) {
|
|
46
53
|
state_unsafe_mutation();
|
|
@@ -49,19 +56,15 @@ function set(source2, value) {
|
|
|
49
56
|
}
|
|
50
57
|
function internal_set(source2, value) {
|
|
51
58
|
if (!source2.equals(value)) {
|
|
59
|
+
source2.v;
|
|
52
60
|
source2.v = value;
|
|
53
|
-
source2.
|
|
61
|
+
source2.wv = increment_write_version();
|
|
54
62
|
mark_reactions(source2, DIRTY);
|
|
55
|
-
if (active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & BRANCH_EFFECT) === 0) {
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
schedule_effect(active_effect);
|
|
63
|
+
if (active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) {
|
|
64
|
+
if (untracked_writes === null) {
|
|
65
|
+
set_untracked_writes([source2]);
|
|
59
66
|
} else {
|
|
60
|
-
|
|
61
|
-
set_untracked_writes([source2]);
|
|
62
|
-
} else {
|
|
63
|
-
untracked_writes.push(source2);
|
|
64
|
-
}
|
|
67
|
+
untracked_writes.push(source2);
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
70
|
}
|
|
@@ -92,11 +95,6 @@ function mark_reactions(signal, status) {
|
|
|
92
95
|
}
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
|
-
function hydration_mismatch(location) {
|
|
96
|
-
{
|
|
97
|
-
console.warn(`https://svelte.dev/e/hydration_mismatch`);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
98
|
let hydrating = false;
|
|
101
99
|
function set_hydrating(value) {
|
|
102
100
|
hydrating = value;
|
|
@@ -167,8 +165,10 @@ function handle_event_propagation(event) {
|
|
|
167
165
|
current_target.host || null;
|
|
168
166
|
try {
|
|
169
167
|
var delegated = current_target["__" + event_name];
|
|
170
|
-
if (delegated !== void 0 && !/** @type {any} */
|
|
171
|
-
current_target.disabled
|
|
168
|
+
if (delegated !== void 0 && (!/** @type {any} */
|
|
169
|
+
current_target.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
170
|
+
// -> the target could not have been disabled because it emits the event in the first place
|
|
171
|
+
event.target === current_target)) {
|
|
172
172
|
if (is_array(delegated)) {
|
|
173
173
|
var [fn, ...data] = delegated;
|
|
174
174
|
fn.apply(current_target, [event, ...data]);
|
|
@@ -406,7 +406,7 @@ class Svelte4Component {
|
|
|
406
406
|
recover: options2.recover
|
|
407
407
|
});
|
|
408
408
|
if (!options2?.props?.$$host || options2.sync === false) {
|
|
409
|
-
|
|
409
|
+
flushSync();
|
|
410
410
|
}
|
|
411
411
|
this.#events = props.$$events;
|
|
412
412
|
for (const key of Object.keys(this.#instance)) {
|
|
@@ -520,7 +520,6 @@ function Root($$payload, $$props) {
|
|
|
520
520
|
}
|
|
521
521
|
const root = asClassComponent(Root);
|
|
522
522
|
const options = {
|
|
523
|
-
app_dir: "_app",
|
|
524
523
|
app_template_contains_nonce: false,
|
|
525
524
|
csp: { "mode": "auto", "directives": { "upgrade-insecure-requests": false, "block-all-mixed-content": false }, "reportOnly": { "upgrade-insecure-requests": false, "block-all-mixed-content": false } },
|
|
526
525
|
csrf_check_origin: true,
|
|
@@ -606,7 +605,7 @@ const options = {
|
|
|
606
605
|
<div class="error">
|
|
607
606
|
<span class="status">` + status + '</span>\n <div class="message">\n <h1>' + message + "</h1>\n </div>\n </div>\n </body>\n</html>\n"
|
|
608
607
|
},
|
|
609
|
-
version_hash: "
|
|
608
|
+
version_hash: "7i5xsq"
|
|
610
609
|
};
|
|
611
610
|
async function get_hooks() {
|
|
612
611
|
let handle;
|
|
@@ -1386,14 +1385,66 @@ function requireCookie () {
|
|
|
1386
1385
|
var __toString = Object.prototype.toString;
|
|
1387
1386
|
|
|
1388
1387
|
/**
|
|
1389
|
-
* RegExp to match
|
|
1388
|
+
* RegExp to match cookie-name in RFC 6265 sec 4.1.1
|
|
1389
|
+
* This refers out to the obsoleted definition of token in RFC 2616 sec 2.2
|
|
1390
|
+
* which has been replaced by the token definition in RFC 7230 appendix B.
|
|
1391
|
+
*
|
|
1392
|
+
* cookie-name = token
|
|
1393
|
+
* token = 1*tchar
|
|
1394
|
+
* tchar = "!" / "#" / "$" / "%" / "&" / "'" /
|
|
1395
|
+
* "*" / "+" / "-" / "." / "^" / "_" /
|
|
1396
|
+
* "`" / "|" / "~" / DIGIT / ALPHA
|
|
1397
|
+
*/
|
|
1398
|
+
|
|
1399
|
+
var cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
1400
|
+
|
|
1401
|
+
/**
|
|
1402
|
+
* RegExp to match cookie-value in RFC 6265 sec 4.1.1
|
|
1403
|
+
*
|
|
1404
|
+
* cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
|
|
1405
|
+
* cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
|
|
1406
|
+
* ; US-ASCII characters excluding CTLs,
|
|
1407
|
+
* ; whitespace DQUOTE, comma, semicolon,
|
|
1408
|
+
* ; and backslash
|
|
1409
|
+
*/
|
|
1410
|
+
|
|
1411
|
+
var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/;
|
|
1412
|
+
|
|
1413
|
+
/**
|
|
1414
|
+
* RegExp to match domain-value in RFC 6265 sec 4.1.1
|
|
1390
1415
|
*
|
|
1391
|
-
*
|
|
1392
|
-
*
|
|
1393
|
-
*
|
|
1416
|
+
* domain-value = <subdomain>
|
|
1417
|
+
* ; defined in [RFC1034], Section 3.5, as
|
|
1418
|
+
* ; enhanced by [RFC1123], Section 2.1
|
|
1419
|
+
* <subdomain> = <label> | <subdomain> "." <label>
|
|
1420
|
+
* <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]
|
|
1421
|
+
* Labels must be 63 characters or less.
|
|
1422
|
+
* 'let-dig' not 'letter' in the first char, per RFC1123
|
|
1423
|
+
* <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>
|
|
1424
|
+
* <let-dig-hyp> = <let-dig> | "-"
|
|
1425
|
+
* <let-dig> = <letter> | <digit>
|
|
1426
|
+
* <letter> = any one of the 52 alphabetic characters A through Z in
|
|
1427
|
+
* upper case and a through z in lower case
|
|
1428
|
+
* <digit> = any one of the ten digits 0 through 9
|
|
1429
|
+
*
|
|
1430
|
+
* Keep support for leading dot: https://github.com/jshttp/cookie/issues/173
|
|
1431
|
+
*
|
|
1432
|
+
* > (Note that a leading %x2E ("."), if present, is ignored even though that
|
|
1433
|
+
* character is not permitted, but a trailing %x2E ("."), if present, will
|
|
1434
|
+
* cause the user agent to ignore the attribute.)
|
|
1394
1435
|
*/
|
|
1395
1436
|
|
|
1396
|
-
var
|
|
1437
|
+
var domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
|
|
1438
|
+
|
|
1439
|
+
/**
|
|
1440
|
+
* RegExp to match path-value in RFC 6265 sec 4.1.1
|
|
1441
|
+
*
|
|
1442
|
+
* path-value = <any CHAR except CTLs or ";">
|
|
1443
|
+
* CHAR = %x01-7F
|
|
1444
|
+
* ; defined in RFC 5234 appendix B.1
|
|
1445
|
+
*/
|
|
1446
|
+
|
|
1447
|
+
var pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
|
|
1397
1448
|
|
|
1398
1449
|
/**
|
|
1399
1450
|
* Parse a cookie header.
|
|
@@ -1402,107 +1453,128 @@ function requireCookie () {
|
|
|
1402
1453
|
* The object has the various cookies as keys(names) => values
|
|
1403
1454
|
*
|
|
1404
1455
|
* @param {string} str
|
|
1405
|
-
* @param {object} [
|
|
1456
|
+
* @param {object} [opt]
|
|
1406
1457
|
* @return {object}
|
|
1407
1458
|
* @public
|
|
1408
1459
|
*/
|
|
1409
1460
|
|
|
1410
|
-
function parse(str,
|
|
1461
|
+
function parse(str, opt) {
|
|
1411
1462
|
if (typeof str !== 'string') {
|
|
1412
1463
|
throw new TypeError('argument str must be a string');
|
|
1413
1464
|
}
|
|
1414
1465
|
|
|
1415
1466
|
var obj = {};
|
|
1416
|
-
var
|
|
1417
|
-
|
|
1467
|
+
var len = str.length;
|
|
1468
|
+
// RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.
|
|
1469
|
+
if (len < 2) return obj;
|
|
1418
1470
|
|
|
1471
|
+
var dec = (opt && opt.decode) || decode;
|
|
1419
1472
|
var index = 0;
|
|
1420
|
-
|
|
1421
|
-
|
|
1473
|
+
var eqIdx = 0;
|
|
1474
|
+
var endIdx = 0;
|
|
1422
1475
|
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
}
|
|
1476
|
+
do {
|
|
1477
|
+
eqIdx = str.indexOf('=', index);
|
|
1478
|
+
if (eqIdx === -1) break; // No more cookie pairs.
|
|
1427
1479
|
|
|
1428
|
-
|
|
1480
|
+
endIdx = str.indexOf(';', index);
|
|
1429
1481
|
|
|
1430
1482
|
if (endIdx === -1) {
|
|
1431
|
-
endIdx =
|
|
1432
|
-
} else if (
|
|
1483
|
+
endIdx = len;
|
|
1484
|
+
} else if (eqIdx > endIdx) {
|
|
1433
1485
|
// backtrack on prior semicolon
|
|
1434
1486
|
index = str.lastIndexOf(';', eqIdx - 1) + 1;
|
|
1435
|
-
continue
|
|
1487
|
+
continue;
|
|
1436
1488
|
}
|
|
1437
1489
|
|
|
1438
|
-
var
|
|
1490
|
+
var keyStartIdx = startIndex(str, index, eqIdx);
|
|
1491
|
+
var keyEndIdx = endIndex(str, eqIdx, keyStartIdx);
|
|
1492
|
+
var key = str.slice(keyStartIdx, keyEndIdx);
|
|
1439
1493
|
|
|
1440
1494
|
// only assign once
|
|
1441
|
-
if (
|
|
1442
|
-
var
|
|
1495
|
+
if (!obj.hasOwnProperty(key)) {
|
|
1496
|
+
var valStartIdx = startIndex(str, eqIdx + 1, endIdx);
|
|
1497
|
+
var valEndIdx = endIndex(str, endIdx, valStartIdx);
|
|
1443
1498
|
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1499
|
+
if (str.charCodeAt(valStartIdx) === 0x22 /* " */ && str.charCodeAt(valEndIdx - 1) === 0x22 /* " */) {
|
|
1500
|
+
valStartIdx++;
|
|
1501
|
+
valEndIdx--;
|
|
1447
1502
|
}
|
|
1448
1503
|
|
|
1504
|
+
var val = str.slice(valStartIdx, valEndIdx);
|
|
1449
1505
|
obj[key] = tryDecode(val, dec);
|
|
1450
1506
|
}
|
|
1451
1507
|
|
|
1452
1508
|
index = endIdx + 1;
|
|
1453
|
-
}
|
|
1509
|
+
} while (index < len);
|
|
1454
1510
|
|
|
1455
1511
|
return obj;
|
|
1456
1512
|
}
|
|
1457
1513
|
|
|
1514
|
+
function startIndex(str, index, max) {
|
|
1515
|
+
do {
|
|
1516
|
+
var code = str.charCodeAt(index);
|
|
1517
|
+
if (code !== 0x20 /* */ && code !== 0x09 /* \t */) return index;
|
|
1518
|
+
} while (++index < max);
|
|
1519
|
+
return max;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
function endIndex(str, index, min) {
|
|
1523
|
+
while (index > min) {
|
|
1524
|
+
var code = str.charCodeAt(--index);
|
|
1525
|
+
if (code !== 0x20 /* */ && code !== 0x09 /* \t */) return index + 1;
|
|
1526
|
+
}
|
|
1527
|
+
return min;
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1458
1530
|
/**
|
|
1459
1531
|
* Serialize data into a cookie header.
|
|
1460
1532
|
*
|
|
1461
|
-
* Serialize
|
|
1462
|
-
* http headers. An optional options object
|
|
1533
|
+
* Serialize a name value pair into a cookie string suitable for
|
|
1534
|
+
* http headers. An optional options object specifies cookie parameters.
|
|
1463
1535
|
*
|
|
1464
1536
|
* serialize('foo', 'bar', { httpOnly: true })
|
|
1465
1537
|
* => "foo=bar; httpOnly"
|
|
1466
1538
|
*
|
|
1467
1539
|
* @param {string} name
|
|
1468
1540
|
* @param {string} val
|
|
1469
|
-
* @param {object} [
|
|
1541
|
+
* @param {object} [opt]
|
|
1470
1542
|
* @return {string}
|
|
1471
1543
|
* @public
|
|
1472
1544
|
*/
|
|
1473
1545
|
|
|
1474
|
-
function serialize(name, val,
|
|
1475
|
-
var
|
|
1476
|
-
var enc = opt.encode || encode;
|
|
1546
|
+
function serialize(name, val, opt) {
|
|
1547
|
+
var enc = (opt && opt.encode) || encodeURIComponent;
|
|
1477
1548
|
|
|
1478
1549
|
if (typeof enc !== 'function') {
|
|
1479
1550
|
throw new TypeError('option encode is invalid');
|
|
1480
1551
|
}
|
|
1481
1552
|
|
|
1482
|
-
if (!
|
|
1553
|
+
if (!cookieNameRegExp.test(name)) {
|
|
1483
1554
|
throw new TypeError('argument name is invalid');
|
|
1484
1555
|
}
|
|
1485
1556
|
|
|
1486
1557
|
var value = enc(val);
|
|
1487
1558
|
|
|
1488
|
-
if (
|
|
1559
|
+
if (!cookieValueRegExp.test(value)) {
|
|
1489
1560
|
throw new TypeError('argument val is invalid');
|
|
1490
1561
|
}
|
|
1491
1562
|
|
|
1492
1563
|
var str = name + '=' + value;
|
|
1564
|
+
if (!opt) return str;
|
|
1493
1565
|
|
|
1494
1566
|
if (null != opt.maxAge) {
|
|
1495
|
-
var maxAge = opt.maxAge
|
|
1567
|
+
var maxAge = Math.floor(opt.maxAge);
|
|
1496
1568
|
|
|
1497
|
-
if (
|
|
1569
|
+
if (!isFinite(maxAge)) {
|
|
1498
1570
|
throw new TypeError('option maxAge is invalid')
|
|
1499
1571
|
}
|
|
1500
1572
|
|
|
1501
|
-
str += '; Max-Age=' +
|
|
1573
|
+
str += '; Max-Age=' + maxAge;
|
|
1502
1574
|
}
|
|
1503
1575
|
|
|
1504
1576
|
if (opt.domain) {
|
|
1505
|
-
if (!
|
|
1577
|
+
if (!domainValueRegExp.test(opt.domain)) {
|
|
1506
1578
|
throw new TypeError('option domain is invalid');
|
|
1507
1579
|
}
|
|
1508
1580
|
|
|
@@ -1510,7 +1582,7 @@ function requireCookie () {
|
|
|
1510
1582
|
}
|
|
1511
1583
|
|
|
1512
1584
|
if (opt.path) {
|
|
1513
|
-
if (!
|
|
1585
|
+
if (!pathValueRegExp.test(opt.path)) {
|
|
1514
1586
|
throw new TypeError('option path is invalid');
|
|
1515
1587
|
}
|
|
1516
1588
|
|
|
@@ -1541,8 +1613,7 @@ function requireCookie () {
|
|
|
1541
1613
|
|
|
1542
1614
|
if (opt.priority) {
|
|
1543
1615
|
var priority = typeof opt.priority === 'string'
|
|
1544
|
-
? opt.priority.toLowerCase()
|
|
1545
|
-
: opt.priority;
|
|
1616
|
+
? opt.priority.toLowerCase() : opt.priority;
|
|
1546
1617
|
|
|
1547
1618
|
switch (priority) {
|
|
1548
1619
|
case 'low':
|
|
@@ -1597,17 +1668,6 @@ function requireCookie () {
|
|
|
1597
1668
|
: str
|
|
1598
1669
|
}
|
|
1599
1670
|
|
|
1600
|
-
/**
|
|
1601
|
-
* URL-encode value.
|
|
1602
|
-
*
|
|
1603
|
-
* @param {string} val
|
|
1604
|
-
* @returns {string}
|
|
1605
|
-
*/
|
|
1606
|
-
|
|
1607
|
-
function encode (val) {
|
|
1608
|
-
return encodeURIComponent(val)
|
|
1609
|
-
}
|
|
1610
|
-
|
|
1611
1671
|
/**
|
|
1612
1672
|
* Determine if value is a Date.
|
|
1613
1673
|
*
|
|
@@ -1616,8 +1676,7 @@ function requireCookie () {
|
|
|
1616
1676
|
*/
|
|
1617
1677
|
|
|
1618
1678
|
function isDate (val) {
|
|
1619
|
-
return __toString.call(val) === '[object Date]'
|
|
1620
|
-
val instanceof Date
|
|
1679
|
+
return __toString.call(val) === '[object Date]';
|
|
1621
1680
|
}
|
|
1622
1681
|
|
|
1623
1682
|
/**
|
|
@@ -1976,6 +2035,31 @@ class ActionFailure {
|
|
|
1976
2035
|
this.data = data;
|
|
1977
2036
|
}
|
|
1978
2037
|
}
|
|
2038
|
+
const DATA_SUFFIX = "/__data.json";
|
|
2039
|
+
const HTML_DATA_SUFFIX = ".html__data.json";
|
|
2040
|
+
function has_data_suffix(pathname) {
|
|
2041
|
+
return pathname.endsWith(DATA_SUFFIX) || pathname.endsWith(HTML_DATA_SUFFIX);
|
|
2042
|
+
}
|
|
2043
|
+
function add_data_suffix(pathname) {
|
|
2044
|
+
if (pathname.endsWith(".html")) return pathname.replace(/\.html$/, HTML_DATA_SUFFIX);
|
|
2045
|
+
return pathname.replace(/\/$/, "") + DATA_SUFFIX;
|
|
2046
|
+
}
|
|
2047
|
+
function strip_data_suffix(pathname) {
|
|
2048
|
+
if (pathname.endsWith(HTML_DATA_SUFFIX)) {
|
|
2049
|
+
return pathname.slice(0, -HTML_DATA_SUFFIX.length) + ".html";
|
|
2050
|
+
}
|
|
2051
|
+
return pathname.slice(0, -DATA_SUFFIX.length);
|
|
2052
|
+
}
|
|
2053
|
+
const ROUTE_SUFFIX = "/__route.js";
|
|
2054
|
+
function has_resolution_suffix(pathname) {
|
|
2055
|
+
return pathname.endsWith(ROUTE_SUFFIX);
|
|
2056
|
+
}
|
|
2057
|
+
function add_resolution_suffix(pathname) {
|
|
2058
|
+
return pathname.replace(/\/$/, "") + ROUTE_SUFFIX;
|
|
2059
|
+
}
|
|
2060
|
+
function strip_resolution_suffix(pathname) {
|
|
2061
|
+
return pathname.slice(0, -ROUTE_SUFFIX.length);
|
|
2062
|
+
}
|
|
1979
2063
|
function json(data, init2) {
|
|
1980
2064
|
const body2 = JSON.stringify(data);
|
|
1981
2065
|
const headers2 = new Headers(init2?.headers);
|
|
@@ -2431,6 +2515,18 @@ function b64_encode(buffer) {
|
|
|
2431
2515
|
)
|
|
2432
2516
|
);
|
|
2433
2517
|
}
|
|
2518
|
+
function get_relative_path(from, to) {
|
|
2519
|
+
const from_parts = from.split(/[/\\]/);
|
|
2520
|
+
const to_parts = to.split(/[/\\]/);
|
|
2521
|
+
from_parts.pop();
|
|
2522
|
+
while (from_parts[0] === to_parts[0]) {
|
|
2523
|
+
from_parts.shift();
|
|
2524
|
+
to_parts.shift();
|
|
2525
|
+
}
|
|
2526
|
+
let i = from_parts.length;
|
|
2527
|
+
while (i--) from_parts[i] = "..";
|
|
2528
|
+
return from_parts.concat(to_parts).join("/");
|
|
2529
|
+
}
|
|
2434
2530
|
async function load_server_data({ event, state, node, parent }) {
|
|
2435
2531
|
if (!node?.server) return null;
|
|
2436
2532
|
let is_tracking = true;
|
|
@@ -2557,7 +2653,7 @@ function create_universal_fetch(event, state, fetched, csr, resolve_opts) {
|
|
|
2557
2653
|
dependency = { response, body: null };
|
|
2558
2654
|
state.prerendering.dependencies.set(url.pathname, dependency);
|
|
2559
2655
|
}
|
|
2560
|
-
} else {
|
|
2656
|
+
} else if (url.protocol === "https:" || url.protocol === "http:") {
|
|
2561
2657
|
const mode = input instanceof Request ? input.mode : init2?.mode ?? "cors";
|
|
2562
2658
|
if (mode === "no-cors") {
|
|
2563
2659
|
response = new Response("", {
|
|
@@ -2956,9 +3052,6 @@ class BaseProvider {
|
|
|
2956
3052
|
if (this.#style_src_needs_csp) {
|
|
2957
3053
|
this.#style_src.push(source);
|
|
2958
3054
|
}
|
|
2959
|
-
if (this.#style_src_needs_csp) {
|
|
2960
|
-
this.#style_src.push(source);
|
|
2961
|
-
}
|
|
2962
3055
|
if (this.#style_src_attr_needs_csp) {
|
|
2963
3056
|
this.#style_src_attr.push(source);
|
|
2964
3057
|
}
|
|
@@ -3129,6 +3222,119 @@ function create_async_iterator() {
|
|
|
3129
3222
|
}
|
|
3130
3223
|
};
|
|
3131
3224
|
}
|
|
3225
|
+
function exec(match, params, matchers) {
|
|
3226
|
+
const result = {};
|
|
3227
|
+
const values = match.slice(1);
|
|
3228
|
+
const values_needing_match = values.filter((value) => value !== void 0);
|
|
3229
|
+
let buffered = 0;
|
|
3230
|
+
for (let i = 0; i < params.length; i += 1) {
|
|
3231
|
+
const param = params[i];
|
|
3232
|
+
let value = values[i - buffered];
|
|
3233
|
+
if (param.chained && param.rest && buffered) {
|
|
3234
|
+
value = values.slice(i - buffered, i + 1).filter((s2) => s2).join("/");
|
|
3235
|
+
buffered = 0;
|
|
3236
|
+
}
|
|
3237
|
+
if (value === void 0) {
|
|
3238
|
+
if (param.rest) result[param.name] = "";
|
|
3239
|
+
continue;
|
|
3240
|
+
}
|
|
3241
|
+
if (!param.matcher || matchers[param.matcher](value)) {
|
|
3242
|
+
result[param.name] = value;
|
|
3243
|
+
const next_param = params[i + 1];
|
|
3244
|
+
const next_value = values[i + 1];
|
|
3245
|
+
if (next_param && !next_param.rest && next_param.optional && next_value && param.chained) {
|
|
3246
|
+
buffered = 0;
|
|
3247
|
+
}
|
|
3248
|
+
if (!next_param && !next_value && Object.keys(result).length === values_needing_match.length) {
|
|
3249
|
+
buffered = 0;
|
|
3250
|
+
}
|
|
3251
|
+
continue;
|
|
3252
|
+
}
|
|
3253
|
+
if (param.optional && param.chained) {
|
|
3254
|
+
buffered++;
|
|
3255
|
+
continue;
|
|
3256
|
+
}
|
|
3257
|
+
return;
|
|
3258
|
+
}
|
|
3259
|
+
if (buffered) return;
|
|
3260
|
+
return result;
|
|
3261
|
+
}
|
|
3262
|
+
function generate_route_object(route, url, manifest) {
|
|
3263
|
+
const { errors, layouts, leaf } = route;
|
|
3264
|
+
const nodes = [...errors, ...layouts.map((l) => l?.[1]), leaf[1]].filter((n) => typeof n === "number").map((n) => `'${n}': () => ${create_client_import(manifest._.client.nodes?.[n], url)}`).join(",\n ");
|
|
3265
|
+
return [
|
|
3266
|
+
`{
|
|
3267
|
+
id: ${s(route.id)}`,
|
|
3268
|
+
`errors: ${s(route.errors)}`,
|
|
3269
|
+
`layouts: ${s(route.layouts)}`,
|
|
3270
|
+
`leaf: ${s(route.leaf)}`,
|
|
3271
|
+
`nodes: {
|
|
3272
|
+
${nodes}
|
|
3273
|
+
}
|
|
3274
|
+
}`
|
|
3275
|
+
].join(",\n ");
|
|
3276
|
+
}
|
|
3277
|
+
function create_client_import(import_path, url) {
|
|
3278
|
+
if (!import_path) return "Promise.resolve({})";
|
|
3279
|
+
if (import_path[0] === "/") {
|
|
3280
|
+
return `import('${import_path}')`;
|
|
3281
|
+
}
|
|
3282
|
+
if (assets !== "") {
|
|
3283
|
+
return `import('${assets}/${import_path}')`;
|
|
3284
|
+
}
|
|
3285
|
+
let path = get_relative_path(url.pathname, `${base}/${import_path}`);
|
|
3286
|
+
if (path[0] !== ".") path = `./${path}`;
|
|
3287
|
+
return `import('${path}')`;
|
|
3288
|
+
}
|
|
3289
|
+
async function resolve_route(resolved_path, url, manifest) {
|
|
3290
|
+
if (!manifest._.client.routes) {
|
|
3291
|
+
return text("Server-side route resolution disabled", { status: 400 });
|
|
3292
|
+
}
|
|
3293
|
+
let route = null;
|
|
3294
|
+
let params = {};
|
|
3295
|
+
const matchers = await manifest._.matchers();
|
|
3296
|
+
for (const candidate of manifest._.client.routes) {
|
|
3297
|
+
const match = candidate.pattern.exec(resolved_path);
|
|
3298
|
+
if (!match) continue;
|
|
3299
|
+
const matched = exec(match, candidate.params, matchers);
|
|
3300
|
+
if (matched) {
|
|
3301
|
+
route = candidate;
|
|
3302
|
+
params = decode_params(matched);
|
|
3303
|
+
break;
|
|
3304
|
+
}
|
|
3305
|
+
}
|
|
3306
|
+
return create_server_routing_response(route, params, url, manifest).response;
|
|
3307
|
+
}
|
|
3308
|
+
function create_server_routing_response(route, params, url, manifest) {
|
|
3309
|
+
const headers2 = new Headers({
|
|
3310
|
+
"content-type": "application/javascript; charset=utf-8"
|
|
3311
|
+
});
|
|
3312
|
+
if (route) {
|
|
3313
|
+
const csr_route = generate_route_object(route, url, manifest);
|
|
3314
|
+
const body2 = `${create_css_import(route, url, manifest)}
|
|
3315
|
+
export const route = ${csr_route}; export const params = ${JSON.stringify(params)};`;
|
|
3316
|
+
return { response: text(body2, { headers: headers2 }), body: body2 };
|
|
3317
|
+
} else {
|
|
3318
|
+
return { response: text("", { headers: headers2 }), body: "" };
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
function create_css_import(route, url, manifest) {
|
|
3322
|
+
const { errors, layouts, leaf } = route;
|
|
3323
|
+
let css = "";
|
|
3324
|
+
for (const node of [...errors, ...layouts.map((l) => l?.[1]), leaf[1]]) {
|
|
3325
|
+
if (typeof node !== "number") continue;
|
|
3326
|
+
const node_css = manifest._.client.css?.[node];
|
|
3327
|
+
for (const css_path of node_css ?? []) {
|
|
3328
|
+
css += `'${assets || base}/${css_path}',`;
|
|
3329
|
+
}
|
|
3330
|
+
}
|
|
3331
|
+
if (!css) return "";
|
|
3332
|
+
return `${create_client_import(
|
|
3333
|
+
/** @type {string} */
|
|
3334
|
+
manifest._.client.start,
|
|
3335
|
+
url
|
|
3336
|
+
)}.then(x => x.load_css([${css}]));`;
|
|
3337
|
+
}
|
|
3132
3338
|
const updated = {
|
|
3133
3339
|
...readable(false),
|
|
3134
3340
|
check: () => false
|
|
@@ -3246,17 +3452,13 @@ async function render_response({
|
|
|
3246
3452
|
}
|
|
3247
3453
|
return `${assets$1}/${path}`;
|
|
3248
3454
|
};
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
<style>${client.inline.style}</style>`;
|
|
3252
|
-
}
|
|
3253
|
-
if (inline_styles.size > 0) {
|
|
3254
|
-
const content = Array.from(inline_styles.values()).join("\n");
|
|
3455
|
+
const style = client.inline ? client.inline?.style : Array.from(inline_styles.values()).join("\n");
|
|
3456
|
+
if (style) {
|
|
3255
3457
|
const attributes = [];
|
|
3256
3458
|
if (csp.style_needs_nonce) attributes.push(` nonce="${csp.nonce}"`);
|
|
3257
|
-
csp.add_style(
|
|
3459
|
+
csp.add_style(style);
|
|
3258
3460
|
head += `
|
|
3259
|
-
<style${attributes.join("")}>${
|
|
3461
|
+
<style${attributes.join("")}>${style}</style>`;
|
|
3260
3462
|
}
|
|
3261
3463
|
for (const dep of stylesheets) {
|
|
3262
3464
|
const path = prefixed(dep);
|
|
@@ -3302,8 +3504,9 @@ async function render_response({
|
|
|
3302
3504
|
).join("\n ")}`;
|
|
3303
3505
|
}
|
|
3304
3506
|
if (page_config.csr) {
|
|
3507
|
+
const route = manifest._.client.routes?.find((r) => r.id === event.route.id) ?? null;
|
|
3305
3508
|
if (client.uses_env_dynamic_public && state.prerendering) {
|
|
3306
|
-
modulepreloads.add(`${
|
|
3509
|
+
modulepreloads.add(`${app_dir}/env.js`);
|
|
3307
3510
|
}
|
|
3308
3511
|
if (!client.inline) {
|
|
3309
3512
|
const included_modulepreloads = Array.from(modulepreloads, (dep) => prefixed(dep)).filter(
|
|
@@ -3320,6 +3523,13 @@ async function render_response({
|
|
|
3320
3523
|
}
|
|
3321
3524
|
}
|
|
3322
3525
|
}
|
|
3526
|
+
if (manifest._.client.routes && state.prerendering && !state.prerendering.fallback) {
|
|
3527
|
+
const pathname = add_resolution_suffix(event.url.pathname);
|
|
3528
|
+
state.prerendering.dependencies.set(
|
|
3529
|
+
pathname,
|
|
3530
|
+
create_server_routing_response(route, event.params, new URL(pathname, event.url), manifest)
|
|
3531
|
+
);
|
|
3532
|
+
}
|
|
3323
3533
|
const blocks = [];
|
|
3324
3534
|
const load_env_eagerly = client.uses_env_dynamic_public && state.prerendering;
|
|
3325
3535
|
const properties = [`base: ${base_expression}`];
|
|
@@ -3375,7 +3585,15 @@ async function render_response({
|
|
|
3375
3585
|
if (status !== 200) {
|
|
3376
3586
|
hydrate.push(`status: ${status}`);
|
|
3377
3587
|
}
|
|
3378
|
-
if (
|
|
3588
|
+
if (manifest._.client.routes) {
|
|
3589
|
+
if (route) {
|
|
3590
|
+
const stringified = generate_route_object(route, event.url, manifest).replaceAll(
|
|
3591
|
+
"\n",
|
|
3592
|
+
"\n "
|
|
3593
|
+
);
|
|
3594
|
+
hydrate.push(`params: ${uneval(event.params)}`, `server_route: ${stringified}`);
|
|
3595
|
+
}
|
|
3596
|
+
} else if (options2.embedded) {
|
|
3379
3597
|
hydrate.push(`params: ${uneval(event.params)}`, `route: ${s(event.route)}`);
|
|
3380
3598
|
}
|
|
3381
3599
|
const indent = " ".repeat(load_env_eagerly ? 7 : 6);
|
|
@@ -3395,7 +3613,7 @@ ${indent}}`);
|
|
|
3395
3613
|
app.start(${args.join(", ")})
|
|
3396
3614
|
});`;
|
|
3397
3615
|
if (load_env_eagerly) {
|
|
3398
|
-
blocks.push(`import(${s(`${base$1}/${
|
|
3616
|
+
blocks.push(`import(${s(`${base$1}/${app_dir}/env.js`)}).then(({ env }) => {
|
|
3399
3617
|
${global}.env = env;
|
|
3400
3618
|
|
|
3401
3619
|
${boot.replace(/\n/g, "\n ")}
|
|
@@ -3899,7 +4117,10 @@ async function render_page(event, page, options2, manifest, state, resolve_opts)
|
|
|
3899
4117
|
status = action_result.status;
|
|
3900
4118
|
}
|
|
3901
4119
|
}
|
|
3902
|
-
const should_prerender_data = nodes.some(
|
|
4120
|
+
const should_prerender_data = nodes.some(
|
|
4121
|
+
// prerender in case of trailingSlash because the client retrieves that value from the server
|
|
4122
|
+
(node) => node?.server?.load || node?.server?.trailingSlash !== void 0
|
|
4123
|
+
);
|
|
3903
4124
|
const data_pathname = add_data_suffix(event.url.pathname);
|
|
3904
4125
|
const should_prerender = get_option(nodes, "prerender") ?? false;
|
|
3905
4126
|
if (should_prerender) {
|
|
@@ -4097,43 +4318,6 @@ async function render_page(event, page, options2, manifest, state, resolve_opts)
|
|
|
4097
4318
|
});
|
|
4098
4319
|
}
|
|
4099
4320
|
}
|
|
4100
|
-
function exec(match, params, matchers) {
|
|
4101
|
-
const result = {};
|
|
4102
|
-
const values = match.slice(1);
|
|
4103
|
-
const values_needing_match = values.filter((value) => value !== void 0);
|
|
4104
|
-
let buffered = 0;
|
|
4105
|
-
for (let i = 0; i < params.length; i += 1) {
|
|
4106
|
-
const param = params[i];
|
|
4107
|
-
let value = values[i - buffered];
|
|
4108
|
-
if (param.chained && param.rest && buffered) {
|
|
4109
|
-
value = values.slice(i - buffered, i + 1).filter((s2) => s2).join("/");
|
|
4110
|
-
buffered = 0;
|
|
4111
|
-
}
|
|
4112
|
-
if (value === void 0) {
|
|
4113
|
-
if (param.rest) result[param.name] = "";
|
|
4114
|
-
continue;
|
|
4115
|
-
}
|
|
4116
|
-
if (!param.matcher || matchers[param.matcher](value)) {
|
|
4117
|
-
result[param.name] = value;
|
|
4118
|
-
const next_param = params[i + 1];
|
|
4119
|
-
const next_value = values[i + 1];
|
|
4120
|
-
if (next_param && !next_param.rest && next_param.optional && next_value && param.chained) {
|
|
4121
|
-
buffered = 0;
|
|
4122
|
-
}
|
|
4123
|
-
if (!next_param && !next_value && Object.keys(result).length === values_needing_match.length) {
|
|
4124
|
-
buffered = 0;
|
|
4125
|
-
}
|
|
4126
|
-
continue;
|
|
4127
|
-
}
|
|
4128
|
-
if (param.optional && param.chained) {
|
|
4129
|
-
buffered++;
|
|
4130
|
-
continue;
|
|
4131
|
-
}
|
|
4132
|
-
return;
|
|
4133
|
-
}
|
|
4134
|
-
if (buffered) return;
|
|
4135
|
-
return result;
|
|
4136
|
-
}
|
|
4137
4321
|
const INVALID_COOKIE_CHARACTER_REGEX = /[\x00-\x1F\x7F()<>@,;:"/[\]?={} \t]/;
|
|
4138
4322
|
function validate_options(options2) {
|
|
4139
4323
|
if (options2?.path === void 0) {
|
|
@@ -4157,7 +4341,7 @@ function get_cookies(request, url, trailing_slash) {
|
|
|
4157
4341
|
// sufficient to do so.
|
|
4158
4342
|
/**
|
|
4159
4343
|
* @param {string} name
|
|
4160
|
-
* @param {import('cookie').CookieParseOptions} opts
|
|
4344
|
+
* @param {import('cookie').CookieParseOptions} [opts]
|
|
4161
4345
|
*/
|
|
4162
4346
|
get(name, opts) {
|
|
4163
4347
|
const c = new_cookies[name];
|
|
@@ -4169,7 +4353,7 @@ function get_cookies(request, url, trailing_slash) {
|
|
|
4169
4353
|
return cookie;
|
|
4170
4354
|
},
|
|
4171
4355
|
/**
|
|
4172
|
-
* @param {import('cookie').CookieParseOptions} opts
|
|
4356
|
+
* @param {import('cookie').CookieParseOptions} [opts]
|
|
4173
4357
|
*/
|
|
4174
4358
|
getAll(opts) {
|
|
4175
4359
|
const cookies2 = cookieExports.parse(header, { decode: opts?.decode });
|
|
@@ -4323,6 +4507,9 @@ function create_fetch({ event, options: options2, manifest, state, get_cookie_he
|
|
|
4323
4507
|
}
|
|
4324
4508
|
return await fetch(request);
|
|
4325
4509
|
}
|
|
4510
|
+
if (manifest._.prerendered_routes.has(decoded) || decoded.at(-1) === "/" && manifest._.prerendered_routes.has(decoded.slice(0, -1))) {
|
|
4511
|
+
return await fetch(request);
|
|
4512
|
+
}
|
|
4326
4513
|
if (credentials !== "omit") {
|
|
4327
4514
|
const cookie = get_cookie_header(url, request.headers.get("cookie"));
|
|
4328
4515
|
if (cookie) {
|
|
@@ -4429,49 +4616,53 @@ async function respond(request, options2, manifest, state) {
|
|
|
4429
4616
|
if (options2.hash_routing && url.pathname !== base + "/" && url.pathname !== "/[fallback]") {
|
|
4430
4617
|
return text("Not found", { status: 404 });
|
|
4431
4618
|
}
|
|
4432
|
-
let
|
|
4619
|
+
let invalidated_data_nodes;
|
|
4620
|
+
const is_route_resolution_request = has_resolution_suffix(url.pathname);
|
|
4621
|
+
const is_data_request = has_data_suffix(url.pathname);
|
|
4622
|
+
if (is_route_resolution_request) {
|
|
4623
|
+
url.pathname = strip_resolution_suffix(url.pathname);
|
|
4624
|
+
} else if (is_data_request) {
|
|
4625
|
+
url.pathname = strip_data_suffix(url.pathname) + (url.searchParams.get(TRAILING_SLASH_PARAM) === "1" ? "/" : "") || "/";
|
|
4626
|
+
url.searchParams.delete(TRAILING_SLASH_PARAM);
|
|
4627
|
+
invalidated_data_nodes = url.searchParams.get(INVALIDATED_PARAM)?.split("").map((node) => node === "1");
|
|
4628
|
+
url.searchParams.delete(INVALIDATED_PARAM);
|
|
4629
|
+
}
|
|
4630
|
+
let resolved_path;
|
|
4433
4631
|
try {
|
|
4434
|
-
|
|
4632
|
+
resolved_path = await options2.hooks.reroute({ url: new URL(url) }) ?? url.pathname;
|
|
4435
4633
|
} catch {
|
|
4436
4634
|
return text("Internal Server Error", {
|
|
4437
4635
|
status: 500
|
|
4438
4636
|
});
|
|
4439
4637
|
}
|
|
4440
|
-
let decoded;
|
|
4441
4638
|
try {
|
|
4442
|
-
|
|
4639
|
+
resolved_path = decode_pathname(resolved_path);
|
|
4443
4640
|
} catch {
|
|
4444
4641
|
return text("Malformed URI", { status: 400 });
|
|
4445
4642
|
}
|
|
4446
4643
|
let route = null;
|
|
4447
4644
|
let params = {};
|
|
4448
4645
|
if (base && !state.prerendering?.fallback) {
|
|
4449
|
-
if (!
|
|
4646
|
+
if (!resolved_path.startsWith(base)) {
|
|
4450
4647
|
return text("Not found", { status: 404 });
|
|
4451
4648
|
}
|
|
4452
|
-
|
|
4649
|
+
resolved_path = resolved_path.slice(base.length) || "/";
|
|
4650
|
+
}
|
|
4651
|
+
if (is_route_resolution_request) {
|
|
4652
|
+
return resolve_route(resolved_path, new URL(request.url), manifest);
|
|
4453
4653
|
}
|
|
4454
|
-
if (
|
|
4654
|
+
if (resolved_path === `/${app_dir}/env.js`) {
|
|
4455
4655
|
return get_public_env(request);
|
|
4456
4656
|
}
|
|
4457
|
-
if (
|
|
4657
|
+
if (resolved_path.startsWith(`/${app_dir}`)) {
|
|
4458
4658
|
const headers22 = new Headers();
|
|
4459
4659
|
headers22.set("cache-control", "public, max-age=0, must-revalidate");
|
|
4460
4660
|
return text("Not found", { status: 404, headers: headers22 });
|
|
4461
4661
|
}
|
|
4462
|
-
const is_data_request = has_data_suffix(decoded);
|
|
4463
|
-
let invalidated_data_nodes;
|
|
4464
|
-
if (is_data_request) {
|
|
4465
|
-
decoded = strip_data_suffix(decoded) || "/";
|
|
4466
|
-
url.pathname = strip_data_suffix(url.pathname) + (url.searchParams.get(TRAILING_SLASH_PARAM) === "1" ? "/" : "") || "/";
|
|
4467
|
-
url.searchParams.delete(TRAILING_SLASH_PARAM);
|
|
4468
|
-
invalidated_data_nodes = url.searchParams.get(INVALIDATED_PARAM)?.split("").map((node) => node === "1");
|
|
4469
|
-
url.searchParams.delete(INVALIDATED_PARAM);
|
|
4470
|
-
}
|
|
4471
4662
|
if (!state.prerendering?.fallback) {
|
|
4472
4663
|
const matchers = await manifest._.matchers();
|
|
4473
4664
|
for (const candidate of manifest._.routes) {
|
|
4474
|
-
const match = candidate.pattern.exec(
|
|
4665
|
+
const match = candidate.pattern.exec(resolved_path);
|
|
4475
4666
|
if (!match) continue;
|
|
4476
4667
|
const matched = exec(match, candidate.params, matchers);
|
|
4477
4668
|
if (matched) {
|
|
@@ -4747,11 +4938,9 @@ async function respond(request, options2, manifest, state) {
|
|
|
4747
4938
|
return response;
|
|
4748
4939
|
}
|
|
4749
4940
|
if (state.error && event2.isSubRequest) {
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
}
|
|
4754
|
-
});
|
|
4941
|
+
const headers22 = new Headers(request.headers);
|
|
4942
|
+
headers22.set("x-sveltekit-error", "true");
|
|
4943
|
+
return await fetch(request, { headers: headers22 });
|
|
4755
4944
|
}
|
|
4756
4945
|
if (state.error) {
|
|
4757
4946
|
return text("Internal Server Error", {
|