@noego/forge 0.0.9 → 0.0.10
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/README.md +441 -383
- package/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.ts +16 -2
- package/dist/client.mjs +240 -232
- package/dist/client.mjs.map +1 -1
- package/dist/page.svelte-Bq1Q01H0.js.map +1 -1
- package/dist/page.svelte-Dvj7306U.cjs.map +1 -1
- package/dist-ssr/{path-9twSsimy.js → path-BqcF5dbs.js} +3 -2
- package/dist-ssr/{path-9twSsimy.js.map → path-BqcF5dbs.js.map} +1 -1
- package/dist-ssr/{path-Dm_4PXDW.cjs → path-sxXxpB6R.cjs} +3 -2
- package/dist-ssr/{path-Dm_4PXDW.cjs.map → path-sxXxpB6R.cjs.map} +1 -1
- package/dist-ssr/server.cjs +3 -3
- package/dist-ssr/server.cjs.map +1 -1
- package/dist-ssr/server.js +3 -3
- package/dist-ssr/server.js.map +1 -1
- package/dist-ssr/shared.cjs +1 -1
- package/dist-ssr/shared.js +1 -1
- package/package.json +1 -1
- package/schema.json +16 -6
package/dist/client.mjs
CHANGED
|
@@ -4,20 +4,20 @@ import * as B from "svelte/internal/client";
|
|
|
4
4
|
import { hydrate as Y } from "svelte";
|
|
5
5
|
import J from "../src/components/RecursiveRender.svelte";
|
|
6
6
|
function K(t) {
|
|
7
|
-
const
|
|
8
|
-
return (
|
|
7
|
+
const i = new G(t);
|
|
8
|
+
return (e) => i.match(e) || null;
|
|
9
9
|
}
|
|
10
10
|
function Q(t) {
|
|
11
|
-
return t.map((
|
|
12
|
-
const
|
|
13
|
-
return { pattern:
|
|
11
|
+
return t.map((i) => {
|
|
12
|
+
const e = i.path, o = K(e);
|
|
13
|
+
return { pattern: e, parser: o };
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
function A() {
|
|
17
17
|
return A = Object.assign ? Object.assign.bind() : function(t) {
|
|
18
|
-
for (var
|
|
19
|
-
var
|
|
20
|
-
for (var
|
|
18
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
19
|
+
var e = arguments[i];
|
|
20
|
+
for (var o in e) ({}).hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
21
21
|
}
|
|
22
22
|
return t;
|
|
23
23
|
}, A.apply(null, arguments);
|
|
@@ -26,50 +26,50 @@ var S;
|
|
|
26
26
|
(function(t) {
|
|
27
27
|
t.Pop = "POP", t.Push = "PUSH", t.Replace = "REPLACE";
|
|
28
28
|
})(S || (S = {}));
|
|
29
|
-
var
|
|
29
|
+
var I = process.env.NODE_ENV !== "production" ? function(t) {
|
|
30
30
|
return Object.freeze(t);
|
|
31
31
|
} : function(t) {
|
|
32
32
|
return t;
|
|
33
33
|
};
|
|
34
|
-
function X(t,
|
|
34
|
+
function X(t, i) {
|
|
35
35
|
{
|
|
36
|
-
typeof console < "u" && console.warn(
|
|
36
|
+
typeof console < "u" && console.warn(i);
|
|
37
37
|
try {
|
|
38
|
-
throw new Error(
|
|
38
|
+
throw new Error(i);
|
|
39
39
|
} catch {
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
var
|
|
43
|
+
var F = "beforeunload", Z = "popstate";
|
|
44
44
|
function tt(t) {
|
|
45
45
|
t === void 0 && (t = {});
|
|
46
|
-
var
|
|
47
|
-
function
|
|
48
|
-
var
|
|
49
|
-
return [
|
|
50
|
-
pathname:
|
|
51
|
-
search:
|
|
52
|
-
hash:
|
|
53
|
-
state:
|
|
54
|
-
key:
|
|
46
|
+
var i = t, e = i.window, o = e === void 0 ? document.defaultView : e, a = o.history;
|
|
47
|
+
function r() {
|
|
48
|
+
var u = o.location, w = u.pathname, m = u.search, P = u.hash, b = a.state || {};
|
|
49
|
+
return [b.idx, I({
|
|
50
|
+
pathname: w,
|
|
51
|
+
search: m,
|
|
52
|
+
hash: P,
|
|
53
|
+
state: b.usr || null,
|
|
54
|
+
key: b.key || "default"
|
|
55
55
|
})];
|
|
56
56
|
}
|
|
57
|
-
var
|
|
58
|
-
function
|
|
59
|
-
if (
|
|
60
|
-
p.call(
|
|
57
|
+
var l = null;
|
|
58
|
+
function s() {
|
|
59
|
+
if (l)
|
|
60
|
+
p.call(l), l = null;
|
|
61
61
|
else {
|
|
62
|
-
var
|
|
62
|
+
var u = S.Pop, w = r(), m = w[0], P = w[1];
|
|
63
63
|
if (p.length)
|
|
64
|
-
if (
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
action:
|
|
68
|
-
location:
|
|
64
|
+
if (m != null) {
|
|
65
|
+
var b = f - m;
|
|
66
|
+
b && (l = {
|
|
67
|
+
action: u,
|
|
68
|
+
location: P,
|
|
69
69
|
retry: function() {
|
|
70
|
-
L(
|
|
70
|
+
L(b * -1);
|
|
71
71
|
}
|
|
72
|
-
}, L(
|
|
72
|
+
}, L(b));
|
|
73
73
|
} else
|
|
74
74
|
process.env.NODE_ENV !== "production" && X(
|
|
75
75
|
!1,
|
|
@@ -79,86 +79,86 @@ function tt(t) {
|
|
|
79
79
|
"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
|
|
80
80
|
);
|
|
81
81
|
else
|
|
82
|
-
E(
|
|
82
|
+
E(u);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
idx:
|
|
85
|
+
o.addEventListener(Z, s);
|
|
86
|
+
var n = S.Pop, c = r(), f = c[0], h = c[1], d = W(), p = W();
|
|
87
|
+
f == null && (f = 0, a.replaceState(A({}, a.state, {
|
|
88
|
+
idx: f
|
|
89
89
|
}), ""));
|
|
90
|
-
function v(
|
|
91
|
-
return typeof
|
|
90
|
+
function v(u) {
|
|
91
|
+
return typeof u == "string" ? u : nt(u);
|
|
92
92
|
}
|
|
93
|
-
function O(
|
|
94
|
-
return
|
|
95
|
-
pathname:
|
|
93
|
+
function O(u, w) {
|
|
94
|
+
return w === void 0 && (w = null), I(A({
|
|
95
|
+
pathname: h.pathname,
|
|
96
96
|
hash: "",
|
|
97
97
|
search: ""
|
|
98
|
-
}, typeof
|
|
99
|
-
state:
|
|
98
|
+
}, typeof u == "string" ? ot(u) : u, {
|
|
99
|
+
state: w,
|
|
100
100
|
key: et()
|
|
101
101
|
}));
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function k(u, w) {
|
|
104
104
|
return [{
|
|
105
|
-
usr:
|
|
106
|
-
key:
|
|
107
|
-
idx:
|
|
108
|
-
}, v(
|
|
105
|
+
usr: u.state,
|
|
106
|
+
key: u.key,
|
|
107
|
+
idx: w
|
|
108
|
+
}, v(u)];
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function j(u, w, m) {
|
|
111
111
|
return !p.length || (p.call({
|
|
112
|
-
action:
|
|
113
|
-
location:
|
|
114
|
-
retry:
|
|
112
|
+
action: u,
|
|
113
|
+
location: w,
|
|
114
|
+
retry: m
|
|
115
115
|
}), !1);
|
|
116
116
|
}
|
|
117
|
-
function E(
|
|
118
|
-
|
|
119
|
-
var
|
|
120
|
-
|
|
121
|
-
action:
|
|
122
|
-
location:
|
|
117
|
+
function E(u) {
|
|
118
|
+
n = u;
|
|
119
|
+
var w = r();
|
|
120
|
+
f = w[0], h = w[1], d.call({
|
|
121
|
+
action: n,
|
|
122
|
+
location: h
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
var
|
|
127
|
-
function
|
|
128
|
-
|
|
125
|
+
function M(u, w) {
|
|
126
|
+
var m = S.Push, P = O(u, w);
|
|
127
|
+
function b() {
|
|
128
|
+
M(u, w);
|
|
129
129
|
}
|
|
130
|
-
if (
|
|
131
|
-
var _ =
|
|
130
|
+
if (j(m, P, b)) {
|
|
131
|
+
var _ = k(P, f + 1), x = _[0], U = _[1];
|
|
132
132
|
try {
|
|
133
|
-
|
|
133
|
+
a.pushState(x, "", U);
|
|
134
134
|
} catch {
|
|
135
|
-
|
|
135
|
+
o.location.assign(U);
|
|
136
136
|
}
|
|
137
|
-
E(
|
|
137
|
+
E(m);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
function D(
|
|
141
|
-
var
|
|
142
|
-
function
|
|
143
|
-
D(
|
|
140
|
+
function D(u, w) {
|
|
141
|
+
var m = S.Replace, P = O(u, w);
|
|
142
|
+
function b() {
|
|
143
|
+
D(u, w);
|
|
144
144
|
}
|
|
145
|
-
if (
|
|
146
|
-
var _ =
|
|
147
|
-
|
|
145
|
+
if (j(m, P, b)) {
|
|
146
|
+
var _ = k(P, f), x = _[0], U = _[1];
|
|
147
|
+
a.replaceState(x, "", U), E(m);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
function L(
|
|
151
|
-
|
|
150
|
+
function L(u) {
|
|
151
|
+
a.go(u);
|
|
152
152
|
}
|
|
153
153
|
var z = {
|
|
154
154
|
get action() {
|
|
155
|
-
return
|
|
155
|
+
return n;
|
|
156
156
|
},
|
|
157
157
|
get location() {
|
|
158
|
-
return
|
|
158
|
+
return h;
|
|
159
159
|
},
|
|
160
160
|
createHref: v,
|
|
161
|
-
push:
|
|
161
|
+
push: M,
|
|
162
162
|
replace: D,
|
|
163
163
|
go: L,
|
|
164
164
|
back: function() {
|
|
@@ -167,19 +167,19 @@ function tt(t) {
|
|
|
167
167
|
forward: function() {
|
|
168
168
|
L(1);
|
|
169
169
|
},
|
|
170
|
-
listen: function(
|
|
171
|
-
return d.push(
|
|
170
|
+
listen: function(w) {
|
|
171
|
+
return d.push(w);
|
|
172
172
|
},
|
|
173
|
-
block: function(
|
|
174
|
-
var
|
|
175
|
-
return p.length === 1 &&
|
|
176
|
-
|
|
173
|
+
block: function(w) {
|
|
174
|
+
var m = p.push(w);
|
|
175
|
+
return p.length === 1 && o.addEventListener(F, H), function() {
|
|
176
|
+
m(), p.length || o.removeEventListener(F, H);
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
179
|
};
|
|
180
180
|
return z;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function H(t) {
|
|
183
183
|
t.preventDefault(), t.returnValue = "";
|
|
184
184
|
}
|
|
185
185
|
function W() {
|
|
@@ -188,16 +188,16 @@ function W() {
|
|
|
188
188
|
get length() {
|
|
189
189
|
return t.length;
|
|
190
190
|
},
|
|
191
|
-
push: function(
|
|
192
|
-
return t.push(
|
|
193
|
-
t = t.filter(function(
|
|
194
|
-
return
|
|
191
|
+
push: function(e) {
|
|
192
|
+
return t.push(e), function() {
|
|
193
|
+
t = t.filter(function(o) {
|
|
194
|
+
return o !== e;
|
|
195
195
|
});
|
|
196
196
|
};
|
|
197
197
|
},
|
|
198
|
-
call: function(
|
|
199
|
-
t.forEach(function(
|
|
200
|
-
return
|
|
198
|
+
call: function(e) {
|
|
199
|
+
t.forEach(function(o) {
|
|
200
|
+
return o && o(e);
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
203
|
};
|
|
@@ -206,20 +206,20 @@ function et() {
|
|
|
206
206
|
return Math.random().toString(36).substr(2, 8);
|
|
207
207
|
}
|
|
208
208
|
function nt(t) {
|
|
209
|
-
var
|
|
210
|
-
return
|
|
209
|
+
var i = t.pathname, e = i === void 0 ? "/" : i, o = t.search, a = o === void 0 ? "" : o, r = t.hash, l = r === void 0 ? "" : r;
|
|
210
|
+
return a && a !== "?" && (e += a.charAt(0) === "?" ? a : "?" + a), l && l !== "#" && (e += l.charAt(0) === "#" ? l : "#" + l), e;
|
|
211
211
|
}
|
|
212
212
|
function ot(t) {
|
|
213
|
-
var
|
|
213
|
+
var i = {};
|
|
214
214
|
if (t) {
|
|
215
|
-
var
|
|
216
|
-
|
|
217
|
-
var
|
|
218
|
-
|
|
215
|
+
var e = t.indexOf("#");
|
|
216
|
+
e >= 0 && (i.hash = t.substr(e), t = t.substr(0, e));
|
|
217
|
+
var o = t.indexOf("?");
|
|
218
|
+
o >= 0 && (i.search = t.substr(o), t = t.substr(0, o)), t && (i.pathname = t);
|
|
219
219
|
}
|
|
220
|
-
return
|
|
220
|
+
return i;
|
|
221
221
|
}
|
|
222
|
-
const rt = tt(),
|
|
222
|
+
const rt = tt(), g = B.proxy({
|
|
223
223
|
layouts: [],
|
|
224
224
|
view: null,
|
|
225
225
|
data: null,
|
|
@@ -229,42 +229,42 @@ const rt = tt(), m = B.proxy({
|
|
|
229
229
|
page: y
|
|
230
230
|
});
|
|
231
231
|
function T(...t) {
|
|
232
|
-
let
|
|
233
|
-
return
|
|
232
|
+
let i = t.map((e, o) => o === 0 ? e.replace(/\/+$/, "") : e.replace(/^\/+|\/+$/g, "")).join("/");
|
|
233
|
+
return i.startsWith("/") || (i = "/" + i), i.split("?")[0];
|
|
234
234
|
}
|
|
235
|
-
async function at(t,
|
|
235
|
+
async function at(t, i, e, o, a, r) {
|
|
236
236
|
try {
|
|
237
|
-
const
|
|
238
|
-
let
|
|
239
|
-
console.log({ layouts_paths:
|
|
240
|
-
const
|
|
237
|
+
const l = (e.layout || []).map((f) => T(i, f).toString());
|
|
238
|
+
let s = T(i, e.view).toString();
|
|
239
|
+
console.log({ layouts_paths: l, view_path: s });
|
|
240
|
+
const n = await Promise.all(l.map((f) => import(
|
|
241
241
|
/* @vite-ignore */
|
|
242
|
-
|
|
243
|
-
).then((
|
|
244
|
-
|
|
245
|
-
const
|
|
242
|
+
f
|
|
243
|
+
).then((h) => h.default)));
|
|
244
|
+
s.startsWith("/") || (s = "/" + s);
|
|
245
|
+
const c = await import(
|
|
246
246
|
/* @vite-ignore */
|
|
247
|
-
|
|
248
|
-
).then((
|
|
249
|
-
|
|
250
|
-
} catch (
|
|
251
|
-
console.log("Client-side route loading failed - falling back to SSR navigation"), console.error("Route loading error:",
|
|
252
|
-
const
|
|
253
|
-
window.location.href =
|
|
247
|
+
s
|
|
248
|
+
).then((f) => f.default);
|
|
249
|
+
g.layouts = n, g.view = c, g.params = o, g.data = window.__INITIAL_DATA__, g.urlParams = a, g.query = r, Y(J, { target: t, props: g });
|
|
250
|
+
} catch (l) {
|
|
251
|
+
console.log("Client-side route loading failed - falling back to SSR navigation"), console.error("Route loading error:", l);
|
|
252
|
+
const s = window.location.pathname || "/";
|
|
253
|
+
window.location.href = s;
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
async function N(t,
|
|
256
|
+
async function N(t, i, e, o, a, r, l = !1, s = !0) {
|
|
257
257
|
try {
|
|
258
|
-
const
|
|
258
|
+
const n = (e.layout || []).map((d) => T(i, d).toString()), c = T(i, e.view).toString(), f = await Promise.all(n.map((d) => import(
|
|
259
259
|
/* @vite-ignore */
|
|
260
260
|
d
|
|
261
|
-
).then((p) => p.default))),
|
|
261
|
+
).then((p) => p.default))), h = await import(
|
|
262
262
|
/* @vite-ignore */
|
|
263
|
-
|
|
263
|
+
c
|
|
264
264
|
).then((d) => d.default);
|
|
265
|
-
if (
|
|
265
|
+
if (l) {
|
|
266
266
|
const d = {
|
|
267
|
-
method:
|
|
267
|
+
method: e.method,
|
|
268
268
|
headers: {
|
|
269
269
|
"Content-Type": "application/json",
|
|
270
270
|
Accept: "application/json"
|
|
@@ -275,129 +275,137 @@ async function N(t, a, o, n, i, s, c = !1, r = !0) {
|
|
|
275
275
|
return p.json();
|
|
276
276
|
throw new Error("Network response was not ok");
|
|
277
277
|
}).then((p) => {
|
|
278
|
-
console.log("Server data", p),
|
|
278
|
+
console.log("Server data", p), g.data = p, g.params = o, g.layouts = f, g.view = h, g.urlParams = a, g.query = r;
|
|
279
279
|
});
|
|
280
280
|
} else
|
|
281
|
-
|
|
282
|
-
window && window.scroll(0, 0),
|
|
283
|
-
} catch (
|
|
284
|
-
console.log("Client-side navigation failed for URL:", t, "- falling back to SSR navigation"), console.error("Navigation error:",
|
|
281
|
+
g.data = { layout: [], view: {} }, g.params = o, g.layouts = f, g.view = h, g.urlParams = a, g.query = r;
|
|
282
|
+
window && window.scroll(0, 0), s && rt.push(t);
|
|
283
|
+
} catch (n) {
|
|
284
|
+
console.log("Client-side navigation failed for URL:", t, "- falling back to SSR navigation"), console.error("Navigation error:", n), window.location.href = t;
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
const
|
|
287
|
+
const R = B.proxy({});
|
|
288
288
|
async function it() {
|
|
289
|
-
Object.assign(
|
|
289
|
+
Object.assign(R, window.__MANIFEST__);
|
|
290
290
|
}
|
|
291
|
-
function st(t,
|
|
291
|
+
function st(t, i, e) {
|
|
292
292
|
if (!document) {
|
|
293
293
|
console.error("Document not found");
|
|
294
294
|
return;
|
|
295
295
|
}
|
|
296
|
-
document.addEventListener("click", (
|
|
297
|
-
var
|
|
298
|
-
const
|
|
299
|
-
if (
|
|
300
|
-
let
|
|
301
|
-
if (
|
|
302
|
-
|
|
296
|
+
document.addEventListener("click", (o) => {
|
|
297
|
+
var l, s;
|
|
298
|
+
const a = window.location.pathname, r = ((l = o.target) == null ? void 0 : l.tagName) === "A" ? o.target : (s = o.target) == null ? void 0 : s.closest("A");
|
|
299
|
+
if (r) {
|
|
300
|
+
let n = r.getAttribute("href");
|
|
301
|
+
if (a === n) {
|
|
302
|
+
o.preventDefault();
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
|
-
if (
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
308
|
-
|
|
309
|
-
const d =
|
|
310
|
-
N(
|
|
305
|
+
if (n && n.startsWith("/") || n.startsWith(".")) {
|
|
306
|
+
const c = n.split("?")[0], f = r.getAttribute("method") || "get", h = i.find((d) => d.method.toLowerCase() === f && e.find((p) => p.parser(c) && p.pattern === d.path));
|
|
307
|
+
if (h) {
|
|
308
|
+
o.preventDefault();
|
|
309
|
+
const d = e.find((E) => E.parser(c) && E.pattern === h.path), p = (d == null ? void 0 : d.parser(c)) || {}, v = new URLSearchParams(n.split("?")[1] || ""), O = Object.fromEntries(v.entries()) || {}, k = { ...p, ...O }, j = R[d == null ? void 0 : d.pattern];
|
|
310
|
+
N(n, t, h, k, p, O, j);
|
|
311
311
|
} else
|
|
312
|
-
console.log("No matching route found for URL:",
|
|
312
|
+
console.log("No matching route found for URL:", n, "- using fallback navigation");
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
}), window.addEventListener("popstate", (
|
|
316
|
-
const
|
|
317
|
-
y.url =
|
|
318
|
-
const
|
|
319
|
-
if (
|
|
320
|
-
const
|
|
321
|
-
y.params =
|
|
322
|
-
const d = { ...
|
|
323
|
-
N(
|
|
315
|
+
}), window.addEventListener("popstate", (o) => {
|
|
316
|
+
const a = window.location.pathname, r = window.location.pathname + window.location.search;
|
|
317
|
+
y.url = r, y.pathname = window.location.pathname;
|
|
318
|
+
const l = "get", s = i.find((n) => n.method.toLowerCase() === l && e.find((c) => c.parser(a) && c.pattern === n.path));
|
|
319
|
+
if (s) {
|
|
320
|
+
const n = e.find((v) => v.parser(a) && v.pattern === s.path), c = (n == null ? void 0 : n.parser(a)) || {}, f = new URLSearchParams(window.location.search), h = Object.fromEntries(f.entries()) || {};
|
|
321
|
+
y.params = c, y.query = h;
|
|
322
|
+
const d = { ...c, ...h }, p = R[n == null ? void 0 : n.pattern];
|
|
323
|
+
N(r, t, s, d, c, h, p, !1);
|
|
324
324
|
} else
|
|
325
|
-
console.log("No matching route found for popstate navigation to:",
|
|
325
|
+
console.log("No matching route found for popstate navigation to:", a, "- using fallback navigation"), window.location.href = a;
|
|
326
326
|
}), function() {
|
|
327
|
-
const
|
|
328
|
-
history.pushState = function(...
|
|
329
|
-
const
|
|
330
|
-
return
|
|
331
|
-
}, history.replaceState = function(...
|
|
332
|
-
const
|
|
333
|
-
if ((
|
|
334
|
-
const
|
|
335
|
-
|
|
327
|
+
const o = history.pushState, a = history.replaceState;
|
|
328
|
+
history.pushState = function(...r) {
|
|
329
|
+
const l = o.apply(this, r), s = new Event("pushstate");
|
|
330
|
+
return s.state = r[0], s.url = r[2], window.dispatchEvent(s), l;
|
|
331
|
+
}, history.replaceState = function(...r) {
|
|
332
|
+
const l = a.apply(this, r), s = r[2], n = window.location.pathname;
|
|
333
|
+
if ((s ? new URL(s, window.location.origin).pathname : n) !== n) {
|
|
334
|
+
const f = new Event("replacestate");
|
|
335
|
+
f.state = r[0], f.url = r[2], window.dispatchEvent(f);
|
|
336
336
|
}
|
|
337
|
-
return
|
|
337
|
+
return l;
|
|
338
338
|
};
|
|
339
|
-
}(), window.addEventListener("pushstate", (
|
|
340
|
-
const
|
|
341
|
-
if (
|
|
342
|
-
const
|
|
343
|
-
y.url =
|
|
344
|
-
const d = { ...
|
|
345
|
-
N(
|
|
339
|
+
}(), window.addEventListener("pushstate", (o) => {
|
|
340
|
+
const a = o.url || window.location.pathname + window.location.search, r = a.split("?")[0], l = "get", s = i.find((n) => n.method.toLowerCase() === l && e.find((c) => c.parser(r) && c.pattern === n.path));
|
|
341
|
+
if (s) {
|
|
342
|
+
const n = e.find((v) => v.parser(r) && v.pattern === s.path), c = n == null ? void 0 : n.parser(r), f = new URLSearchParams(a.split("?")[1] || ""), h = Object.fromEntries(f.entries());
|
|
343
|
+
y.url = a, y.pathname = window.location.pathname, Object.assign(y.params, c), Object.assign(y.query, h);
|
|
344
|
+
const d = { ...c, ...h }, p = R[n == null ? void 0 : n.pattern];
|
|
345
|
+
N(a, t, s, d, c, h, p, !1);
|
|
346
346
|
} else
|
|
347
|
-
console.log("No matching route found for pushstate to:",
|
|
348
|
-
}), window.addEventListener("replacestate", (
|
|
349
|
-
const
|
|
350
|
-
y.url =
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
353
|
-
const
|
|
354
|
-
N(
|
|
347
|
+
console.log("No matching route found for pushstate to:", r, "- using fallback navigation"), window.location.href = r;
|
|
348
|
+
}), window.addEventListener("replacestate", (o) => {
|
|
349
|
+
const a = o.url || window.location.pathname + window.location.search, r = a.split("?")[0];
|
|
350
|
+
y.url = a, y.pathname = window.location.pathname, y.query = Object.fromEntries(new URLSearchParams(a.split("?")[1] || ""));
|
|
351
|
+
const l = "get", s = i.find((n) => n.method.toLowerCase() === l && e.find((c) => c.parser(r) && c.pattern === n.path));
|
|
352
|
+
if (s) {
|
|
353
|
+
const n = e.find((v) => v.parser(r) && v.pattern === s.path), c = (n == null ? void 0 : n.parser(r)) || {}, f = new URLSearchParams(a.split("?")[1] || ""), h = Object.fromEntries(f.entries()) || {}, d = { ...c, ...h }, p = R[n == null ? void 0 : n.pattern];
|
|
354
|
+
N(a, t, s, d, c, h, p, !1);
|
|
355
355
|
} else
|
|
356
|
-
console.log("No matching route found for replacestate to:",
|
|
356
|
+
console.log("No matching route found for replacestate to:", r, "- using fallback navigation"), window.location.href = r;
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
359
|
const V = Symbol("forge-load-function");
|
|
360
360
|
let q = [], $ = null;
|
|
361
361
|
function ct(t) {
|
|
362
362
|
try {
|
|
363
|
-
const
|
|
364
|
-
return
|
|
363
|
+
const i = new URL(t, window.location.origin);
|
|
364
|
+
return i.origin === window.location.origin && !i.pathname.startsWith("/api/");
|
|
365
365
|
} catch {
|
|
366
366
|
return !t.startsWith("/api/");
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
function lt() {
|
|
370
|
-
typeof window < "u" && !$ && ($ = window.fetch, window.fetch = async function(t,
|
|
371
|
-
console.log("🔵 Enhanced fetch called for:", t), console.log("🔵 Initial
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
370
|
+
typeof window < "u" && !$ && ($ = window.fetch, window.fetch = async function(t, i = {}) {
|
|
371
|
+
console.log("🔵 Enhanced fetch called for:", t), console.log("🔵 Initial init:", i);
|
|
372
|
+
let e = { ...i };
|
|
373
|
+
for (const a of q)
|
|
374
|
+
try {
|
|
375
|
+
if (a.length === 2) {
|
|
376
|
+
const r = new Headers(e.headers), l = Object.fromEntries(r.entries());
|
|
377
|
+
console.log("🟡 Running callback-style middleware (length=2)"), await new Promise((s, n) => {
|
|
378
|
+
try {
|
|
379
|
+
a(l, (c) => {
|
|
380
|
+
if (c)
|
|
381
|
+
n(c);
|
|
382
|
+
else {
|
|
383
|
+
const f = new Headers();
|
|
384
|
+
Object.entries(l).forEach(([h, d]) => {
|
|
385
|
+
d !== void 0 && f.set(h, d);
|
|
386
|
+
}), e.headers = f, s();
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
} catch (c) {
|
|
390
|
+
n(c);
|
|
391
|
+
}
|
|
379
392
|
});
|
|
380
|
-
}
|
|
381
|
-
|
|
393
|
+
} else {
|
|
394
|
+
console.log("🟡 Running new-style RequestInit middleware (length=" + a.length + ")");
|
|
395
|
+
const r = await a(e, t);
|
|
396
|
+
r && typeof r == "object" ? (console.log("🟢 Middleware returned RequestInit:", r), e = r) : console.log("🟢 Middleware returned:", r);
|
|
382
397
|
}
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
};
|
|
393
|
-
console.log("🔴 Final requestInit:", s), console.log("🔴 Headers entries:", Array.from(i.entries()));
|
|
394
|
-
const c = await $(t, s);
|
|
395
|
-
if (c.status >= 300 && c.status < 400 && a[V]) {
|
|
396
|
-
const r = c.headers.get("location");
|
|
397
|
-
if (r && ct(r))
|
|
398
|
-
return window.location.href = r, c;
|
|
398
|
+
} catch (r) {
|
|
399
|
+
throw console.error("🔴 Middleware error:", r), r;
|
|
400
|
+
}
|
|
401
|
+
console.log("🟢 Final init after middleware:", e);
|
|
402
|
+
const o = await $(t, e);
|
|
403
|
+
if (o.status >= 300 && o.status < 400 && i[V]) {
|
|
404
|
+
const a = o.headers.get("location");
|
|
405
|
+
if (a && ct(a))
|
|
406
|
+
return window.location.href = a, o;
|
|
399
407
|
}
|
|
400
|
-
return
|
|
408
|
+
return o;
|
|
401
409
|
});
|
|
402
410
|
}
|
|
403
411
|
lt();
|
|
@@ -424,28 +432,28 @@ const ht = {
|
|
|
424
432
|
}
|
|
425
433
|
};
|
|
426
434
|
let C;
|
|
427
|
-
async function wt(t,
|
|
428
|
-
let
|
|
429
|
-
if (!
|
|
435
|
+
async function wt(t, i) {
|
|
436
|
+
let e = i.component_dir;
|
|
437
|
+
if (!e && typeof e != "string")
|
|
430
438
|
throw new Error("No component directory provided");
|
|
431
|
-
let
|
|
432
|
-
if (C = Q(
|
|
433
|
-
const
|
|
434
|
-
console.log(`Current pathname: ${
|
|
435
|
-
const
|
|
436
|
-
let
|
|
437
|
-
if (
|
|
438
|
-
console.log("Found route:",
|
|
439
|
-
const
|
|
440
|
-
it(), at(t,
|
|
439
|
+
let o = window.__ROUTING__;
|
|
440
|
+
if (C = Q(o), window && window.location) {
|
|
441
|
+
const a = (window.location.pathname || "/").split("?")[0];
|
|
442
|
+
console.log(`Current pathname: ${a}`);
|
|
443
|
+
const r = C.find((s) => s.parser(a));
|
|
444
|
+
let l = r ? o.find((s) => s.path === r.pattern) : null;
|
|
445
|
+
if (r && l) {
|
|
446
|
+
console.log("Found route:", l);
|
|
447
|
+
const s = r.parser(a) || {}, n = new URLSearchParams(window.location.search), c = Object.fromEntries(n.entries()) || {}, f = { ...s, ...c };
|
|
448
|
+
it(), at(t, e, l, f, s, c), st(e, o, C);
|
|
441
449
|
} else {
|
|
442
|
-
console.log("No matching route found, using fallback navigation"), window.location.href =
|
|
450
|
+
console.log("No matching route found, using fallback navigation"), window.location.href = a;
|
|
443
451
|
return;
|
|
444
452
|
}
|
|
445
453
|
}
|
|
446
454
|
}
|
|
447
455
|
export {
|
|
448
|
-
|
|
456
|
+
R as MANIFEST_STORE,
|
|
449
457
|
st as bootstrap_events,
|
|
450
458
|
wt as createApp,
|
|
451
459
|
ht as fetch,
|