ambient-display 1.1.19 → 1.2.2
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/assets/0.Dl9__I4E.css.gz +0 -0
- package/build/client/_app/immutable/assets/2.BtzFOBtk.css.gz +0 -0
- package/build/client/_app/immutable/assets/3.VTEzhx9-.css.gz +0 -0
- package/build/client/_app/immutable/assets/LoadingIndicator.D0m6rSKQ.css.gz +0 -0
- package/build/client/_app/immutable/assets/PlayingTracker.BPTtFzSw.css.gz +0 -0
- package/build/client/_app/immutable/assets/_layout.Dl9__I4E.css.gz +0 -0
- package/build/client/_app/immutable/assets/_page.BtzFOBtk.css.gz +0 -0
- package/build/client/_app/immutable/assets/_page.VTEzhx9-.css.gz +0 -0
- package/build/client/_app/immutable/chunks/LoadingIndicator.C1fneNq_.js +1 -0
- package/build/client/_app/immutable/chunks/LoadingIndicator.C1fneNq_.js.br +0 -0
- package/build/client/_app/immutable/chunks/LoadingIndicator.C1fneNq_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/PlayingTracker.yCKSqsZv.js +5 -0
- package/build/client/_app/immutable/chunks/PlayingTracker.yCKSqsZv.js.br +0 -0
- package/build/client/_app/immutable/chunks/PlayingTracker.yCKSqsZv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/disclose-version.N57b1q78.js +1 -0
- 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.B2wj1Tgy.js +3 -0
- package/build/client/_app/immutable/chunks/entry.B2wj1Tgy.js.br +0 -0
- package/build/client/_app/immutable/chunks/entry.B2wj1Tgy.js.gz +0 -0
- package/build/client/_app/immutable/chunks/index-client.DV07uIiZ.js +1 -0
- 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.DFULH2AN.js +1 -0
- 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/index.dKTgPKtW.js +4 -0
- package/build/client/_app/immutable/chunks/index.dKTgPKtW.js.br +0 -0
- package/build/client/_app/immutable/chunks/index.dKTgPKtW.js.gz +0 -0
- package/build/client/_app/immutable/chunks/legacy.DZgMwYuQ.js +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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.CUN30c9h.js +2 -0
- package/build/client/_app/immutable/entry/app.CUN30c9h.js.br +0 -0
- package/build/client/_app/immutable/entry/app.CUN30c9h.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.C6HhKPxU.js +1 -0
- package/build/client/_app/immutable/entry/start.C6HhKPxU.js.br +2 -0
- package/build/client/_app/immutable/entry/start.C6HhKPxU.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.CpFR5G02.js +2 -0
- package/build/client/_app/immutable/nodes/0.CpFR5G02.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.CpFR5G02.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.B3XhlwDo.js +1 -0
- package/build/client/_app/immutable/nodes/1.B3XhlwDo.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.B3XhlwDo.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.MU8ojSgR.js +1 -0
- package/build/client/_app/immutable/nodes/2.MU8ojSgR.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.MU8ojSgR.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.C-yT6jXP.js +1 -0
- package/build/client/_app/immutable/nodes/3.C-yT6jXP.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.C-yT6jXP.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/client/manifest.json.gz +0 -0
- package/build/server/chunks/{0-DghaxOyi.js → 0-nirVogjh.js} +3 -3
- package/build/server/chunks/0-nirVogjh.js.map +1 -0
- package/build/server/chunks/1-DcCpi3nW.js +9 -0
- package/build/server/chunks/1-DcCpi3nW.js.map +1 -0
- package/build/server/chunks/2-CwMl96vS.js +9 -0
- package/build/server/chunks/2-CwMl96vS.js.map +1 -0
- package/build/server/chunks/3-DPYW2cKz.js +9 -0
- package/build/server/chunks/3-DPYW2cKz.js.map +1 -0
- package/build/server/chunks/LoadingIndicator-CDp6tTFY.js +10 -0
- package/build/server/chunks/LoadingIndicator-CDp6tTFY.js.map +1 -0
- package/build/server/chunks/{LoadingIndicator.svelte_svelte_type_style_lang-DpRiqnJg.js → LoadingIndicator.svelte_svelte_type_style_lang-F_3XEmUz.js} +2 -2
- package/build/server/chunks/{LoadingIndicator.svelte_svelte_type_style_lang-DpRiqnJg.js.map → LoadingIndicator.svelte_svelte_type_style_lang-F_3XEmUz.js.map} +1 -1
- package/build/server/chunks/{PlayingTracker-DuFebO2_.js → PlayingTracker-Dm2xxH7o.js} +3 -3
- package/build/server/chunks/{PlayingTracker-DuFebO2_.js.map → PlayingTracker-Dm2xxH7o.js.map} +1 -1
- package/build/server/chunks/{_layout.svelte-CADTy4fg.js → _layout.svelte-BkMsHLGZ.js} +4 -5
- package/build/server/chunks/_layout.svelte-BkMsHLGZ.js.map +1 -0
- package/build/server/chunks/_page.svelte-BlQ5BDxG.js +115 -0
- package/build/server/chunks/_page.svelte-BlQ5BDxG.js.map +1 -0
- package/build/server/chunks/{_page.svelte-CYugZxLe.js → _page.svelte-CdVsmVc4.js} +16 -15
- package/build/server/chunks/_page.svelte-CdVsmVc4.js.map +1 -0
- package/build/server/chunks/error.svelte-BZE1ioPX.js +116 -0
- package/build/server/chunks/error.svelte-BZE1ioPX.js.map +1 -0
- package/build/server/chunks/{exports-D0QHgeSL.js → exports-DAjI6ZSp.js} +17 -2
- package/build/server/chunks/exports-DAjI6ZSp.js.map +1 -0
- package/build/server/chunks/{index2-DObisaVF.js → index2-BA59f76P.js} +297 -337
- package/build/server/chunks/index2-BA59f76P.js.map +1 -0
- package/build/server/index.js +156 -345
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +5 -6
- package/build/server/manifest.js.map +1 -1
- package/package.json +1 -1
- package/server/index.js +3 -9
- package/server/spotify/index.js +0 -4
- package/server/spotify_auth.json +1 -7
- package/server/utils.js +5 -0
- package/build/client/_app/immutable/chunks/BQ2eCqC3.js +0 -5
- package/build/client/_app/immutable/chunks/BQ2eCqC3.js.br +0 -0
- package/build/client/_app/immutable/chunks/BQ2eCqC3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C7I4vMbc.js +0 -1
- package/build/client/_app/immutable/chunks/C7I4vMbc.js.br +0 -2
- package/build/client/_app/immutable/chunks/C7I4vMbc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CDVeMiAl.js +0 -1
- 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 +0 -1
- 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/D5aAvvqP.js +0 -2
- package/build/client/_app/immutable/chunks/D5aAvvqP.js.br +0 -0
- package/build/client/_app/immutable/chunks/D5aAvvqP.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D8ITvQqD.js +0 -3
- package/build/client/_app/immutable/chunks/D8ITvQqD.js.br +0 -0
- package/build/client/_app/immutable/chunks/D8ITvQqD.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DiaFwogD.js +0 -4
- package/build/client/_app/immutable/chunks/DiaFwogD.js.br +0 -0
- package/build/client/_app/immutable/chunks/DiaFwogD.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DnG2xkSB.js +0 -1
- package/build/client/_app/immutable/chunks/DnG2xkSB.js.br +0 -2
- package/build/client/_app/immutable/chunks/DnG2xkSB.js.gz +0 -0
- package/build/client/_app/immutable/chunks/EvVuwjft.js +0 -1
- 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 +0 -1
- 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 +0 -1
- 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.Bf5niEvD.js +0 -2
- package/build/client/_app/immutable/entry/app.Bf5niEvD.js.br +0 -0
- package/build/client/_app/immutable/entry/app.Bf5niEvD.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.DYX_a1uj.js +0 -1
- package/build/client/_app/immutable/entry/start.DYX_a1uj.js.br +0 -2
- package/build/client/_app/immutable/entry/start.DYX_a1uj.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.BWH--JS_.js +0 -2
- package/build/client/_app/immutable/nodes/0.BWH--JS_.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.BWH--JS_.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.D_c4RSZq.js +0 -1
- package/build/client/_app/immutable/nodes/1.D_c4RSZq.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.D_c4RSZq.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.DxFkPkVM.js +0 -1
- package/build/client/_app/immutable/nodes/2.DxFkPkVM.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.DxFkPkVM.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.DHrglKgJ.js +0 -1
- package/build/client/_app/immutable/nodes/3.DHrglKgJ.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.DHrglKgJ.js.gz +0 -0
- package/build/server/chunks/0-DghaxOyi.js.map +0 -1
- package/build/server/chunks/1-BJvQLIan.js +0 -9
- package/build/server/chunks/1-BJvQLIan.js.map +0 -1
- package/build/server/chunks/2-cxDj5MEl.js +0 -9
- package/build/server/chunks/2-cxDj5MEl.js.map +0 -1
- package/build/server/chunks/3-Bd5ZeRiN.js +0 -9
- package/build/server/chunks/3-Bd5ZeRiN.js.map +0 -1
- package/build/server/chunks/LoadingIndicator-BgSuwc17.js +0 -10
- package/build/server/chunks/LoadingIndicator-BgSuwc17.js.map +0 -1
- package/build/server/chunks/_layout.svelte-CADTy4fg.js.map +0 -1
- package/build/server/chunks/_page.svelte-B1q4zDaO.js +0 -114
- package/build/server/chunks/_page.svelte-B1q4zDaO.js.map +0 -1
- package/build/server/chunks/_page.svelte-CYugZxLe.js.map +0 -1
- package/build/server/chunks/error.svelte-DGl1DMvJ.js +0 -55
- package/build/server/chunks/error.svelte-DGl1DMvJ.js.map +0 -1
- package/build/server/chunks/exports-D0QHgeSL.js.map +0 -1
- package/build/server/chunks/index2-DObisaVF.js.map +0 -1
package/build/server/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { r as render,
|
|
2
|
-
import { d as decode_pathname, a as decode_params, n as normalize_path, b as disable_search,
|
|
1
|
+
import { r as render, g as get, L as LEGACY_PROPS, f as flush_sync, d as define_property, a as active_reaction, i as is_runes, D as DERIVED, B as BLOCK_EFFECT, b as derived_sources, s as state_unsafe_mutation, c as increment_version, e as DIRTY, h as set_signal_status, C as CLEAN, U as UNOWNED, j as schedule_effect, k as init_operations, l as get_first_child, H as HYDRATION_START, m as get_next_sibling, n as HYDRATION_ERROR, o as HYDRATION_END, p as hydration_failed, q as clear_text_content, t as array_from, u as component_root, v as push, w as setContext, x as pop, y as active_effect, z as BRANCH_EFFECT, A as new_deps, E as untracked_writes, F as set_untracked_writes, M as MAYBE_DIRTY, G as safe_equals, I as set_active_reaction, J as set_active_effect, K as is_array, N as is_passive_event, O as create_text, P as branch, Q as push$1, R as pop$1, S as equals, T as component_context, V as BROWSER, W as readable, X as writable } from './chunks/index2-BA59f76P.js';
|
|
2
|
+
import { d as decode_pathname, h as has_data_suffix, s as strip_data_suffix, a as decode_params, n as normalize_path, b as disable_search, c as add_data_suffix, m as make_trackable, r as resolve } from './chunks/exports-DAjI6ZSp.js';
|
|
3
3
|
|
|
4
4
|
let base = "";
|
|
5
5
|
let assets = base;
|
|
6
|
-
const app_dir = "_app";
|
|
7
6
|
const initial = { base, assets };
|
|
8
7
|
function override(paths) {
|
|
9
8
|
base = paths.base;
|
|
@@ -21,11 +20,6 @@ function set_public_env(environment) {
|
|
|
21
20
|
function set_safe_public_env(environment) {
|
|
22
21
|
safe_public_env = environment;
|
|
23
22
|
}
|
|
24
|
-
function hydration_mismatch(location) {
|
|
25
|
-
{
|
|
26
|
-
console.warn(`https://svelte.dev/e/hydration_mismatch`);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
23
|
function source(v, stack) {
|
|
30
24
|
var signal = {
|
|
31
25
|
f: 0,
|
|
@@ -33,8 +27,7 @@ function source(v, stack) {
|
|
|
33
27
|
v,
|
|
34
28
|
reactions: null,
|
|
35
29
|
equals,
|
|
36
|
-
|
|
37
|
-
wv: 0
|
|
30
|
+
version: 0
|
|
38
31
|
};
|
|
39
32
|
return signal;
|
|
40
33
|
}
|
|
@@ -47,7 +40,7 @@ function mutable_source(initial_value, immutable = false) {
|
|
|
47
40
|
return s;
|
|
48
41
|
}
|
|
49
42
|
function set(source2, value) {
|
|
50
|
-
if (active_reaction !== null &&
|
|
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
|
|
51
44
|
// we allow the mutation.
|
|
52
45
|
(derived_sources === null || !derived_sources.includes(source2))) {
|
|
53
46
|
state_unsafe_mutation();
|
|
@@ -56,15 +49,19 @@ function set(source2, value) {
|
|
|
56
49
|
}
|
|
57
50
|
function internal_set(source2, value) {
|
|
58
51
|
if (!source2.equals(value)) {
|
|
59
|
-
source2.v;
|
|
60
52
|
source2.v = value;
|
|
61
|
-
source2.
|
|
53
|
+
source2.version = increment_version();
|
|
62
54
|
mark_reactions(source2, DIRTY);
|
|
63
|
-
if (active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f &
|
|
64
|
-
if (
|
|
65
|
-
|
|
55
|
+
if (active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & BRANCH_EFFECT) === 0) {
|
|
56
|
+
if (new_deps !== null && new_deps.includes(source2)) {
|
|
57
|
+
set_signal_status(active_effect, DIRTY);
|
|
58
|
+
schedule_effect(active_effect);
|
|
66
59
|
} else {
|
|
67
|
-
untracked_writes
|
|
60
|
+
if (untracked_writes === null) {
|
|
61
|
+
set_untracked_writes([source2]);
|
|
62
|
+
} else {
|
|
63
|
+
untracked_writes.push(source2);
|
|
64
|
+
}
|
|
68
65
|
}
|
|
69
66
|
}
|
|
70
67
|
}
|
|
@@ -95,6 +92,11 @@ function mark_reactions(signal, status) {
|
|
|
95
92
|
}
|
|
96
93
|
}
|
|
97
94
|
}
|
|
95
|
+
function hydration_mismatch(location) {
|
|
96
|
+
{
|
|
97
|
+
console.warn(`https://svelte.dev/e/hydration_mismatch`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
98
100
|
let hydrating = false;
|
|
99
101
|
function set_hydrating(value) {
|
|
100
102
|
hydrating = value;
|
|
@@ -165,10 +167,8 @@ function handle_event_propagation(event) {
|
|
|
165
167
|
current_target.host || null;
|
|
166
168
|
try {
|
|
167
169
|
var delegated = current_target["__" + event_name];
|
|
168
|
-
if (delegated !== void 0 &&
|
|
169
|
-
current_target.disabled
|
|
170
|
-
// -> the target could not have been disabled because it emits the event in the first place
|
|
171
|
-
event.target === current_target)) {
|
|
170
|
+
if (delegated !== void 0 && !/** @type {any} */
|
|
171
|
+
current_target.disabled) {
|
|
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
|
+
flush_sync();
|
|
410
410
|
}
|
|
411
411
|
this.#events = props.$$events;
|
|
412
412
|
for (const key of Object.keys(this.#instance)) {
|
|
@@ -520,6 +520,7 @@ function Root($$payload, $$props) {
|
|
|
520
520
|
}
|
|
521
521
|
const root = asClassComponent(Root);
|
|
522
522
|
const options = {
|
|
523
|
+
app_dir: "_app",
|
|
523
524
|
app_template_contains_nonce: false,
|
|
524
525
|
csp: { "mode": "auto", "directives": { "upgrade-insecure-requests": false, "block-all-mixed-content": false }, "reportOnly": { "upgrade-insecure-requests": false, "block-all-mixed-content": false } },
|
|
525
526
|
csrf_check_origin: true,
|
|
@@ -605,7 +606,7 @@ const options = {
|
|
|
605
606
|
<div class="error">
|
|
606
607
|
<span class="status">` + status + '</span>\n <div class="message">\n <h1>' + message + "</h1>\n </div>\n </div>\n </body>\n</html>\n"
|
|
607
608
|
},
|
|
608
|
-
version_hash: "
|
|
609
|
+
version_hash: "ya14ym"
|
|
609
610
|
};
|
|
610
611
|
async function get_hooks() {
|
|
611
612
|
let handle;
|
|
@@ -1385,66 +1386,14 @@ function requireCookie () {
|
|
|
1385
1386
|
var __toString = Object.prototype.toString;
|
|
1386
1387
|
|
|
1387
1388
|
/**
|
|
1388
|
-
* RegExp to match
|
|
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
|
|
1389
|
+
* RegExp to match field-content in RFC 7230 sec 3.2
|
|
1415
1390
|
*
|
|
1416
|
-
*
|
|
1417
|
-
*
|
|
1418
|
-
*
|
|
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.)
|
|
1391
|
+
* field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
|
|
1392
|
+
* field-vchar = VCHAR / obs-text
|
|
1393
|
+
* obs-text = %x80-FF
|
|
1435
1394
|
*/
|
|
1436
1395
|
|
|
1437
|
-
var
|
|
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]*$/;
|
|
1396
|
+
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
1448
1397
|
|
|
1449
1398
|
/**
|
|
1450
1399
|
* Parse a cookie header.
|
|
@@ -1453,128 +1402,107 @@ function requireCookie () {
|
|
|
1453
1402
|
* The object has the various cookies as keys(names) => values
|
|
1454
1403
|
*
|
|
1455
1404
|
* @param {string} str
|
|
1456
|
-
* @param {object} [
|
|
1405
|
+
* @param {object} [options]
|
|
1457
1406
|
* @return {object}
|
|
1458
1407
|
* @public
|
|
1459
1408
|
*/
|
|
1460
1409
|
|
|
1461
|
-
function parse(str,
|
|
1410
|
+
function parse(str, options) {
|
|
1462
1411
|
if (typeof str !== 'string') {
|
|
1463
1412
|
throw new TypeError('argument str must be a string');
|
|
1464
1413
|
}
|
|
1465
1414
|
|
|
1466
1415
|
var obj = {};
|
|
1467
|
-
var
|
|
1468
|
-
|
|
1469
|
-
if (len < 2) return obj;
|
|
1416
|
+
var opt = options || {};
|
|
1417
|
+
var dec = opt.decode || decode;
|
|
1470
1418
|
|
|
1471
|
-
var dec = (opt && opt.decode) || decode;
|
|
1472
1419
|
var index = 0;
|
|
1473
|
-
|
|
1474
|
-
|
|
1420
|
+
while (index < str.length) {
|
|
1421
|
+
var eqIdx = str.indexOf('=', index);
|
|
1475
1422
|
|
|
1476
|
-
|
|
1477
|
-
eqIdx
|
|
1478
|
-
|
|
1423
|
+
// no more cookie pairs
|
|
1424
|
+
if (eqIdx === -1) {
|
|
1425
|
+
break
|
|
1426
|
+
}
|
|
1479
1427
|
|
|
1480
|
-
endIdx = str.indexOf(';', index);
|
|
1428
|
+
var endIdx = str.indexOf(';', index);
|
|
1481
1429
|
|
|
1482
1430
|
if (endIdx === -1) {
|
|
1483
|
-
endIdx =
|
|
1484
|
-
} else if (
|
|
1431
|
+
endIdx = str.length;
|
|
1432
|
+
} else if (endIdx < eqIdx) {
|
|
1485
1433
|
// backtrack on prior semicolon
|
|
1486
1434
|
index = str.lastIndexOf(';', eqIdx - 1) + 1;
|
|
1487
|
-
continue
|
|
1435
|
+
continue
|
|
1488
1436
|
}
|
|
1489
1437
|
|
|
1490
|
-
var
|
|
1491
|
-
var keyEndIdx = endIndex(str, eqIdx, keyStartIdx);
|
|
1492
|
-
var key = str.slice(keyStartIdx, keyEndIdx);
|
|
1438
|
+
var key = str.slice(index, eqIdx).trim();
|
|
1493
1439
|
|
|
1494
1440
|
// only assign once
|
|
1495
|
-
if (
|
|
1496
|
-
var
|
|
1497
|
-
var valEndIdx = endIndex(str, endIdx, valStartIdx);
|
|
1441
|
+
if (undefined === obj[key]) {
|
|
1442
|
+
var val = str.slice(eqIdx + 1, endIdx).trim();
|
|
1498
1443
|
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1444
|
+
// quoted values
|
|
1445
|
+
if (val.charCodeAt(0) === 0x22) {
|
|
1446
|
+
val = val.slice(1, -1);
|
|
1502
1447
|
}
|
|
1503
1448
|
|
|
1504
|
-
var val = str.slice(valStartIdx, valEndIdx);
|
|
1505
1449
|
obj[key] = tryDecode(val, dec);
|
|
1506
1450
|
}
|
|
1507
1451
|
|
|
1508
1452
|
index = endIdx + 1;
|
|
1509
|
-
}
|
|
1453
|
+
}
|
|
1510
1454
|
|
|
1511
1455
|
return obj;
|
|
1512
1456
|
}
|
|
1513
1457
|
|
|
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
|
-
|
|
1530
1458
|
/**
|
|
1531
1459
|
* Serialize data into a cookie header.
|
|
1532
1460
|
*
|
|
1533
|
-
* Serialize a name value pair into a cookie string suitable for
|
|
1534
|
-
* http headers. An optional options object
|
|
1461
|
+
* Serialize the a name value pair into a cookie string suitable for
|
|
1462
|
+
* http headers. An optional options object specified cookie parameters.
|
|
1535
1463
|
*
|
|
1536
1464
|
* serialize('foo', 'bar', { httpOnly: true })
|
|
1537
1465
|
* => "foo=bar; httpOnly"
|
|
1538
1466
|
*
|
|
1539
1467
|
* @param {string} name
|
|
1540
1468
|
* @param {string} val
|
|
1541
|
-
* @param {object} [
|
|
1469
|
+
* @param {object} [options]
|
|
1542
1470
|
* @return {string}
|
|
1543
1471
|
* @public
|
|
1544
1472
|
*/
|
|
1545
1473
|
|
|
1546
|
-
function serialize(name, val,
|
|
1547
|
-
var
|
|
1474
|
+
function serialize(name, val, options) {
|
|
1475
|
+
var opt = options || {};
|
|
1476
|
+
var enc = opt.encode || encode;
|
|
1548
1477
|
|
|
1549
1478
|
if (typeof enc !== 'function') {
|
|
1550
1479
|
throw new TypeError('option encode is invalid');
|
|
1551
1480
|
}
|
|
1552
1481
|
|
|
1553
|
-
if (!
|
|
1482
|
+
if (!fieldContentRegExp.test(name)) {
|
|
1554
1483
|
throw new TypeError('argument name is invalid');
|
|
1555
1484
|
}
|
|
1556
1485
|
|
|
1557
1486
|
var value = enc(val);
|
|
1558
1487
|
|
|
1559
|
-
if (!
|
|
1488
|
+
if (value && !fieldContentRegExp.test(value)) {
|
|
1560
1489
|
throw new TypeError('argument val is invalid');
|
|
1561
1490
|
}
|
|
1562
1491
|
|
|
1563
1492
|
var str = name + '=' + value;
|
|
1564
|
-
if (!opt) return str;
|
|
1565
1493
|
|
|
1566
1494
|
if (null != opt.maxAge) {
|
|
1567
|
-
var maxAge =
|
|
1495
|
+
var maxAge = opt.maxAge - 0;
|
|
1568
1496
|
|
|
1569
|
-
if (!isFinite(maxAge)) {
|
|
1497
|
+
if (isNaN(maxAge) || !isFinite(maxAge)) {
|
|
1570
1498
|
throw new TypeError('option maxAge is invalid')
|
|
1571
1499
|
}
|
|
1572
1500
|
|
|
1573
|
-
str += '; Max-Age=' + maxAge;
|
|
1501
|
+
str += '; Max-Age=' + Math.floor(maxAge);
|
|
1574
1502
|
}
|
|
1575
1503
|
|
|
1576
1504
|
if (opt.domain) {
|
|
1577
|
-
if (!
|
|
1505
|
+
if (!fieldContentRegExp.test(opt.domain)) {
|
|
1578
1506
|
throw new TypeError('option domain is invalid');
|
|
1579
1507
|
}
|
|
1580
1508
|
|
|
@@ -1582,7 +1510,7 @@ function requireCookie () {
|
|
|
1582
1510
|
}
|
|
1583
1511
|
|
|
1584
1512
|
if (opt.path) {
|
|
1585
|
-
if (!
|
|
1513
|
+
if (!fieldContentRegExp.test(opt.path)) {
|
|
1586
1514
|
throw new TypeError('option path is invalid');
|
|
1587
1515
|
}
|
|
1588
1516
|
|
|
@@ -1613,7 +1541,8 @@ function requireCookie () {
|
|
|
1613
1541
|
|
|
1614
1542
|
if (opt.priority) {
|
|
1615
1543
|
var priority = typeof opt.priority === 'string'
|
|
1616
|
-
? opt.priority.toLowerCase()
|
|
1544
|
+
? opt.priority.toLowerCase()
|
|
1545
|
+
: opt.priority;
|
|
1617
1546
|
|
|
1618
1547
|
switch (priority) {
|
|
1619
1548
|
case 'low':
|
|
@@ -1668,6 +1597,17 @@ function requireCookie () {
|
|
|
1668
1597
|
: str
|
|
1669
1598
|
}
|
|
1670
1599
|
|
|
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
|
+
|
|
1671
1611
|
/**
|
|
1672
1612
|
* Determine if value is a Date.
|
|
1673
1613
|
*
|
|
@@ -1676,7 +1616,8 @@ function requireCookie () {
|
|
|
1676
1616
|
*/
|
|
1677
1617
|
|
|
1678
1618
|
function isDate (val) {
|
|
1679
|
-
return __toString.call(val) === '[object Date]'
|
|
1619
|
+
return __toString.call(val) === '[object Date]' ||
|
|
1620
|
+
val instanceof Date
|
|
1680
1621
|
}
|
|
1681
1622
|
|
|
1682
1623
|
/**
|
|
@@ -2035,31 +1976,6 @@ class ActionFailure {
|
|
|
2035
1976
|
this.data = data;
|
|
2036
1977
|
}
|
|
2037
1978
|
}
|
|
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
|
-
}
|
|
2063
1979
|
function json(data, init2) {
|
|
2064
1980
|
const body2 = JSON.stringify(data);
|
|
2065
1981
|
const headers2 = new Headers(init2?.headers);
|
|
@@ -2515,18 +2431,6 @@ function b64_encode(buffer) {
|
|
|
2515
2431
|
)
|
|
2516
2432
|
);
|
|
2517
2433
|
}
|
|
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
|
-
}
|
|
2530
2434
|
async function load_server_data({ event, state, node, parent }) {
|
|
2531
2435
|
if (!node?.server) return null;
|
|
2532
2436
|
let is_tracking = true;
|
|
@@ -2653,7 +2557,7 @@ function create_universal_fetch(event, state, fetched, csr, resolve_opts) {
|
|
|
2653
2557
|
dependency = { response, body: null };
|
|
2654
2558
|
state.prerendering.dependencies.set(url.pathname, dependency);
|
|
2655
2559
|
}
|
|
2656
|
-
} else
|
|
2560
|
+
} else {
|
|
2657
2561
|
const mode = input instanceof Request ? input.mode : init2?.mode ?? "cors";
|
|
2658
2562
|
if (mode === "no-cors") {
|
|
2659
2563
|
response = new Response("", {
|
|
@@ -3052,6 +2956,9 @@ class BaseProvider {
|
|
|
3052
2956
|
if (this.#style_src_needs_csp) {
|
|
3053
2957
|
this.#style_src.push(source);
|
|
3054
2958
|
}
|
|
2959
|
+
if (this.#style_src_needs_csp) {
|
|
2960
|
+
this.#style_src.push(source);
|
|
2961
|
+
}
|
|
3055
2962
|
if (this.#style_src_attr_needs_csp) {
|
|
3056
2963
|
this.#style_src_attr.push(source);
|
|
3057
2964
|
}
|
|
@@ -3222,119 +3129,6 @@ function create_async_iterator() {
|
|
|
3222
3129
|
}
|
|
3223
3130
|
};
|
|
3224
3131
|
}
|
|
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
|
-
}
|
|
3338
3132
|
const updated = {
|
|
3339
3133
|
...readable(false),
|
|
3340
3134
|
check: () => false
|
|
@@ -3452,13 +3246,17 @@ async function render_response({
|
|
|
3452
3246
|
}
|
|
3453
3247
|
return `${assets$1}/${path}`;
|
|
3454
3248
|
};
|
|
3455
|
-
|
|
3456
|
-
|
|
3249
|
+
if (client.inline?.style) {
|
|
3250
|
+
head += `
|
|
3251
|
+
<style>${client.inline.style}</style>`;
|
|
3252
|
+
}
|
|
3253
|
+
if (inline_styles.size > 0) {
|
|
3254
|
+
const content = Array.from(inline_styles.values()).join("\n");
|
|
3457
3255
|
const attributes = [];
|
|
3458
3256
|
if (csp.style_needs_nonce) attributes.push(` nonce="${csp.nonce}"`);
|
|
3459
|
-
csp.add_style(
|
|
3257
|
+
csp.add_style(content);
|
|
3460
3258
|
head += `
|
|
3461
|
-
<style${attributes.join("")}>${
|
|
3259
|
+
<style${attributes.join("")}>${content}</style>`;
|
|
3462
3260
|
}
|
|
3463
3261
|
for (const dep of stylesheets) {
|
|
3464
3262
|
const path = prefixed(dep);
|
|
@@ -3504,9 +3302,8 @@ async function render_response({
|
|
|
3504
3302
|
).join("\n ")}`;
|
|
3505
3303
|
}
|
|
3506
3304
|
if (page_config.csr) {
|
|
3507
|
-
const route = manifest._.client.routes?.find((r) => r.id === event.route.id) ?? null;
|
|
3508
3305
|
if (client.uses_env_dynamic_public && state.prerendering) {
|
|
3509
|
-
modulepreloads.add(`${app_dir}/env.js`);
|
|
3306
|
+
modulepreloads.add(`${options2.app_dir}/env.js`);
|
|
3510
3307
|
}
|
|
3511
3308
|
if (!client.inline) {
|
|
3512
3309
|
const included_modulepreloads = Array.from(modulepreloads, (dep) => prefixed(dep)).filter(
|
|
@@ -3523,13 +3320,6 @@ async function render_response({
|
|
|
3523
3320
|
}
|
|
3524
3321
|
}
|
|
3525
3322
|
}
|
|
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
|
-
}
|
|
3533
3323
|
const blocks = [];
|
|
3534
3324
|
const load_env_eagerly = client.uses_env_dynamic_public && state.prerendering;
|
|
3535
3325
|
const properties = [`base: ${base_expression}`];
|
|
@@ -3585,15 +3375,7 @@ async function render_response({
|
|
|
3585
3375
|
if (status !== 200) {
|
|
3586
3376
|
hydrate.push(`status: ${status}`);
|
|
3587
3377
|
}
|
|
3588
|
-
if (
|
|
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) {
|
|
3378
|
+
if (options2.embedded) {
|
|
3597
3379
|
hydrate.push(`params: ${uneval(event.params)}`, `route: ${s(event.route)}`);
|
|
3598
3380
|
}
|
|
3599
3381
|
const indent = " ".repeat(load_env_eagerly ? 7 : 6);
|
|
@@ -3613,7 +3395,7 @@ ${indent}}`);
|
|
|
3613
3395
|
app.start(${args.join(", ")})
|
|
3614
3396
|
});`;
|
|
3615
3397
|
if (load_env_eagerly) {
|
|
3616
|
-
blocks.push(`import(${s(`${base$1}/${app_dir}/env.js`)}).then(({ env }) => {
|
|
3398
|
+
blocks.push(`import(${s(`${base$1}/${options2.app_dir}/env.js`)}).then(({ env }) => {
|
|
3617
3399
|
${global}.env = env;
|
|
3618
3400
|
|
|
3619
3401
|
${boot.replace(/\n/g, "\n ")}
|
|
@@ -4117,10 +3899,7 @@ async function render_page(event, page, options2, manifest, state, resolve_opts)
|
|
|
4117
3899
|
status = action_result.status;
|
|
4118
3900
|
}
|
|
4119
3901
|
}
|
|
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
|
-
);
|
|
3902
|
+
const should_prerender_data = nodes.some((node) => node?.server?.load);
|
|
4124
3903
|
const data_pathname = add_data_suffix(event.url.pathname);
|
|
4125
3904
|
const should_prerender = get_option(nodes, "prerender") ?? false;
|
|
4126
3905
|
if (should_prerender) {
|
|
@@ -4318,6 +4097,43 @@ async function render_page(event, page, options2, manifest, state, resolve_opts)
|
|
|
4318
4097
|
});
|
|
4319
4098
|
}
|
|
4320
4099
|
}
|
|
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
|
+
}
|
|
4321
4137
|
const INVALID_COOKIE_CHARACTER_REGEX = /[\x00-\x1F\x7F()<>@,;:"/[\]?={} \t]/;
|
|
4322
4138
|
function validate_options(options2) {
|
|
4323
4139
|
if (options2?.path === void 0) {
|
|
@@ -4341,7 +4157,7 @@ function get_cookies(request, url, trailing_slash) {
|
|
|
4341
4157
|
// sufficient to do so.
|
|
4342
4158
|
/**
|
|
4343
4159
|
* @param {string} name
|
|
4344
|
-
* @param {import('cookie').CookieParseOptions}
|
|
4160
|
+
* @param {import('cookie').CookieParseOptions} opts
|
|
4345
4161
|
*/
|
|
4346
4162
|
get(name, opts) {
|
|
4347
4163
|
const c = new_cookies[name];
|
|
@@ -4353,7 +4169,7 @@ function get_cookies(request, url, trailing_slash) {
|
|
|
4353
4169
|
return cookie;
|
|
4354
4170
|
},
|
|
4355
4171
|
/**
|
|
4356
|
-
* @param {import('cookie').CookieParseOptions}
|
|
4172
|
+
* @param {import('cookie').CookieParseOptions} opts
|
|
4357
4173
|
*/
|
|
4358
4174
|
getAll(opts) {
|
|
4359
4175
|
const cookies2 = cookieExports.parse(header, { decode: opts?.decode });
|
|
@@ -4507,9 +4323,6 @@ function create_fetch({ event, options: options2, manifest, state, get_cookie_he
|
|
|
4507
4323
|
}
|
|
4508
4324
|
return await fetch(request);
|
|
4509
4325
|
}
|
|
4510
|
-
if (manifest._.prerendered_routes.has(decoded) || decoded.at(-1) === "/" && manifest._.prerendered_routes.has(decoded.slice(0, -1))) {
|
|
4511
|
-
return await fetch(request);
|
|
4512
|
-
}
|
|
4513
4326
|
if (credentials !== "omit") {
|
|
4514
4327
|
const cookie = get_cookie_header(url, request.headers.get("cookie"));
|
|
4515
4328
|
if (cookie) {
|
|
@@ -4616,53 +4429,49 @@ async function respond(request, options2, manifest, state) {
|
|
|
4616
4429
|
if (options2.hash_routing && url.pathname !== base + "/" && url.pathname !== "/[fallback]") {
|
|
4617
4430
|
return text("Not found", { status: 404 });
|
|
4618
4431
|
}
|
|
4619
|
-
let
|
|
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;
|
|
4432
|
+
let rerouted_path;
|
|
4631
4433
|
try {
|
|
4632
|
-
|
|
4434
|
+
rerouted_path = options2.hooks.reroute({ url: new URL(url) }) ?? url.pathname;
|
|
4633
4435
|
} catch {
|
|
4634
4436
|
return text("Internal Server Error", {
|
|
4635
4437
|
status: 500
|
|
4636
4438
|
});
|
|
4637
4439
|
}
|
|
4440
|
+
let decoded;
|
|
4638
4441
|
try {
|
|
4639
|
-
|
|
4442
|
+
decoded = decode_pathname(rerouted_path);
|
|
4640
4443
|
} catch {
|
|
4641
4444
|
return text("Malformed URI", { status: 400 });
|
|
4642
4445
|
}
|
|
4643
4446
|
let route = null;
|
|
4644
4447
|
let params = {};
|
|
4645
4448
|
if (base && !state.prerendering?.fallback) {
|
|
4646
|
-
if (!
|
|
4449
|
+
if (!decoded.startsWith(base)) {
|
|
4647
4450
|
return text("Not found", { status: 404 });
|
|
4648
4451
|
}
|
|
4649
|
-
|
|
4650
|
-
}
|
|
4651
|
-
if (is_route_resolution_request) {
|
|
4652
|
-
return resolve_route(resolved_path, new URL(request.url), manifest);
|
|
4452
|
+
decoded = decoded.slice(base.length) || "/";
|
|
4653
4453
|
}
|
|
4654
|
-
if (
|
|
4454
|
+
if (decoded === `/${options2.app_dir}/env.js`) {
|
|
4655
4455
|
return get_public_env(request);
|
|
4656
4456
|
}
|
|
4657
|
-
if (
|
|
4457
|
+
if (decoded.startsWith(`/${options2.app_dir}`)) {
|
|
4658
4458
|
const headers22 = new Headers();
|
|
4659
4459
|
headers22.set("cache-control", "public, max-age=0, must-revalidate");
|
|
4660
4460
|
return text("Not found", { status: 404, headers: headers22 });
|
|
4661
4461
|
}
|
|
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
|
+
}
|
|
4662
4471
|
if (!state.prerendering?.fallback) {
|
|
4663
4472
|
const matchers = await manifest._.matchers();
|
|
4664
4473
|
for (const candidate of manifest._.routes) {
|
|
4665
|
-
const match = candidate.pattern.exec(
|
|
4474
|
+
const match = candidate.pattern.exec(decoded);
|
|
4666
4475
|
if (!match) continue;
|
|
4667
4476
|
const matched = exec(match, candidate.params, matchers);
|
|
4668
4477
|
if (matched) {
|
|
@@ -4938,9 +4747,11 @@ async function respond(request, options2, manifest, state) {
|
|
|
4938
4747
|
return response;
|
|
4939
4748
|
}
|
|
4940
4749
|
if (state.error && event2.isSubRequest) {
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4750
|
+
return await fetch(request, {
|
|
4751
|
+
headers: {
|
|
4752
|
+
"x-sveltekit-error": "true"
|
|
4753
|
+
}
|
|
4754
|
+
});
|
|
4944
4755
|
}
|
|
4945
4756
|
if (state.error) {
|
|
4946
4757
|
return text("Internal Server Error", {
|