@noego/forge 0.0.23 → 0.0.24
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/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.mjs +267 -221
- package/dist/client.mjs.map +1 -1
- package/dist-ssr/server.cjs +25 -1
- package/dist-ssr/server.cjs.map +1 -1
- package/dist-ssr/server.js +25 -1
- package/dist-ssr/server.js.map +1 -1
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./page.svelte-Dvj7306U.cjs"),K=require("svelte/internal/client"),Q=require("svelte"),X=require("../src/components/RecursiveRender.svelte");function Z(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return a.default=t,Object.freeze(a)}const F=Z(K);function tt(t){const a=new v.path_to_regex(t);return n=>a.match(n)||null}function et(t){return t.map(a=>{const n=a.path,r=tt(n);return{pattern:n,parser:r}})}function T(){return T=Object.assign?Object.assign.bind():function(t){for(var a=1;a<arguments.length;a++){var n=arguments[a];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},T.apply(null,arguments)}var E;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(E||(E={}));var W=process.env.NODE_ENV!=="production"?function(t){return Object.freeze(t)}:function(t){return t};function nt(t,a){{typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}var z="beforeunload",rt="popstate";function at(t){t===void 0&&(t={});var a=t,n=a.window,r=n===void 0?document.defaultView:n,i=r.history;function o(){var f=r.location,g=f.pathname,y=f.search,b=f.hash,P=i.state||{};return[P.idx,W({pathname:g,search:y,hash:b,state:P.usr||null,key:P.key||"default"})]}var c=null;function l(){if(c)h.call(c),c=null;else{var f=E.Pop,g=o(),y=g[0],b=g[1];if(h.length)if(y!=null){var P=u-y;P&&(c={action:f,location:b,retry:function(){L(P*-1)}},L(P))}else process.env.NODE_ENV!=="production"&&nt(!1,"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.");else _(f)}}r.addEventListener(rt,l);var e=E.Pop,s=o(),u=s[0],d=s[1],p=I(),h=I();u==null&&(u=0,i.replaceState(T({},i.state,{idx:u}),""));function w(f){return typeof f=="string"?f:it(f)}function j(f,g){return g===void 0&&(g=null),W(T({pathname:d.pathname,hash:"",search:""},typeof f=="string"?st(f):f,{state:g,key:ot()}))}function k(f,g){return[{usr:f.state,key:f.key,idx:g},w(f)]}function N(f,g,y){return!h.length||(h.call({action:f,location:g,retry:y}),!1)}function _(f){e=f;var g=o();u=g[0],d=g[1],p.call({action:e,location:d})}function M(f,g){var y=E.Push,b=j(f,g);function P(){M(f,g)}if(N(y,b,P)){var O=k(b,u+1),A=O[0],U=O[1];try{i.pushState(A,"",U)}catch{r.location.assign(U)}_(y)}}function D(f,g){var y=E.Replace,b=j(f,g);function P(){D(f,g)}if(N(y,b,P)){var O=k(b,u),A=O[0],U=O[1];i.replaceState(A,"",U),_(y)}}function L(f){i.go(f)}var J={get action(){return e},get location(){return d},createHref:w,push:M,replace:D,go:L,back:function(){L(-1)},forward:function(){L(1)},listen:function(g){return p.push(g)},block:function(g){var y=h.push(g);return h.length===1&&r.addEventListener(z,H),function(){y(),h.length||r.removeEventListener(z,H)}}};return J}function H(t){t.preventDefault(),t.returnValue=""}function I(){var t=[];return{get length(){return t.length},push:function(n){return t.push(n),function(){t=t.filter(function(r){return r!==n})}},call:function(n){t.forEach(function(r){return r&&r(n)})}}}function ot(){return Math.random().toString(36).substr(2,8)}function it(t){var a=t.pathname,n=a===void 0?"/":a,r=t.search,i=r===void 0?"":r,o=t.hash,c=o===void 0?"":o;return i&&i!=="?"&&(n+=i.charAt(0)==="?"?i:"?"+i),c&&c!=="#"&&(n+=c.charAt(0)==="#"?c:"#"+c),n}function st(t){var a={};if(t){var n=t.indexOf("#");n>=0&&(a.hash=t.substr(n),t=t.substr(0,n));var r=t.indexOf("?");r>=0&&(a.search=t.substr(r),t=t.substr(0,r)),t&&(a.pathname=t)}return a}const ct=at(),m=F.proxy({layouts:[],view:null,data:null,params:null,urlParams:null,query:null,page:v.page});function $(...t){let a=t.map((n,r)=>r===0?n.replace(/\/+$/,""):n.replace(/^\/+|\/+$/g,"")).join("/");return a.startsWith("/")||(a="/"+a),a.split("?")[0]}async function B(t,a,n,r,i,o){try{const c=typeof a=="string"&&a.indexOf("assets")!==-1,l=(n.layout||[]).map(d=>{let p=$(a,d).toString();return c&&(p=p.endsWith(".svelte")?p.replace(/\.svelte$/,".js"):/[.][a-z]+$/.test(p)?p:p+".js"),p});let e=$(a,n.view).toString();c&&(e=e.endsWith(".svelte")?e.replace(/\.svelte$/,".js"):/[.][a-z]+$/.test(e)?e:e+".js");const s=await Promise.all(l.map(d=>import(d).then(p=>p.default)));e.startsWith("/")||(e="/"+e);const u=await import(e).then(d=>d.default);m.layouts=s,m.view=u,m.params=r,m.data=window.__INITIAL_DATA__,m.urlParams=i,m.query=o,Q.hydrate(X,{target:t,props:m})}catch(c){console.error("Client-side route loading failed:",c)}}async function R(t,a,n,r,i,o,c=!1,l=!0){try{const e=typeof a=="string"&&a.indexOf("assets")!==-1,s=(n.layout||[]).map(h=>{let w=$(a,h).toString();return e&&(w=w.endsWith(".svelte")?w.replace(/\.svelte$/,".js"):/[.][a-z]+$/.test(w)?w:w+".js"),w});let u=$(a,n.view).toString();e&&(u=u.endsWith(".svelte")?u.replace(/\.svelte$/,".js"):/[.][a-z]+$/.test(u)?u:u+".js");const d=await Promise.all(s.map(h=>import(h).then(w=>w.default))),p=await import(u).then(h=>h.default);if(c){const h={method:n.method,headers:{"Content-Type":"application/json",Accept:"application/json"}};h[Y]=!0,await fetch(t,h).then(w=>{if(w.ok)return w.json();throw new Error("Network response was not ok")}).then(w=>{m.data=w,m.params=r,m.layouts=d,m.view=p,m.urlParams=i,m.query=o})}else m.data={layout:[],view:{}},m.params=r,m.layouts=d,m.view=p,m.urlParams=i,m.query=o;window&&window.scroll(0,0),l&&ct.push(t)}catch(e){console.error("Client-side navigation failed for URL:",t,e)}}const S=F.proxy({});async function V(){Object.assign(S,window.__MANIFEST__)}function G(t,a,n){if(!document){console.error("Document not found");return}document.addEventListener("click",r=>{var c,l;const i=window.location.pathname,o=((c=r.target)==null?void 0:c.tagName)==="A"?r.target:(l=r.target)==null?void 0:l.closest("A");if(o){let e=o.getAttribute("href");if(i===e){r.preventDefault();return}if(e&&e.startsWith("/")||e.startsWith(".")){const s=e.split("?")[0],u=o.getAttribute("method")||"get",d=a.find(p=>p.method.toLowerCase()===u&&n.find(h=>h.parser(s)&&h.pattern===p.path));if(d){r.preventDefault();const p=n.find(_=>_.parser(s)&&_.pattern===d.path),h=(p==null?void 0:p.parser(s))||{},w=new URLSearchParams(e.split("?")[1]||""),j=Object.fromEntries(w.entries())||{},k={...h,...j},N=S[p==null?void 0:p.pattern];R(e,t,d,k,h,j,N)}else console.log("No matching route found for URL:",e,"- using fallback navigation")}}}),window.addEventListener("popstate",r=>{const i=window.location.pathname,o=window.location.pathname+window.location.search;v.page.url=o,v.page.pathname=window.location.pathname;const c="get",l=a.find(e=>e.method.toLowerCase()===c&&n.find(s=>s.parser(i)&&s.pattern===e.path));if(l){const e=n.find(w=>w.parser(i)&&w.pattern===l.path),s=(e==null?void 0:e.parser(i))||{},u=new URLSearchParams(window.location.search),d=Object.fromEntries(u.entries())||{};v.page.params=s,v.page.query=d;const p={...s,...d},h=S[e==null?void 0:e.pattern];R(o,t,l,p,s,d,h,!1)}else console.log("No matching route found for popstate navigation to:",i,"- using fallback navigation"),window.location.href=i}),function(){const r=history.pushState,i=history.replaceState;history.pushState=function(...o){const c=r.apply(this,o),l=new Event("pushstate");return l.state=o[0],l.url=o[2],window.dispatchEvent(l),c},history.replaceState=function(...o){const c=i.apply(this,o),l=o[2],e=window.location.pathname;if((l?new URL(l,window.location.origin).pathname:e)!==e){const u=new Event("replacestate");u.state=o[0],u.url=o[2],window.dispatchEvent(u)}return c}}(),window.addEventListener("pushstate",r=>{const i=r.url||window.location.pathname+window.location.search,o=i.split("?")[0],c="get",l=a.find(e=>e.method.toLowerCase()===c&&n.find(s=>s.parser(o)&&s.pattern===e.path));if(l){const e=n.find(w=>w.parser(o)&&w.pattern===l.path),s=e==null?void 0:e.parser(o),u=new URLSearchParams(i.split("?")[1]||""),d=Object.fromEntries(u.entries());v.page.url=i,v.page.pathname=window.location.pathname,Object.assign(v.page.params,s),Object.assign(v.page.query,d);const p={...s,...d},h=S[e==null?void 0:e.pattern];R(i,t,l,p,s,d,h,!1)}else console.log("No matching route found for pushstate to:",o,"- using fallback navigation"),window.location.href=o}),window.addEventListener("replacestate",r=>{const i=r.url||window.location.pathname+window.location.search,o=i.split("?")[0];v.page.url=i,v.page.pathname=window.location.pathname,v.page.query=Object.fromEntries(new URLSearchParams(i.split("?")[1]||""));const c="get",l=a.find(e=>e.method.toLowerCase()===c&&n.find(s=>s.parser(o)&&s.pattern===e.path));if(l){const e=n.find(w=>w.parser(o)&&w.pattern===l.path),s=(e==null?void 0:e.parser(o))||{},u=new URLSearchParams(i.split("?")[1]||""),d=Object.fromEntries(u.entries())||{},p={...s,...d},h=S[e==null?void 0:e.pattern];R(i,t,l,p,s,d,h,!1)}else console.log("No matching route found for replacestate to:",o,"- using fallback navigation"),window.location.href=o})}const Y=Symbol("forge-load-function");let q=[],C=null;function lt(t){try{const a=new URL(t,window.location.origin);return a.origin===window.location.origin&&!a.pathname.startsWith("/api/")}catch{return!t.startsWith("/api/")}}function ut(){typeof window<"u"&&!C&&(C=window.fetch,window.fetch=async function(t,a={}){let n={...a};for(const i of q)try{if(i.length===2){const o=new Headers(n.headers),c=Object.fromEntries(o.entries());await new Promise((l,e)=>{try{i(c,s=>{if(s)e(s);else{const u=new Headers;Object.entries(c).forEach(([d,p])=>{p!==void 0&&u.set(d,p)}),n.headers=u,l()}})}catch(s){e(s)}})}else{const o=await i(n,t);o&&typeof o=="object"&&(n=o)}}catch(o){throw console.error("🔴 Middleware error:",o),o}const r=await C(t,n);if(r.status>=300&&r.status<400&&a[Y]){const i=r.headers.get("location");if(i&<(i))return window.location.href=i,r}return r})}ut();const pt={configUpdate(t){if(typeof t!="function")throw new Error("Middleware must be a function");q.push(t)},reset(){q.length=0},getMiddlewareCount(){return q.length}};let x;async function ft(t,a){let n=window.__COMPONENT_DIR__||a.component_dir;if(!n&&typeof n!="string")throw new Error("No component directory provided");let r=window.__ROUTING__;if(x=et(r),window&&window.location){const i=(window.location.pathname||"/").split("?")[0],o=x.find(l=>l.parser(i));let c=o?r.find(l=>l.path===o.pattern):null;if(o&&c){const l=o.parser(i)||{},e=new URLSearchParams(window.location.search),s=Object.fromEntries(e.entries())||{},u={...l,...s};V(),B(t,n,c,u,l,s),G(n,r,x)}else console.warn("No matching route found for:",i)}}exports.page=v.page;exports.shadowUrl=v.shadowUrl;exports.MANIFEST_STORE=S;exports.bootstrap_events=G;exports.createApp=ft;exports.fetch=pt;exports.loadRoute=B;exports.updateManifestStore=V;exports.updateRoute=R;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./page.svelte-Dvj7306U.cjs"),K=require("svelte/internal/client"),Q=require("svelte"),X=require("../src/components/RecursiveRender.svelte");function Z(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const W=Z(K);function tt(t){const o=new v.path_to_regex(t);return n=>o.match(n)||null}function et(t){return t.map(o=>{const n=o.path,r=tt(n);return{pattern:n,parser:r}})}function U(){return U=Object.assign?Object.assign.bind():function(t){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},U.apply(null,arguments)}var N;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(N||(N={}));var M=process.env.NODE_ENV!=="production"?function(t){return Object.freeze(t)}:function(t){return t};function nt(t,o){{typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}var F="beforeunload",rt="popstate";function ot(t){t===void 0&&(t={});var o=t,n=o.window,r=n===void 0?document.defaultView:n,a=r.history;function i(){var d=r.location,g=d.pathname,E=d.search,O=d.hash,b=a.state||{};return[b.idx,M({pathname:g,search:E,hash:O,state:b.usr||null,key:b.key||"default"})]}var s=null;function l(){if(s)h.call(s),s=null;else{var d=N.Pop,g=i(),E=g[0],O=g[1];if(h.length)if(E!=null){var b=f-E;b&&(s={action:d,location:O,retry:function(){T(b*-1)}},T(b))}else process.env.NODE_ENV!=="production"&&nt(!1,"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.");else R(d)}}r.addEventListener(rt,l);var e=N.Pop,u=i(),f=u[0],p=u[1],c=G(),h=G();f==null&&(f=0,a.replaceState(U({},a.state,{idx:f}),""));function y(d){return typeof d=="string"?d:it(d)}function P(d,g){return g===void 0&&(g=null),M(U({pathname:p.pathname,hash:"",search:""},typeof d=="string"?st(d):d,{state:g,key:at()}))}function w(d,g){return[{usr:d.state,key:d.key,idx:g},y(d)]}function j(d,g,E){return!h.length||(h.call({action:d,location:g,retry:E}),!1)}function R(d){e=d;var g=i();f=g[0],p=g[1],c.call({action:e,location:p})}function D(d,g){var E=N.Push,O=P(d,g);function b(){D(d,g)}if(j(E,O,b)){var S=w(O,f+1),I=S[0],L=S[1];try{a.pushState(I,"",L)}catch{r.location.assign(L)}R(E)}}function x(d,g){var E=N.Replace,O=P(d,g);function b(){x(d,g)}if(j(E,O,b)){var S=w(O,f),I=S[0],L=S[1];a.replaceState(I,"",L),R(E)}}function T(d){a.go(d)}var Y={get action(){return e},get location(){return p},createHref:y,push:D,replace:x,go:T,back:function(){T(-1)},forward:function(){T(1)},listen:function(g){return c.push(g)},block:function(g){var E=h.push(g);return h.length===1&&r.addEventListener(F,V),function(){E(),h.length||r.removeEventListener(F,V)}}};return Y}function V(t){t.preventDefault(),t.returnValue=""}function G(){var t=[];return{get length(){return t.length},push:function(n){return t.push(n),function(){t=t.filter(function(r){return r!==n})}},call:function(n){t.forEach(function(r){return r&&r(n)})}}}function at(){return Math.random().toString(36).substr(2,8)}function it(t){var o=t.pathname,n=o===void 0?"/":o,r=t.search,a=r===void 0?"":r,i=t.hash,s=i===void 0?"":i;return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function st(t){var o={};if(t){var n=t.indexOf("#");n>=0&&(o.hash=t.substr(n),t=t.substr(0,n));var r=t.indexOf("?");r>=0&&(o.search=t.substr(r),t=t.substr(0,r)),t&&(o.pathname=t)}return o}const ct=ot(),m=W.proxy({layouts:[],view:null,data:null,params:null,urlParams:null,query:null,page:v.page});function q(...t){let o=t.map((n,r)=>r===0?n.replace(/\/+$/,""):n.replace(/^\/+|\/+$/g,"")).join("/");return o.startsWith("/")||(o="/"+o),o.split("?")[0]}async function H(t,o,n,r,a,i){try{const s=typeof o=="string"&&o.indexOf("assets")!==-1,l=(n.layout||[]).map(p=>{let c=q(o,p).toString();return s&&(c=c.endsWith(".svelte")?c.replace(/\.svelte$/,".js"):/[.][a-z]+$/.test(c)?c:c+".js"),c});let e=q(o,n.view).toString();s&&(e=e.endsWith(".svelte")?e.replace(/\.svelte$/,".js"):/[.][a-z]+$/.test(e)?e:e+".js");const u=await Promise.all(l.map(p=>import(p).then(c=>c.default)));e.startsWith("/")||(e="/"+e);const f=await import(e).then(p=>p.default);m.layouts=u,m.view=f,m.params=r,m.data=window.__INITIAL_DATA__,m.urlParams=a,m.query=i,Q.hydrate(X,{target:t,props:m})}catch(s){console.error("Client-side route loading failed:",s)}}async function A(t,o,n,r,a,i,s=!1,l=!0){console.log("[NAVIGATION] updateRoute called",{url:t,server_loading:s,route_path:n.path,route_middleware:n.middleware});try{let e=null,u=!1;if(s){console.log("[NAVIGATION] Making server fetch FIRST for",t);const P={method:n.method,headers:{"Content-Type":"application/json",Accept:"application/json"}};if(P[J]=!0,await fetch(t,P).then(w=>{if(console.log("[NAVIGATION] Fetch response",{url:t,ok:w.ok,status:w.status,type:w.type,redirected:w.redirected,finalUrl:w.url}),w.redirected)return console.log("[NAVIGATION] Redirect detected, not loading components"),u=!0,null;if(w.ok)return w.json();throw new Error("Network response was not ok")}).then(w=>{e=w}),u){console.log("[NAVIGATION] Exiting early due to redirect");return}}const f=typeof o=="string"&&o.indexOf("assets")!==-1,p=(n.layout||[]).map(P=>{let w=q(o,P).toString();return f&&(w=w.endsWith(".svelte")?w.replace(/\.svelte$/,".js"):/[.][a-z]+$/.test(w)?w:w+".js"),w});let c=q(o,n.view).toString();f&&(c=c.endsWith(".svelte")?c.replace(/\.svelte$/,".js"):/[.][a-z]+$/.test(c)?c:c+".js");const h=await Promise.all(p.map(P=>import(P).then(w=>w.default))),y=await import(c).then(P=>P.default);s?(m.data=e,m.params=r,m.layouts=h,m.view=y,m.urlParams=a,m.query=i):(console.log("[NAVIGATION] No server loading needed for",t),m.data={layout:[],view:{}},m.params=r,m.layouts=h,m.view=y,m.urlParams=a,m.query=i),window&&window.scroll(0,0),l&&ct.push(t)}catch(e){console.error("Client-side navigation failed for URL:",t,e)}}const _=W.proxy({});async function z(){Object.assign(_,window.__MANIFEST__)}function B(t,o,n){if(!document){console.error("Document not found");return}document.addEventListener("click",r=>{var s,l;const a=window.location.pathname,i=((s=r.target)==null?void 0:s.tagName)==="A"?r.target:(l=r.target)==null?void 0:l.closest("A");if(i){let e=i.getAttribute("href");if(a===e){r.preventDefault();return}if(e&&e.startsWith("/")||e.startsWith(".")){const u=e.split("?")[0],f=i.getAttribute("method")||"get",p=o.find(c=>c.method.toLowerCase()===f&&n.find(h=>h.parser(u)&&h.pattern===c.path));if(p){r.preventDefault();const c=n.find(R=>R.parser(u)&&R.pattern===p.path),h=(c==null?void 0:c.parser(u))||{},y=new URLSearchParams(e.split("?")[1]||""),P=Object.fromEntries(y.entries())||{},w={...h,...P},j=_[c==null?void 0:c.pattern];console.log("[EVENTS] Navigation to",e,{pattern:c==null?void 0:c.pattern,requires_server_data:j,manifest_store:_,middleware:p.middleware}),A(e,t,p,w,h,P,j)}else console.log("No matching route found for URL:",e,"- using fallback navigation")}}}),window.addEventListener("popstate",r=>{const a=window.location.pathname,i=window.location.pathname+window.location.search;v.page.url=i,v.page.pathname=window.location.pathname;const s="get",l=o.find(e=>e.method.toLowerCase()===s&&n.find(u=>u.parser(a)&&u.pattern===e.path));if(l){const e=n.find(y=>y.parser(a)&&y.pattern===l.path),u=(e==null?void 0:e.parser(a))||{},f=new URLSearchParams(window.location.search),p=Object.fromEntries(f.entries())||{};v.page.params=u,v.page.query=p;const c={...u,...p},h=_[e==null?void 0:e.pattern];A(i,t,l,c,u,p,h,!1)}else console.log("No matching route found for popstate navigation to:",a,"- using fallback navigation"),window.location.href=a}),function(){const r=history.pushState,a=history.replaceState;history.pushState=function(...i){const s=r.apply(this,i),l=new Event("pushstate");return l.state=i[0],l.url=i[2],window.dispatchEvent(l),s},history.replaceState=function(...i){const s=a.apply(this,i),l=i[2],e=window.location.pathname;if((l?new URL(l,window.location.origin).pathname:e)!==e){const f=new Event("replacestate");f.state=i[0],f.url=i[2],window.dispatchEvent(f)}return s}}(),window.addEventListener("pushstate",r=>{const a=r.url||window.location.pathname+window.location.search,i=a.split("?")[0],s="get",l=o.find(e=>e.method.toLowerCase()===s&&n.find(u=>u.parser(i)&&u.pattern===e.path));if(l){const e=n.find(y=>y.parser(i)&&y.pattern===l.path),u=e==null?void 0:e.parser(i),f=new URLSearchParams(a.split("?")[1]||""),p=Object.fromEntries(f.entries());v.page.url=a,v.page.pathname=window.location.pathname,Object.assign(v.page.params,u),Object.assign(v.page.query,p);const c={...u,...p},h=_[e==null?void 0:e.pattern];A(a,t,l,c,u,p,h,!1)}else console.log("No matching route found for pushstate to:",i,"- using fallback navigation"),window.location.href=i}),window.addEventListener("replacestate",r=>{const a=r.url||window.location.pathname+window.location.search,i=a.split("?")[0];v.page.url=a,v.page.pathname=window.location.pathname,v.page.query=Object.fromEntries(new URLSearchParams(a.split("?")[1]||""));const s="get",l=o.find(e=>e.method.toLowerCase()===s&&n.find(u=>u.parser(i)&&u.pattern===e.path));if(l){const e=n.find(y=>y.parser(i)&&y.pattern===l.path),u=(e==null?void 0:e.parser(i))||{},f=new URLSearchParams(a.split("?")[1]||""),p=Object.fromEntries(f.entries())||{},c={...u,...p},h=_[e==null?void 0:e.pattern];A(a,t,l,c,u,p,h,!1)}else console.log("No matching route found for replacestate to:",i,"- using fallback navigation"),window.location.href=i})}const J=Symbol("forge-load-function");let k=[],C=null;function lt(t){try{const o=new URL(t,window.location.origin);return o.origin===window.location.origin&&!o.pathname.startsWith("/api/")}catch{return!t.startsWith("/api/")}}function ut(){typeof window<"u"&&!C&&(C=window.fetch,window.fetch=async function(t,o={}){let n={...o};for(const i of k)try{if(i.length===2){const s=new Headers(n.headers),l=Object.fromEntries(s.entries());await new Promise((e,u)=>{try{i(l,f=>{if(f)u(f);else{const p=new Headers;Object.entries(l).forEach(([c,h])=>{h!==void 0&&p.set(c,h)}),n.headers=p,e()}})}catch(f){u(f)}})}else{const s=await i(n,t);s&&typeof s=="object"&&(n=s)}}catch(s){throw console.error("🔴 Middleware error:",s),s}const r=n==null?void 0:n[J];console.log("[FETCH OVERRIDE] Request",{url:t,hasForgeSymbol:r,headers:n==null?void 0:n.headers});const a=await C(t,n);if(console.log("[FETCH OVERRIDE] Response",{url:t,responseUrl:a.url,redirected:a.redirected,status:a.status,type:a.type,hasForgeSymbol:r}),r&&a.redirected){const i=typeof t=="string"?t:t.url,s=a.url;if(console.log("[FORGE REDIRECT] Detected redirect",{requested:i,final:s,redirected:a.redirected}),lt(s)){const l=new URL(s),e=l.pathname+l.search;return console.log("[FORGE REDIRECT] Using pushState for SPA navigation to:",e,"from:",s),history.pushState(null,"",e),new Response(JSON.stringify({layout:[],view:{}}),{status:200,headers:{"Content-Type":"application/json"}})}}return a})}ut();const dt={configUpdate(t){if(typeof t!="function")throw new Error("Middleware must be a function");k.push(t)},reset(){k.length=0},getMiddlewareCount(){return k.length}};let $;async function ft(t,o){let n=window.__COMPONENT_DIR__||o.component_dir;if(!n&&typeof n!="string")throw new Error("No component directory provided");let r=window.__ROUTING__;if($=et(r),window&&window.location){const a=(window.location.pathname||"/").split("?")[0],i=$.find(l=>l.parser(a));let s=i?r.find(l=>l.path===i.pattern):null;if(i&&s){const l=i.parser(a)||{},e=new URLSearchParams(window.location.search),u=Object.fromEntries(e.entries())||{},f={...l,...u};z(),H(t,n,s,f,l,u),B(n,r,$)}else console.warn("No matching route found for:",a)}}exports.page=v.page;exports.shadowUrl=v.shadowUrl;exports.MANIFEST_STORE=_;exports.bootstrap_events=B;exports.createApp=ft;exports.fetch=dt;exports.loadRoute=H;exports.updateManifestStore=z;exports.updateRoute=A;
|
|
2
2
|
//# sourceMappingURL=client.cjs.map
|
package/dist/client.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.cjs","sources":["../src/routing/url_parser.ts","../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/history/index.js","../src/client/navigation.svelte.ts","../src/routing/manifest/store.svelte.ts","../src/client/events.ts","../src/client/client.ts"],"sourcesContent":["import pathToRegex from 'path-to-regex';\nimport type { IRoute } from '../parser/IRoute';\n\n\n\nexport function makeUrlParser(pattern: string) {\n const parser = new pathToRegex(pattern);\n return (pathname: string) => {\n const result = parser.match(pathname);\n return result || null;\n };\n}\n\n\nexport type UrlMatcher = {\n pattern: string,\n parser: ReturnType<typeof makeUrlParser>\n}\n\nexport function findRoute(pathname:string, routes: UrlMatcher[]) {\n for (const { pattern, parser } of routes) {\n const params = parser(pathname);\n if (params) {\n return { pattern, params };\n }\n }\n return null;\n}\n\n\n\n\n\nexport function initialize_route_matchers(routes: IRoute[]): UrlMatcher[] {\n return routes.map((route: IRoute) => {\n const pattern = route.path;\n const parser = makeUrlParser(pattern);\n return { pattern, parser };\n })\n}\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import _extends from '@babel/runtime/helpers/esm/extends';\n\n/**\r\n * Actions represent the type of change to a location value.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#action\r\n */\nvar Action;\n\n(function (Action) {\n /**\r\n * A POP indicates a change to an arbitrary index in the history stack, such\r\n * as a back or forward navigation. It does not describe the direction of the\r\n * navigation, only that the current index changed.\r\n *\r\n * Note: This is the default action for newly created history objects.\r\n */\n Action[\"Pop\"] = \"POP\";\n /**\r\n * A PUSH indicates a new entry being added to the history stack, such as when\r\n * a link is clicked and a new page loads. When this happens, all subsequent\r\n * entries in the stack are lost.\r\n */\n\n Action[\"Push\"] = \"PUSH\";\n /**\r\n * A REPLACE indicates the entry at the current index in the history stack\r\n * being replaced by a new one.\r\n */\n\n Action[\"Replace\"] = \"REPLACE\";\n})(Action || (Action = {}));\n\nvar readOnly = process.env.NODE_ENV !== \"production\" ? function (obj) {\n return Object.freeze(obj);\n} : function (obj) {\n return obj;\n};\n\nfunction warning(cond, message) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== 'undefined') console.warn(message);\n\n try {\n // Welcome to debugging history!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message); // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\nvar BeforeUnloadEventType = 'beforeunload';\nvar HashChangeEventType = 'hashchange';\nvar PopStateEventType = 'popstate';\n/**\r\n * Browser history stores the location in regular URLs. This is the standard for\r\n * most web apps, but it requires some configuration on the server to ensure you\r\n * serve the same app at multiple URLs.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\r\n */\n\nfunction createBrowserHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$window = _options.window,\n window = _options$window === void 0 ? document.defaultView : _options$window;\n var globalHistory = window.history;\n\n function getIndexAndLocation() {\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var state = globalHistory.state || {};\n return [state.idx, readOnly({\n pathname: pathname,\n search: search,\n hash: hash,\n state: state.usr || null,\n key: state.key || 'default'\n })];\n }\n\n var blockedPopTx = null;\n\n function handlePop() {\n if (blockedPopTx) {\n blockers.call(blockedPopTx);\n blockedPopTx = null;\n } else {\n var nextAction = Action.Pop;\n\n var _getIndexAndLocation = getIndexAndLocation(),\n nextIndex = _getIndexAndLocation[0],\n nextLocation = _getIndexAndLocation[1];\n\n if (blockers.length) {\n if (nextIndex != null) {\n var delta = index - nextIndex;\n\n if (delta) {\n // Revert the POP\n blockedPopTx = {\n action: nextAction,\n location: nextLocation,\n retry: function retry() {\n go(delta * -1);\n }\n };\n go(delta);\n }\n } else {\n // Trying to POP to a location with no index. We did not create\n // this location, so we can't effectively block the navigation.\n process.env.NODE_ENV !== \"production\" ? warning(false, // TODO: Write up a doc that explains our blocking strategy in\n // detail and link to it here so people can understand better what\n // is going on and how to avoid it.\n \"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.\") : void 0;\n }\n } else {\n applyTx(nextAction);\n }\n }\n }\n\n window.addEventListener(PopStateEventType, handlePop);\n var action = Action.Pop;\n\n var _getIndexAndLocation2 = getIndexAndLocation(),\n index = _getIndexAndLocation2[0],\n location = _getIndexAndLocation2[1];\n\n var listeners = createEvents();\n var blockers = createEvents();\n\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), '');\n }\n\n function createHref(to) {\n return typeof to === 'string' ? to : createPath(to);\n } // state defaults to `null` because `window.history.state` does\n\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n hash: '',\n search: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function getHistoryStateAndUrl(nextLocation, index) {\n return [{\n usr: nextLocation.state,\n key: nextLocation.key,\n idx: index\n }, createHref(nextLocation)];\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction) {\n action = nextAction;\n\n var _getIndexAndLocation3 = getIndexAndLocation();\n\n index = _getIndexAndLocation3[0];\n location = _getIndexAndLocation3[1];\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr = getHistoryStateAndUrl(nextLocation, index + 1),\n historyState = _getHistoryStateAndUr[0],\n url = _getHistoryStateAndUr[1]; // TODO: Support forced reloading\n // try...catch because iOS limits us to 100 pushState calls :/\n\n\n try {\n globalHistory.pushState(historyState, '', url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n applyTx(nextAction);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr2 = getHistoryStateAndUrl(nextLocation, index),\n historyState = _getHistoryStateAndUr2[0],\n url = _getHistoryStateAndUr2[1]; // TODO: Support forced reloading\n\n\n globalHistory.replaceState(historyState, '', url);\n applyTx(nextAction);\n }\n }\n\n function go(delta) {\n globalHistory.go(delta);\n }\n\n var history = {\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n var unblock = blockers.push(blocker);\n\n if (blockers.length === 1) {\n window.addEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n\n return function () {\n unblock(); // Remove the beforeunload listener so the document may\n // still be salvageable in the pagehide event.\n // See https://html.spec.whatwg.org/#unloading-documents\n\n if (!blockers.length) {\n window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n };\n }\n };\n return history;\n}\n/**\r\n * Hash history stores the location in window.location.hash. This makes it ideal\r\n * for situations where you don't want to send the location to the server for\r\n * some reason, either because you do cannot configure it or the URL space is\r\n * reserved for something else.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\r\n */\n\nfunction createHashHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options2 = options,\n _options2$window = _options2.window,\n window = _options2$window === void 0 ? document.defaultView : _options2$window;\n var globalHistory = window.history;\n\n function getIndexAndLocation() {\n var _parsePath = parsePath(window.location.hash.substr(1)),\n _parsePath$pathname = _parsePath.pathname,\n pathname = _parsePath$pathname === void 0 ? '/' : _parsePath$pathname,\n _parsePath$search = _parsePath.search,\n search = _parsePath$search === void 0 ? '' : _parsePath$search,\n _parsePath$hash = _parsePath.hash,\n hash = _parsePath$hash === void 0 ? '' : _parsePath$hash;\n\n var state = globalHistory.state || {};\n return [state.idx, readOnly({\n pathname: pathname,\n search: search,\n hash: hash,\n state: state.usr || null,\n key: state.key || 'default'\n })];\n }\n\n var blockedPopTx = null;\n\n function handlePop() {\n if (blockedPopTx) {\n blockers.call(blockedPopTx);\n blockedPopTx = null;\n } else {\n var nextAction = Action.Pop;\n\n var _getIndexAndLocation4 = getIndexAndLocation(),\n nextIndex = _getIndexAndLocation4[0],\n nextLocation = _getIndexAndLocation4[1];\n\n if (blockers.length) {\n if (nextIndex != null) {\n var delta = index - nextIndex;\n\n if (delta) {\n // Revert the POP\n blockedPopTx = {\n action: nextAction,\n location: nextLocation,\n retry: function retry() {\n go(delta * -1);\n }\n };\n go(delta);\n }\n } else {\n // Trying to POP to a location with no index. We did not create\n // this location, so we can't effectively block the navigation.\n process.env.NODE_ENV !== \"production\" ? warning(false, // TODO: Write up a doc that explains our blocking strategy in\n // detail and link to it here so people can understand better\n // what is going on and how to avoid it.\n \"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.\") : void 0;\n }\n } else {\n applyTx(nextAction);\n }\n }\n }\n\n window.addEventListener(PopStateEventType, handlePop); // popstate does not fire on hashchange in IE 11 and old (trident) Edge\n // https://developer.mozilla.org/de/docs/Web/API/Window/popstate_event\n\n window.addEventListener(HashChangeEventType, function () {\n var _getIndexAndLocation5 = getIndexAndLocation(),\n nextLocation = _getIndexAndLocation5[1]; // Ignore extraneous hashchange events.\n\n\n if (createPath(nextLocation) !== createPath(location)) {\n handlePop();\n }\n });\n var action = Action.Pop;\n\n var _getIndexAndLocation6 = getIndexAndLocation(),\n index = _getIndexAndLocation6[0],\n location = _getIndexAndLocation6[1];\n\n var listeners = createEvents();\n var blockers = createEvents();\n\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), '');\n }\n\n function getBaseHref() {\n var base = document.querySelector('base');\n var href = '';\n\n if (base && base.getAttribute('href')) {\n var url = window.location.href;\n var hashIndex = url.indexOf('#');\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n\n return href;\n }\n\n function createHref(to) {\n return getBaseHref() + '#' + (typeof to === 'string' ? to : createPath(to));\n }\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n hash: '',\n search: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function getHistoryStateAndUrl(nextLocation, index) {\n return [{\n usr: nextLocation.state,\n key: nextLocation.key,\n idx: index\n }, createHref(nextLocation)];\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction) {\n action = nextAction;\n\n var _getIndexAndLocation7 = getIndexAndLocation();\n\n index = _getIndexAndLocation7[0];\n location = _getIndexAndLocation7[1];\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(nextLocation.pathname.charAt(0) === '/', \"Relative pathnames are not supported in hash history.push(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr3 = getHistoryStateAndUrl(nextLocation, index + 1),\n historyState = _getHistoryStateAndUr3[0],\n url = _getHistoryStateAndUr3[1]; // TODO: Support forced reloading\n // try...catch because iOS limits us to 100 pushState calls :/\n\n\n try {\n globalHistory.pushState(historyState, '', url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n applyTx(nextAction);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(nextLocation.pathname.charAt(0) === '/', \"Relative pathnames are not supported in hash history.replace(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr4 = getHistoryStateAndUrl(nextLocation, index),\n historyState = _getHistoryStateAndUr4[0],\n url = _getHistoryStateAndUr4[1]; // TODO: Support forced reloading\n\n\n globalHistory.replaceState(historyState, '', url);\n applyTx(nextAction);\n }\n }\n\n function go(delta) {\n globalHistory.go(delta);\n }\n\n var history = {\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n var unblock = blockers.push(blocker);\n\n if (blockers.length === 1) {\n window.addEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n\n return function () {\n unblock(); // Remove the beforeunload listener so the document may\n // still be salvageable in the pagehide event.\n // See https://html.spec.whatwg.org/#unloading-documents\n\n if (!blockers.length) {\n window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n };\n }\n };\n return history;\n}\n/**\r\n * Memory history stores the current location in memory. It is designed for use\r\n * in stateful non-browser environments like tests and React Native.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#creatememoryhistory\r\n */\n\nfunction createMemoryHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options3 = options,\n _options3$initialEntr = _options3.initialEntries,\n initialEntries = _options3$initialEntr === void 0 ? ['/'] : _options3$initialEntr,\n initialIndex = _options3.initialIndex;\n var entries = initialEntries.map(function (entry) {\n var location = readOnly(_extends({\n pathname: '/',\n search: '',\n hash: '',\n state: null,\n key: createKey()\n }, typeof entry === 'string' ? parsePath(entry) : entry));\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: \" + JSON.stringify(entry) + \")\") : void 0;\n return location;\n });\n var index = clamp(initialIndex == null ? entries.length - 1 : initialIndex, 0, entries.length - 1);\n var action = Action.Pop;\n var location = entries[index];\n var listeners = createEvents();\n var blockers = createEvents();\n\n function createHref(to) {\n return typeof to === 'string' ? to : createPath(to);\n }\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n search: '',\n hash: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction, nextLocation) {\n action = nextAction;\n location = nextLocation;\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in memory history.push(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n index += 1;\n entries.splice(index, entries.length, nextLocation);\n applyTx(nextAction, nextLocation);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in memory history.replace(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n entries[index] = nextLocation;\n applyTx(nextAction, nextLocation);\n }\n }\n\n function go(delta) {\n var nextIndex = clamp(index + delta, 0, entries.length - 1);\n var nextAction = Action.Pop;\n var nextLocation = entries[nextIndex];\n\n function retry() {\n go(delta);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n index = nextIndex;\n applyTx(nextAction, nextLocation);\n }\n }\n\n var history = {\n get index() {\n return index;\n },\n\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n return blockers.push(blocker);\n }\n };\n return history;\n} ////////////////////////////////////////////////////////////////////////////////\n// UTILS\n////////////////////////////////////////////////////////////////////////////////\n\nfunction clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n}\n\nfunction promptBeforeUnload(event) {\n // Cancel the event.\n event.preventDefault(); // Chrome (and legacy IE) requires returnValue to be set.\n\n event.returnValue = '';\n}\n\nfunction createEvents() {\n var handlers = [];\n return {\n get length() {\n return handlers.length;\n },\n\n push: function push(fn) {\n handlers.push(fn);\n return function () {\n handlers = handlers.filter(function (handler) {\n return handler !== fn;\n });\n };\n },\n call: function call(arg) {\n handlers.forEach(function (fn) {\n return fn && fn(arg);\n });\n }\n };\n}\n\nfunction createKey() {\n return Math.random().toString(36).substr(2, 8);\n}\n/**\r\n * Creates a string URL path from the given pathname, search, and hash components.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createpath\r\n */\n\n\nfunction createPath(_ref) {\n var _ref$pathname = _ref.pathname,\n pathname = _ref$pathname === void 0 ? '/' : _ref$pathname,\n _ref$search = _ref.search,\n search = _ref$search === void 0 ? '' : _ref$search,\n _ref$hash = _ref.hash,\n hash = _ref$hash === void 0 ? '' : _ref$hash;\n if (search && search !== '?') pathname += search.charAt(0) === '?' ? search : '?' + search;\n if (hash && hash !== '#') pathname += hash.charAt(0) === '#' ? hash : '#' + hash;\n return pathname;\n}\n/**\r\n * Parses a string URL path into its separate pathname, search, and hash components.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#parsepath\r\n */\n\nfunction parsePath(path) {\n var parsedPath = {};\n\n if (path) {\n var hashIndex = path.indexOf('#');\n\n if (hashIndex >= 0) {\n parsedPath.hash = path.substr(hashIndex);\n path = path.substr(0, hashIndex);\n }\n\n var searchIndex = path.indexOf('?');\n\n if (searchIndex >= 0) {\n parsedPath.search = path.substr(searchIndex);\n path = path.substr(0, searchIndex);\n }\n\n if (path) {\n parsedPath.pathname = path;\n }\n }\n\n return parsedPath;\n}\n\nexport { Action, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, parsePath };\n//# sourceMappingURL=index.js.map\n","\nimport type { IRoute } from '../parser/IRoute'\nimport { hydrate } from 'svelte'\nimport RecursiveLoader from '../components/RecursiveRender.svelte'\nimport { createBrowserHistory } from 'history';\nimport { FORGE_LOAD_SYMBOL } from './client';\nimport {page} from \"./page.svelte\";\n\nconst history = createBrowserHistory()\n\nconst ROOT = $state({\n layouts: [] as any[],\n view: null,\n data: null as any,\n params: null,\n urlParams: null as any,\n query: null as any,\n page\n})\n\nfunction urlJoin(...parts) {\n let url = parts\n .map((part, i) => {\n if (i === 0) return part.replace(/\\/+$/, ''); // trim trailing slash\n return part.replace(/^\\/+|\\/+$/g, ''); // trim both for middle parts\n })\n .join('/');\n\n if (!url.startsWith('/')) {\n url = '/' + url; // add leading slash if not present\n }\n return url.split('?')[0]; // remove query string\n}\n\nexport async function loadRoute(node:any,base_path:string, route: IRoute, combinedParams: any, urlParams:any, query:any) {\n try {\n // When serving precompiled client bundles (assets), resolve to .js files\n const useCompiledClient = typeof base_path === 'string' && base_path.indexOf('assets') !== -1;\n\n const layouts_paths = (route.layout || []).map(layout => {\n let p = urlJoin(base_path,layout).toString();\n if (useCompiledClient) {\n p = p.endsWith('.svelte') ? p.replace(/\\.svelte$/, '.js') : (/[.][a-z]+$/.test(p) ? p : p + '.js');\n }\n return p;\n })\n let view_path = urlJoin(base_path,route.view).toString()\n if (useCompiledClient) {\n view_path = view_path.endsWith('.svelte') ? view_path.replace(/\\.svelte$/, '.js') : (/[.][a-z]+$/.test(view_path) ? view_path : view_path + '.js');\n }\n\n\n const layouts = await Promise.all(layouts_paths.map((layout) => {\n return import(/* @vite-ignore */ layout).then(layout => {\n return layout.default\n })\n }))\n\n if (!view_path.startsWith('/')){\n view_path = '/'+view_path\n }\n const view = await import(/* @vite-ignore */ view_path).then(view => {\n return view.default\n })\n\n ROOT.layouts = layouts\n ROOT.view = view\n ROOT.params = combinedParams\n ROOT.data = (window as any).__INITIAL_DATA__\n ROOT.urlParams = urlParams\n ROOT.query = query\n\n hydrate(RecursiveLoader, {\n target: node,\n props: ROOT,\n })\n } catch (error) {\n console.error('Client-side route loading failed:', error);\n // Don't trigger a reload - let SSR-rendered content remain\n // The page is already rendered by the server, just log the error\n }\n}\n\n\n\nexport async function updateRoute(url:string,base_path:string, route: IRoute, params: any,urlParams:any,query:any,server_loading:boolean = false,update = true) {\n try {\n const useCompiledClient = typeof base_path === 'string' && base_path.indexOf('assets') !== -1;\n const layouts_paths = (route.layout || []).map(layout => {\n let p = urlJoin(base_path,layout).toString();\n if (useCompiledClient) {\n p = p.endsWith('.svelte') ? p.replace(/\\.svelte$/, '.js') : (/[.][a-z]+$/.test(p) ? p : p + '.js');\n }\n return p;\n })\n let view_path = urlJoin(base_path,route.view).toString()\n if (useCompiledClient) {\n view_path = view_path.endsWith('.svelte') ? view_path.replace(/\\.svelte$/, '.js') : (/[.][a-z]+$/.test(view_path) ? view_path : view_path + '.js');\n }\n const layouts = await Promise.all(layouts_paths.map((layout) => {\n return import(/* @vite-ignore */ layout).then(layout => {\n return layout.default\n })\n }))\n const view = await import(/* @vite-ignore */ view_path).then(view => {\n return view.default\n })\n\n if (server_loading) {\n const fetchOptions: any = {\n method: route.method,\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n }\n };\n fetchOptions[FORGE_LOAD_SYMBOL] = true;\n \n await fetch(url, fetchOptions).then((response) => {\n if (response.ok) {\n return response.json()\n } else {\n throw new Error('Network response was not ok')\n }\n }).then((data)=>{\n \n // The server returns structured data: { layout: [...], view: {...} }\n // We need to pass this structure to RecursiveRender correctly\n ROOT.data = data\n ROOT.params = params\n ROOT.layouts = layouts\n ROOT.view = view\n ROOT.urlParams = urlParams\n ROOT.query = query\n })\n }else{\n ROOT.data = {layout:[],view:{}}\n ROOT.params = params\n ROOT.layouts = layouts\n ROOT.view = view\n ROOT.urlParams = urlParams\n ROOT.query = query\n }\n if(window){\n window.scroll(0,0)\n }\n\n if(update){\n history.push(url)\n }\n } catch (error) {\n console.error('Client-side navigation failed for URL:', url, error);\n // Don't trigger a reload - let current page state remain\n }\n}\n","\n\n\nexport const MANIFEST_STORE = $state({})\n\n\n\nexport async function updateManifestStore() {\n Object.assign(MANIFEST_STORE, window['__MANIFEST__'])\n // await fetch('/manifest.json')\n // .then(async (response) => {\n // if (response.ok) {\n // const manifest = await response.json();\n // console.log(manifest)\n // Object.assign(MANIFEST_STORE, manifest);\n // }\n // })\n}","\n\nimport type {IRoute} from \"../parser/IRoute\";\nimport type { UrlMatcher } from \"../routing/url_parser\";\nimport { updateRoute } from \"./navigation.svelte\";\nimport { MANIFEST_STORE } from \"../routing/manifest/store.svelte\";\nimport {page} from './page.svelte'\n\n\n\n\nexport function bootstrap_events(base_path:string,routes:IRoute[], matchers: UrlMatcher[]) {\n if(!document){\n console.error('Document not found')\n return\n }\n\n document.addEventListener('click', (event:any) => {\n const currentUrl = window.location.pathname;\n const a = event.target?.tagName === 'A' ? event.target : event.target?.closest('A');\n \n if (a) {\n let url = a.getAttribute('href');\n if (currentUrl === url) {\n event.preventDefault();\n return;\n }\n if (url && url.startsWith('/') || url.startsWith('.')) {\n const pathname = url.split('?')[0];\n const method = a.getAttribute('method') || 'get';\n const route = routes.find(r => r.method.toLowerCase() === method && matchers.find(m => m.parser(pathname) && m.pattern === r.path));\n if (route) {\n event.preventDefault();\n const m = matchers.find(m => m.parser(pathname) && m.pattern === route.path);\n const params = m?.parser(pathname) || {};\n // Parse query parameters and combine with path parameters\n const urlParams = new URLSearchParams(url.split('?')[1] || '');\n const queryParams = Object.fromEntries(urlParams.entries()) || {};\n const combinedParams = { ...params, ...queryParams };\n const requires_server_data = MANIFEST_STORE[m?.pattern as string]\n updateRoute(url,base_path, route, combinedParams,params,queryParams,requires_server_data);\n } else {\n console.log('No matching route found for URL:', url, '- using fallback navigation');\n // Fallback: Don't prevent default, let browser handle the navigation\n // This will trigger a full page load that the server can handle\n }\n }\n }\n });\n\n\n window.addEventListener('popstate', (_) => {\n const path = window.location.pathname;\n const fullUrl = window.location.pathname + window.location.search;\n // update page data\n page.url = fullUrl\n page.pathname = window.location.pathname\n const method = 'get';\n const route = routes.find(r => r.method.toLowerCase() === method && matchers.find(m => m.parser(path) && m.pattern === r.path));\n if (route) {\n const m = matchers.find(m => m.parser(path) && m.pattern === route.path);\n const params = m?.parser(path) || {};\n // Parse query parameters and combine with path parameters\n const urlParams = new URLSearchParams(window.location.search);\n const queryParams = Object.fromEntries(urlParams.entries()) || {};\n\n // Object.assign(page.params,params)\n page.params = params\n page.query = queryParams\n\n const combinedParams = { ...params, ...queryParams };\n const requires_server_data = MANIFEST_STORE[m?.pattern as string]\n updateRoute(fullUrl,base_path, route, combinedParams,params,queryParams,requires_server_data,false);\n } else {\n console.log('No matching route found for popstate navigation to:', path, '- using fallback navigation');\n // Fallback: Trigger full page reload for unknown routes\n window.location.href = path;\n }\n });\n\n\n // Run this once in your bootstrap code\n (function () {\n const originalPushState = history.pushState;\n const originalReplaceState = history.replaceState;\n\n history.pushState = function (...args) {\n const result = originalPushState.apply(this, args);\n const evt= new Event('pushstate')\n evt['state'] = args[0]\n evt['url'] = args[2]\n window.dispatchEvent(evt);\n return result;\n };\n\n\n history.replaceState = function (...args) {\n const result = originalReplaceState.apply(this, args);\n \n // Only trigger navigation if pathname actually changes\n const newUrl = args[2];\n const currentPathname = window.location.pathname;\n const newPathname = newUrl ? new URL(newUrl, window.location.origin).pathname : currentPathname;\n \n if (newPathname !== currentPathname) {\n const evt= new Event('replacestate')\n evt['state'] = args[0]\n evt['url'] = args[2]\n window.dispatchEvent(evt);\n }\n \n return result;\n }\n // Add a listener to the popstate event\n })();\n\n window.addEventListener('pushstate', (event) => {\n const fullPath = event['url'] || window.location.pathname + window.location.search;\n const path = fullPath.split('?')[0];\n const method = 'get';\n const route = routes.find(r => r.method.toLowerCase() === method && matchers.find(m => m.parser(path) && m.pattern === r.path));\n if (route) {\n const m = matchers.find(m => m.parser(path) && m.pattern === route.path);\n const params = m?.parser(path);\n\n // Parse query parameters and combine with path parameters\n const urlParams = new URLSearchParams(fullPath.split('?')[1] || '');\n const queryParams = Object.fromEntries(urlParams.entries());\n \n page.url = fullPath\n page.pathname = window.location.pathname\n Object.assign(page.params,params)\n Object.assign(page.query,queryParams)\n\n const combinedParams = { ...params, ...queryParams };\n const requires_server_data = MANIFEST_STORE[m?.pattern as string]\n updateRoute(fullPath,base_path, route, combinedParams,params,queryParams,requires_server_data,false);\n } else {\n console.log('No matching route found for pushstate to:', path, '- using fallback navigation');\n // Fallback: Use full page navigation for unknown routes\n window.location.href = path;\n }\n });\n\n window.addEventListener('replacestate', (event) => {\n const fullPath = event['url'] || window.location.pathname + window.location.search;\n const path = fullPath.split('?')[0];\n\n // update page data\n page.url = fullPath\n page.pathname = window.location.pathname\n page.query = Object.fromEntries(new URLSearchParams(fullPath.split('?')[1] || ''))\n\n const method = 'get';\n const route = routes.find(r => r.method.toLowerCase() === method && matchers.find(m => m.parser(path) && m.pattern === r.path));\n if (route) {\n const m = matchers.find(m => m.parser(path) && m.pattern === route.path);\n const params = m?.parser(path) || {};\n // Parse query parameters and combine with path parameters\n const urlParams = new URLSearchParams(fullPath.split('?')[1] || '');\n const queryParams = Object.fromEntries(urlParams.entries()) || {};\n const combinedParams = { ...params, ...queryParams };\n const requires_server_data = MANIFEST_STORE[m?.pattern as string]\n updateRoute(fullPath,base_path, route, combinedParams,params,queryParams,requires_server_data,false);\n } else {\n console.log('No matching route found for replacestate to:', path, '- using fallback navigation');\n // Fallback: Use full page navigation for unknown routes\n window.location.href = path;\n }\n });\n \n}\n","import { initialize_route_matchers } from '../routing/url_parser';\nimport { loadRoute } from './navigation.svelte';\nimport { bootstrap_events } from './events';\nimport { updateManifestStore } from '../routing/manifest/store.svelte';\nimport type { ServerOptions } from '../options/ServerOptions';\nimport type { FetchMiddleware, FetchMiddlewareAPI, HeadersObject, AsyncMiddleware, CallbackMiddleware } from '../types/FetchMiddleware';\n\n// Symbol for marking load function fetches\nexport const FORGE_LOAD_SYMBOL = Symbol('forge-load-function');\n\n// Middleware storage\nlet middlewares: Array<FetchMiddleware> = [];\nlet originalFetch: typeof window.fetch | null = null;\n\n// Helper to determine if a URL is an internal route\nfunction isInternalRoute(url: string): boolean {\n try {\n const urlObj = new URL(url, window.location.origin);\n return urlObj.origin === window.location.origin && !urlObj.pathname.startsWith('/api/');\n } catch {\n // Relative URL, assume internal\n return !url.startsWith('/api/');\n }\n}\n\n// Initialize fetch override immediately when module is imported\nfunction initializeFetch(): void {\n if (typeof window !== 'undefined' && !originalFetch) {\n originalFetch = window.fetch;\n\n window.fetch = async function(input: RequestInfo | URL, init: RequestInit = {}): Promise<Response> {\n // Start with the original init\n let currentInit: RequestInit = { ...init };\n\n // Run all configured middleware\n for (const middleware of middlewares) {\n try {\n if (middleware.length === 2) {\n // Callback style (legacy): (headers, next) => {}\n // Convert headers for middleware\n const headers = new Headers(currentInit.headers);\n const headersObject: HeadersObject = Object.fromEntries(headers.entries());\n\n await new Promise<void>((resolve, reject) => {\n try {\n (middleware as any)(headersObject, (error?: any) => {\n if (error) {\n reject(error);\n } else {\n // Convert headers back\n const finalHeaders = new Headers();\n Object.entries(headersObject).forEach(([key, value]) => {\n if (value !== undefined) {\n finalHeaders.set(key, value);\n }\n });\n currentInit.headers = finalHeaders;\n resolve();\n }\n });\n } catch (error) {\n reject(error);\n }\n });\n } else {\n // New style middleware (returns RequestInit)\n const result = await (middleware as any)(currentInit, input);\n\n if (result && typeof result === 'object') {\n // Middleware returned a value - use it as new RequestInit\n currentInit = result;\n }\n }\n } catch (error) {\n console.error('🔴 Middleware error:', error);\n throw error;\n }\n }\n\n // Make the actual request\n const response = await originalFetch!(input, currentInit);\n\n // Handle frontend route redirects\n if (response.status >= 300 && response.status < 400 && (init as any)[FORGE_LOAD_SYMBOL]) {\n const location = response.headers.get('location');\n if (location && isInternalRoute(location)) {\n // For internal routes, let the browser handle the redirect\n window.location.href = location;\n return response;\n }\n }\n\n return response;\n };\n }\n}\n\n// Initialize fetch override immediately\ninitializeFetch();\n\n// Export fetch API with middleware configuration\nexport const fetch: FetchMiddlewareAPI & { getMiddlewareCount(): number } = {\n /**\n * Add middleware to the fetch pipeline\n */\n configUpdate(middleware: FetchMiddleware): void {\n if (typeof middleware !== 'function') {\n throw new Error('Middleware must be a function');\n }\n middlewares.push(middleware);\n },\n \n /**\n * Reset all middleware\n */\n reset(): void {\n middlewares.length = 0;\n },\n \n /**\n * Get current middleware count (for debugging)\n */\n getMiddlewareCount(): number {\n return middlewares.length;\n }\n};\n\nlet routing;\n\nexport async function createApp<T extends HTMLElement = HTMLElement>(\n node: T,\n options: ServerOptions\n): Promise<void> {\n\n // Use server-injected component directory if available, otherwise fall back to options\n let base_path = window['__COMPONENT_DIR__'] || options.component_dir\n\n if(!base_path && typeof base_path !== 'string') {\n throw new Error('No component directory provided');\n }\n let routes = window['__ROUTING__']\n routing = initialize_route_matchers(routes)\n\n if (window && window.location) {\n const application_url = (window.location.pathname || '/').split('?')[0];\n const needle = routing.find(r => r.parser(application_url));\n let route = needle ? routes.find(r => r.path === needle.pattern) : null;\n if (needle && route) {\n const params = needle.parser(application_url) ||{};\n // Parse query parameters and combine with path parameters\n const urlParams = new URLSearchParams(window.location.search);\n const queryParams = Object.fromEntries(urlParams.entries()) || {};\n const combinedParams = { ...params, ...queryParams };\n updateManifestStore()\n loadRoute(node, base_path, route, combinedParams,params, queryParams);\n bootstrap_events(base_path, routes, routing);\n } else {\n console.warn('No matching route found for:', application_url);\n // No route found - let SSR-rendered content remain\n // The page is already rendered by the server\n }\n\n }\n}\n\n\n"],"names":["makeUrlParser","pattern","parser","pathToRegex","pathname","initialize_route_matchers","routes","route","_extends","n","e","t","Action","readOnly","obj","warning","cond","message","BeforeUnloadEventType","PopStateEventType","createBrowserHistory","options","_options","_options$window","window","globalHistory","getIndexAndLocation","_window$location","search","hash","state","blockedPopTx","handlePop","blockers","nextAction","_getIndexAndLocation","nextIndex","nextLocation","delta","index","go","applyTx","action","_getIndexAndLocation2","location","listeners","createEvents","createHref","to","createPath","getNextLocation","parsePath","createKey","getHistoryStateAndUrl","allowTx","retry","_getIndexAndLocation3","push","_getHistoryStateAndUr","historyState","url","replace","_getHistoryStateAndUr2","history","listener","blocker","unblock","promptBeforeUnload","event","handlers","fn","handler","arg","_ref","_ref$pathname","_ref$search","_ref$hash","path","parsedPath","hashIndex","searchIndex","ROOT","page","urlJoin","parts","part","i","loadRoute","node","base_path","combinedParams","urlParams","query","useCompiledClient","layouts_paths","layout","view_path","layouts","view","hydrate","RecursiveLoader","error","updateRoute","params","server_loading","update","p","fetchOptions","FORGE_LOAD_SYMBOL","response","data","MANIFEST_STORE","$","updateManifestStore","bootstrap_events","matchers","currentUrl","a","_a","_b","method","r","m","queryParams","requires_server_data","_","fullUrl","originalPushState","originalReplaceState","args","result","evt","newUrl","currentPathname","fullPath","middlewares","originalFetch","isInternalRoute","urlObj","initializeFetch","input","init","currentInit","middleware","headers","headersObject","resolve","reject","finalHeaders","key","value","fetch","routing","createApp","application_url","needle"],"mappings":"sgBAKO,SAASA,GAAcC,EAAiB,CACvC,MAAAC,EAAS,IAAIC,EAAA,cAAYF,CAAO,EACtC,OAAQG,GACSF,EAAO,MAAME,CAAQ,GACnB,IAErB,CAsBO,SAASC,GAA0BC,EAAgC,CACjE,OAAAA,EAAO,IAAKC,GAAkB,CACnC,MAAMN,EAAUM,EAAM,KAChBL,EAASF,GAAcC,CAAO,EAC7B,MAAA,CAAE,QAAAA,EAAS,OAAAC,CAAO,CAAA,CAC1B,CACH,CCvCA,SAASM,GAAW,CAClB,OAAOA,EAAW,OAAO,OAAS,OAAO,OAAO,KAAI,EAAK,SAAUC,EAAG,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/url_parser.ts","../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/history/index.js","../src/client/navigation.svelte.ts","../src/routing/manifest/store.svelte.ts","../src/client/events.ts","../src/client/client.ts"],"sourcesContent":["import pathToRegex from 'path-to-regex';\nimport type { IRoute } from '../parser/IRoute';\n\n\n\nexport function makeUrlParser(pattern: string) {\n const parser = new pathToRegex(pattern);\n return (pathname: string) => {\n const result = parser.match(pathname);\n return result || null;\n };\n}\n\n\nexport type UrlMatcher = {\n pattern: string,\n parser: ReturnType<typeof makeUrlParser>\n}\n\nexport function findRoute(pathname:string, routes: UrlMatcher[]) {\n for (const { pattern, parser } of routes) {\n const params = parser(pathname);\n if (params) {\n return { pattern, params };\n }\n }\n return null;\n}\n\n\n\n\n\nexport function initialize_route_matchers(routes: IRoute[]): UrlMatcher[] {\n return routes.map((route: IRoute) => {\n const pattern = route.path;\n const parser = makeUrlParser(pattern);\n return { pattern, parser };\n })\n}\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import _extends from '@babel/runtime/helpers/esm/extends';\n\n/**\r\n * Actions represent the type of change to a location value.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#action\r\n */\nvar Action;\n\n(function (Action) {\n /**\r\n * A POP indicates a change to an arbitrary index in the history stack, such\r\n * as a back or forward navigation. It does not describe the direction of the\r\n * navigation, only that the current index changed.\r\n *\r\n * Note: This is the default action for newly created history objects.\r\n */\n Action[\"Pop\"] = \"POP\";\n /**\r\n * A PUSH indicates a new entry being added to the history stack, such as when\r\n * a link is clicked and a new page loads. When this happens, all subsequent\r\n * entries in the stack are lost.\r\n */\n\n Action[\"Push\"] = \"PUSH\";\n /**\r\n * A REPLACE indicates the entry at the current index in the history stack\r\n * being replaced by a new one.\r\n */\n\n Action[\"Replace\"] = \"REPLACE\";\n})(Action || (Action = {}));\n\nvar readOnly = process.env.NODE_ENV !== \"production\" ? function (obj) {\n return Object.freeze(obj);\n} : function (obj) {\n return obj;\n};\n\nfunction warning(cond, message) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== 'undefined') console.warn(message);\n\n try {\n // Welcome to debugging history!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message); // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\nvar BeforeUnloadEventType = 'beforeunload';\nvar HashChangeEventType = 'hashchange';\nvar PopStateEventType = 'popstate';\n/**\r\n * Browser history stores the location in regular URLs. This is the standard for\r\n * most web apps, but it requires some configuration on the server to ensure you\r\n * serve the same app at multiple URLs.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\r\n */\n\nfunction createBrowserHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$window = _options.window,\n window = _options$window === void 0 ? document.defaultView : _options$window;\n var globalHistory = window.history;\n\n function getIndexAndLocation() {\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var state = globalHistory.state || {};\n return [state.idx, readOnly({\n pathname: pathname,\n search: search,\n hash: hash,\n state: state.usr || null,\n key: state.key || 'default'\n })];\n }\n\n var blockedPopTx = null;\n\n function handlePop() {\n if (blockedPopTx) {\n blockers.call(blockedPopTx);\n blockedPopTx = null;\n } else {\n var nextAction = Action.Pop;\n\n var _getIndexAndLocation = getIndexAndLocation(),\n nextIndex = _getIndexAndLocation[0],\n nextLocation = _getIndexAndLocation[1];\n\n if (blockers.length) {\n if (nextIndex != null) {\n var delta = index - nextIndex;\n\n if (delta) {\n // Revert the POP\n blockedPopTx = {\n action: nextAction,\n location: nextLocation,\n retry: function retry() {\n go(delta * -1);\n }\n };\n go(delta);\n }\n } else {\n // Trying to POP to a location with no index. We did not create\n // this location, so we can't effectively block the navigation.\n process.env.NODE_ENV !== \"production\" ? warning(false, // TODO: Write up a doc that explains our blocking strategy in\n // detail and link to it here so people can understand better what\n // is going on and how to avoid it.\n \"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.\") : void 0;\n }\n } else {\n applyTx(nextAction);\n }\n }\n }\n\n window.addEventListener(PopStateEventType, handlePop);\n var action = Action.Pop;\n\n var _getIndexAndLocation2 = getIndexAndLocation(),\n index = _getIndexAndLocation2[0],\n location = _getIndexAndLocation2[1];\n\n var listeners = createEvents();\n var blockers = createEvents();\n\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), '');\n }\n\n function createHref(to) {\n return typeof to === 'string' ? to : createPath(to);\n } // state defaults to `null` because `window.history.state` does\n\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n hash: '',\n search: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function getHistoryStateAndUrl(nextLocation, index) {\n return [{\n usr: nextLocation.state,\n key: nextLocation.key,\n idx: index\n }, createHref(nextLocation)];\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction) {\n action = nextAction;\n\n var _getIndexAndLocation3 = getIndexAndLocation();\n\n index = _getIndexAndLocation3[0];\n location = _getIndexAndLocation3[1];\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr = getHistoryStateAndUrl(nextLocation, index + 1),\n historyState = _getHistoryStateAndUr[0],\n url = _getHistoryStateAndUr[1]; // TODO: Support forced reloading\n // try...catch because iOS limits us to 100 pushState calls :/\n\n\n try {\n globalHistory.pushState(historyState, '', url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n applyTx(nextAction);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr2 = getHistoryStateAndUrl(nextLocation, index),\n historyState = _getHistoryStateAndUr2[0],\n url = _getHistoryStateAndUr2[1]; // TODO: Support forced reloading\n\n\n globalHistory.replaceState(historyState, '', url);\n applyTx(nextAction);\n }\n }\n\n function go(delta) {\n globalHistory.go(delta);\n }\n\n var history = {\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n var unblock = blockers.push(blocker);\n\n if (blockers.length === 1) {\n window.addEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n\n return function () {\n unblock(); // Remove the beforeunload listener so the document may\n // still be salvageable in the pagehide event.\n // See https://html.spec.whatwg.org/#unloading-documents\n\n if (!blockers.length) {\n window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n };\n }\n };\n return history;\n}\n/**\r\n * Hash history stores the location in window.location.hash. This makes it ideal\r\n * for situations where you don't want to send the location to the server for\r\n * some reason, either because you do cannot configure it or the URL space is\r\n * reserved for something else.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\r\n */\n\nfunction createHashHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options2 = options,\n _options2$window = _options2.window,\n window = _options2$window === void 0 ? document.defaultView : _options2$window;\n var globalHistory = window.history;\n\n function getIndexAndLocation() {\n var _parsePath = parsePath(window.location.hash.substr(1)),\n _parsePath$pathname = _parsePath.pathname,\n pathname = _parsePath$pathname === void 0 ? '/' : _parsePath$pathname,\n _parsePath$search = _parsePath.search,\n search = _parsePath$search === void 0 ? '' : _parsePath$search,\n _parsePath$hash = _parsePath.hash,\n hash = _parsePath$hash === void 0 ? '' : _parsePath$hash;\n\n var state = globalHistory.state || {};\n return [state.idx, readOnly({\n pathname: pathname,\n search: search,\n hash: hash,\n state: state.usr || null,\n key: state.key || 'default'\n })];\n }\n\n var blockedPopTx = null;\n\n function handlePop() {\n if (blockedPopTx) {\n blockers.call(blockedPopTx);\n blockedPopTx = null;\n } else {\n var nextAction = Action.Pop;\n\n var _getIndexAndLocation4 = getIndexAndLocation(),\n nextIndex = _getIndexAndLocation4[0],\n nextLocation = _getIndexAndLocation4[1];\n\n if (blockers.length) {\n if (nextIndex != null) {\n var delta = index - nextIndex;\n\n if (delta) {\n // Revert the POP\n blockedPopTx = {\n action: nextAction,\n location: nextLocation,\n retry: function retry() {\n go(delta * -1);\n }\n };\n go(delta);\n }\n } else {\n // Trying to POP to a location with no index. We did not create\n // this location, so we can't effectively block the navigation.\n process.env.NODE_ENV !== \"production\" ? warning(false, // TODO: Write up a doc that explains our blocking strategy in\n // detail and link to it here so people can understand better\n // what is going on and how to avoid it.\n \"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.\") : void 0;\n }\n } else {\n applyTx(nextAction);\n }\n }\n }\n\n window.addEventListener(PopStateEventType, handlePop); // popstate does not fire on hashchange in IE 11 and old (trident) Edge\n // https://developer.mozilla.org/de/docs/Web/API/Window/popstate_event\n\n window.addEventListener(HashChangeEventType, function () {\n var _getIndexAndLocation5 = getIndexAndLocation(),\n nextLocation = _getIndexAndLocation5[1]; // Ignore extraneous hashchange events.\n\n\n if (createPath(nextLocation) !== createPath(location)) {\n handlePop();\n }\n });\n var action = Action.Pop;\n\n var _getIndexAndLocation6 = getIndexAndLocation(),\n index = _getIndexAndLocation6[0],\n location = _getIndexAndLocation6[1];\n\n var listeners = createEvents();\n var blockers = createEvents();\n\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), '');\n }\n\n function getBaseHref() {\n var base = document.querySelector('base');\n var href = '';\n\n if (base && base.getAttribute('href')) {\n var url = window.location.href;\n var hashIndex = url.indexOf('#');\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n\n return href;\n }\n\n function createHref(to) {\n return getBaseHref() + '#' + (typeof to === 'string' ? to : createPath(to));\n }\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n hash: '',\n search: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function getHistoryStateAndUrl(nextLocation, index) {\n return [{\n usr: nextLocation.state,\n key: nextLocation.key,\n idx: index\n }, createHref(nextLocation)];\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction) {\n action = nextAction;\n\n var _getIndexAndLocation7 = getIndexAndLocation();\n\n index = _getIndexAndLocation7[0];\n location = _getIndexAndLocation7[1];\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(nextLocation.pathname.charAt(0) === '/', \"Relative pathnames are not supported in hash history.push(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr3 = getHistoryStateAndUrl(nextLocation, index + 1),\n historyState = _getHistoryStateAndUr3[0],\n url = _getHistoryStateAndUr3[1]; // TODO: Support forced reloading\n // try...catch because iOS limits us to 100 pushState calls :/\n\n\n try {\n globalHistory.pushState(historyState, '', url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n applyTx(nextAction);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(nextLocation.pathname.charAt(0) === '/', \"Relative pathnames are not supported in hash history.replace(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr4 = getHistoryStateAndUrl(nextLocation, index),\n historyState = _getHistoryStateAndUr4[0],\n url = _getHistoryStateAndUr4[1]; // TODO: Support forced reloading\n\n\n globalHistory.replaceState(historyState, '', url);\n applyTx(nextAction);\n }\n }\n\n function go(delta) {\n globalHistory.go(delta);\n }\n\n var history = {\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n var unblock = blockers.push(blocker);\n\n if (blockers.length === 1) {\n window.addEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n\n return function () {\n unblock(); // Remove the beforeunload listener so the document may\n // still be salvageable in the pagehide event.\n // See https://html.spec.whatwg.org/#unloading-documents\n\n if (!blockers.length) {\n window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n };\n }\n };\n return history;\n}\n/**\r\n * Memory history stores the current location in memory. It is designed for use\r\n * in stateful non-browser environments like tests and React Native.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#creatememoryhistory\r\n */\n\nfunction createMemoryHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options3 = options,\n _options3$initialEntr = _options3.initialEntries,\n initialEntries = _options3$initialEntr === void 0 ? ['/'] : _options3$initialEntr,\n initialIndex = _options3.initialIndex;\n var entries = initialEntries.map(function (entry) {\n var location = readOnly(_extends({\n pathname: '/',\n search: '',\n hash: '',\n state: null,\n key: createKey()\n }, typeof entry === 'string' ? parsePath(entry) : entry));\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: \" + JSON.stringify(entry) + \")\") : void 0;\n return location;\n });\n var index = clamp(initialIndex == null ? entries.length - 1 : initialIndex, 0, entries.length - 1);\n var action = Action.Pop;\n var location = entries[index];\n var listeners = createEvents();\n var blockers = createEvents();\n\n function createHref(to) {\n return typeof to === 'string' ? to : createPath(to);\n }\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n search: '',\n hash: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction, nextLocation) {\n action = nextAction;\n location = nextLocation;\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in memory history.push(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n index += 1;\n entries.splice(index, entries.length, nextLocation);\n applyTx(nextAction, nextLocation);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in memory history.replace(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n entries[index] = nextLocation;\n applyTx(nextAction, nextLocation);\n }\n }\n\n function go(delta) {\n var nextIndex = clamp(index + delta, 0, entries.length - 1);\n var nextAction = Action.Pop;\n var nextLocation = entries[nextIndex];\n\n function retry() {\n go(delta);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n index = nextIndex;\n applyTx(nextAction, nextLocation);\n }\n }\n\n var history = {\n get index() {\n return index;\n },\n\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n return blockers.push(blocker);\n }\n };\n return history;\n} ////////////////////////////////////////////////////////////////////////////////\n// UTILS\n////////////////////////////////////////////////////////////////////////////////\n\nfunction clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n}\n\nfunction promptBeforeUnload(event) {\n // Cancel the event.\n event.preventDefault(); // Chrome (and legacy IE) requires returnValue to be set.\n\n event.returnValue = '';\n}\n\nfunction createEvents() {\n var handlers = [];\n return {\n get length() {\n return handlers.length;\n },\n\n push: function push(fn) {\n handlers.push(fn);\n return function () {\n handlers = handlers.filter(function (handler) {\n return handler !== fn;\n });\n };\n },\n call: function call(arg) {\n handlers.forEach(function (fn) {\n return fn && fn(arg);\n });\n }\n };\n}\n\nfunction createKey() {\n return Math.random().toString(36).substr(2, 8);\n}\n/**\r\n * Creates a string URL path from the given pathname, search, and hash components.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createpath\r\n */\n\n\nfunction createPath(_ref) {\n var _ref$pathname = _ref.pathname,\n pathname = _ref$pathname === void 0 ? '/' : _ref$pathname,\n _ref$search = _ref.search,\n search = _ref$search === void 0 ? '' : _ref$search,\n _ref$hash = _ref.hash,\n hash = _ref$hash === void 0 ? '' : _ref$hash;\n if (search && search !== '?') pathname += search.charAt(0) === '?' ? search : '?' + search;\n if (hash && hash !== '#') pathname += hash.charAt(0) === '#' ? hash : '#' + hash;\n return pathname;\n}\n/**\r\n * Parses a string URL path into its separate pathname, search, and hash components.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#parsepath\r\n */\n\nfunction parsePath(path) {\n var parsedPath = {};\n\n if (path) {\n var hashIndex = path.indexOf('#');\n\n if (hashIndex >= 0) {\n parsedPath.hash = path.substr(hashIndex);\n path = path.substr(0, hashIndex);\n }\n\n var searchIndex = path.indexOf('?');\n\n if (searchIndex >= 0) {\n parsedPath.search = path.substr(searchIndex);\n path = path.substr(0, searchIndex);\n }\n\n if (path) {\n parsedPath.pathname = path;\n }\n }\n\n return parsedPath;\n}\n\nexport { Action, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, parsePath };\n//# sourceMappingURL=index.js.map\n","\nimport type { IRoute } from '../parser/IRoute'\nimport { hydrate } from 'svelte'\nimport RecursiveLoader from '../components/RecursiveRender.svelte'\nimport { createBrowserHistory } from 'history';\nimport { FORGE_LOAD_SYMBOL } from './client';\nimport {page} from \"./page.svelte\";\n\nconst history = createBrowserHistory()\n\nconst ROOT = $state({\n layouts: [] as any[],\n view: null,\n data: null as any,\n params: null,\n urlParams: null as any,\n query: null as any,\n page\n})\n\nfunction urlJoin(...parts) {\n let url = parts\n .map((part, i) => {\n if (i === 0) return part.replace(/\\/+$/, ''); // trim trailing slash\n return part.replace(/^\\/+|\\/+$/g, ''); // trim both for middle parts\n })\n .join('/');\n\n if (!url.startsWith('/')) {\n url = '/' + url; // add leading slash if not present\n }\n return url.split('?')[0]; // remove query string\n}\n\nexport async function loadRoute(node:any,base_path:string, route: IRoute, combinedParams: any, urlParams:any, query:any) {\n try {\n // When serving precompiled client bundles (assets), resolve to .js files\n const useCompiledClient = typeof base_path === 'string' && base_path.indexOf('assets') !== -1;\n\n const layouts_paths = (route.layout || []).map(layout => {\n let p = urlJoin(base_path,layout).toString();\n if (useCompiledClient) {\n p = p.endsWith('.svelte') ? p.replace(/\\.svelte$/, '.js') : (/[.][a-z]+$/.test(p) ? p : p + '.js');\n }\n return p;\n })\n let view_path = urlJoin(base_path,route.view).toString()\n if (useCompiledClient) {\n view_path = view_path.endsWith('.svelte') ? view_path.replace(/\\.svelte$/, '.js') : (/[.][a-z]+$/.test(view_path) ? view_path : view_path + '.js');\n }\n\n\n const layouts = await Promise.all(layouts_paths.map((layout) => {\n return import(/* @vite-ignore */ layout).then(layout => {\n return layout.default\n })\n }))\n\n if (!view_path.startsWith('/')){\n view_path = '/'+view_path\n }\n const view = await import(/* @vite-ignore */ view_path).then(view => {\n return view.default\n })\n\n ROOT.layouts = layouts\n ROOT.view = view\n ROOT.params = combinedParams\n ROOT.data = (window as any).__INITIAL_DATA__\n ROOT.urlParams = urlParams\n ROOT.query = query\n\n hydrate(RecursiveLoader, {\n target: node,\n props: ROOT,\n })\n } catch (error) {\n console.error('Client-side route loading failed:', error);\n // Don't trigger a reload - let SSR-rendered content remain\n // The page is already rendered by the server, just log the error\n }\n}\n\n\n\nexport async function updateRoute(url:string,base_path:string, route: IRoute, params: any,urlParams:any,query:any,server_loading:boolean = false,update = true) {\n console.log('[NAVIGATION] updateRoute called', {\n url,\n server_loading,\n route_path: route.path,\n route_middleware: route.middleware\n });\n try {\n // If we need server data, fetch it FIRST before loading components\n // This allows us to detect redirects before rendering anything\n let serverData = null;\n let redirectDetected = false;\n\n if (server_loading) {\n console.log('[NAVIGATION] Making server fetch FIRST for', url);\n const fetchOptions: any = {\n method: route.method,\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n }\n };\n fetchOptions[FORGE_LOAD_SYMBOL] = true;\n\n await fetch(url, fetchOptions).then((response) => {\n console.log('[NAVIGATION] Fetch response', {\n url,\n ok: response.ok,\n status: response.status,\n type: response.type,\n redirected: response.redirected,\n finalUrl: response.url\n });\n\n // Check if a redirect was detected by our fetch override\n // If so, it will have already triggered window.location.href\n // and returned a fake response\n if (response.redirected) {\n console.log('[NAVIGATION] Redirect detected, not loading components');\n redirectDetected = true;\n return null;\n }\n\n if (response.ok) {\n return response.json()\n } else {\n throw new Error('Network response was not ok')\n }\n }).then((data) => {\n serverData = data;\n });\n\n // If redirect was detected, exit early without loading components\n if (redirectDetected) {\n console.log('[NAVIGATION] Exiting early due to redirect');\n return;\n }\n }\n\n // Only load components if no redirect occurred\n const useCompiledClient = typeof base_path === 'string' && base_path.indexOf('assets') !== -1;\n const layouts_paths = (route.layout || []).map(layout => {\n let p = urlJoin(base_path,layout).toString();\n if (useCompiledClient) {\n p = p.endsWith('.svelte') ? p.replace(/\\.svelte$/, '.js') : (/[.][a-z]+$/.test(p) ? p : p + '.js');\n }\n return p;\n })\n let view_path = urlJoin(base_path,route.view).toString()\n if (useCompiledClient) {\n view_path = view_path.endsWith('.svelte') ? view_path.replace(/\\.svelte$/, '.js') : (/[.][a-z]+$/.test(view_path) ? view_path : view_path + '.js');\n }\n const layouts = await Promise.all(layouts_paths.map((layout) => {\n return import(/* @vite-ignore */ layout).then(layout => {\n return layout.default\n })\n }))\n const view = await import(/* @vite-ignore */ view_path).then(view => {\n return view.default\n })\n\n // Update ROOT with the loaded components and data\n if (server_loading) {\n ROOT.data = serverData\n ROOT.params = params\n ROOT.layouts = layouts\n ROOT.view = view\n ROOT.urlParams = urlParams\n ROOT.query = query\n } else {\n console.log('[NAVIGATION] No server loading needed for', url);\n ROOT.data = {layout:[],view:{}}\n ROOT.params = params\n ROOT.layouts = layouts\n ROOT.view = view\n ROOT.urlParams = urlParams\n ROOT.query = query\n }\n if(window){\n window.scroll(0,0)\n }\n\n if(update){\n history.push(url)\n }\n } catch (error) {\n console.error('Client-side navigation failed for URL:', url, error);\n // Don't trigger a reload - let current page state remain\n }\n}\n","\n\n\nexport const MANIFEST_STORE = $state({})\n\n\n\nexport async function updateManifestStore() {\n Object.assign(MANIFEST_STORE, window['__MANIFEST__'])\n // await fetch('/manifest.json')\n // .then(async (response) => {\n // if (response.ok) {\n // const manifest = await response.json();\n // console.log(manifest)\n // Object.assign(MANIFEST_STORE, manifest);\n // }\n // })\n}","\n\nimport type {IRoute} from \"../parser/IRoute\";\nimport type { UrlMatcher } from \"../routing/url_parser\";\nimport { updateRoute } from \"./navigation.svelte\";\nimport { MANIFEST_STORE } from \"../routing/manifest/store.svelte\";\nimport {page} from './page.svelte'\n\n\n\n\nexport function bootstrap_events(base_path:string,routes:IRoute[], matchers: UrlMatcher[]) {\n if(!document){\n console.error('Document not found')\n return\n }\n\n document.addEventListener('click', (event:any) => {\n const currentUrl = window.location.pathname;\n const a = event.target?.tagName === 'A' ? event.target : event.target?.closest('A');\n \n if (a) {\n let url = a.getAttribute('href');\n if (currentUrl === url) {\n event.preventDefault();\n return;\n }\n if (url && url.startsWith('/') || url.startsWith('.')) {\n const pathname = url.split('?')[0];\n const method = a.getAttribute('method') || 'get';\n const route = routes.find(r => r.method.toLowerCase() === method && matchers.find(m => m.parser(pathname) && m.pattern === r.path));\n if (route) {\n event.preventDefault();\n const m = matchers.find(m => m.parser(pathname) && m.pattern === route.path);\n const params = m?.parser(pathname) || {};\n // Parse query parameters and combine with path parameters\n const urlParams = new URLSearchParams(url.split('?')[1] || '');\n const queryParams = Object.fromEntries(urlParams.entries()) || {};\n const combinedParams = { ...params, ...queryParams };\n const requires_server_data = MANIFEST_STORE[m?.pattern as string]\n console.log('[EVENTS] Navigation to', url, {\n pattern: m?.pattern,\n requires_server_data,\n manifest_store: MANIFEST_STORE,\n middleware: route.middleware\n });\n updateRoute(url,base_path, route, combinedParams,params,queryParams,requires_server_data);\n } else {\n console.log('No matching route found for URL:', url, '- using fallback navigation');\n // Fallback: Don't prevent default, let browser handle the navigation\n // This will trigger a full page load that the server can handle\n }\n }\n }\n });\n\n\n window.addEventListener('popstate', (_) => {\n const path = window.location.pathname;\n const fullUrl = window.location.pathname + window.location.search;\n // update page data\n page.url = fullUrl\n page.pathname = window.location.pathname\n const method = 'get';\n const route = routes.find(r => r.method.toLowerCase() === method && matchers.find(m => m.parser(path) && m.pattern === r.path));\n if (route) {\n const m = matchers.find(m => m.parser(path) && m.pattern === route.path);\n const params = m?.parser(path) || {};\n // Parse query parameters and combine with path parameters\n const urlParams = new URLSearchParams(window.location.search);\n const queryParams = Object.fromEntries(urlParams.entries()) || {};\n\n // Object.assign(page.params,params)\n page.params = params\n page.query = queryParams\n\n const combinedParams = { ...params, ...queryParams };\n const requires_server_data = MANIFEST_STORE[m?.pattern as string]\n updateRoute(fullUrl,base_path, route, combinedParams,params,queryParams,requires_server_data,false);\n } else {\n console.log('No matching route found for popstate navigation to:', path, '- using fallback navigation');\n // Fallback: Trigger full page reload for unknown routes\n window.location.href = path;\n }\n });\n\n\n // Run this once in your bootstrap code\n (function () {\n const originalPushState = history.pushState;\n const originalReplaceState = history.replaceState;\n\n history.pushState = function (...args) {\n const result = originalPushState.apply(this, args);\n const evt= new Event('pushstate')\n evt['state'] = args[0]\n evt['url'] = args[2]\n window.dispatchEvent(evt);\n return result;\n };\n\n\n history.replaceState = function (...args) {\n const result = originalReplaceState.apply(this, args);\n \n // Only trigger navigation if pathname actually changes\n const newUrl = args[2];\n const currentPathname = window.location.pathname;\n const newPathname = newUrl ? new URL(newUrl, window.location.origin).pathname : currentPathname;\n \n if (newPathname !== currentPathname) {\n const evt= new Event('replacestate')\n evt['state'] = args[0]\n evt['url'] = args[2]\n window.dispatchEvent(evt);\n }\n \n return result;\n }\n // Add a listener to the popstate event\n })();\n\n window.addEventListener('pushstate', (event) => {\n const fullPath = event['url'] || window.location.pathname + window.location.search;\n const path = fullPath.split('?')[0];\n const method = 'get';\n const route = routes.find(r => r.method.toLowerCase() === method && matchers.find(m => m.parser(path) && m.pattern === r.path));\n if (route) {\n const m = matchers.find(m => m.parser(path) && m.pattern === route.path);\n const params = m?.parser(path);\n\n // Parse query parameters and combine with path parameters\n const urlParams = new URLSearchParams(fullPath.split('?')[1] || '');\n const queryParams = Object.fromEntries(urlParams.entries());\n \n page.url = fullPath\n page.pathname = window.location.pathname\n Object.assign(page.params,params)\n Object.assign(page.query,queryParams)\n\n const combinedParams = { ...params, ...queryParams };\n const requires_server_data = MANIFEST_STORE[m?.pattern as string]\n updateRoute(fullPath,base_path, route, combinedParams,params,queryParams,requires_server_data,false);\n } else {\n console.log('No matching route found for pushstate to:', path, '- using fallback navigation');\n // Fallback: Use full page navigation for unknown routes\n window.location.href = path;\n }\n });\n\n window.addEventListener('replacestate', (event) => {\n const fullPath = event['url'] || window.location.pathname + window.location.search;\n const path = fullPath.split('?')[0];\n\n // update page data\n page.url = fullPath\n page.pathname = window.location.pathname\n page.query = Object.fromEntries(new URLSearchParams(fullPath.split('?')[1] || ''))\n\n const method = 'get';\n const route = routes.find(r => r.method.toLowerCase() === method && matchers.find(m => m.parser(path) && m.pattern === r.path));\n if (route) {\n const m = matchers.find(m => m.parser(path) && m.pattern === route.path);\n const params = m?.parser(path) || {};\n // Parse query parameters and combine with path parameters\n const urlParams = new URLSearchParams(fullPath.split('?')[1] || '');\n const queryParams = Object.fromEntries(urlParams.entries()) || {};\n const combinedParams = { ...params, ...queryParams };\n const requires_server_data = MANIFEST_STORE[m?.pattern as string]\n updateRoute(fullPath,base_path, route, combinedParams,params,queryParams,requires_server_data,false);\n } else {\n console.log('No matching route found for replacestate to:', path, '- using fallback navigation');\n // Fallback: Use full page navigation for unknown routes\n window.location.href = path;\n }\n });\n \n}\n","import { initialize_route_matchers } from '../routing/url_parser';\nimport { loadRoute } from './navigation.svelte';\nimport { bootstrap_events } from './events';\nimport { updateManifestStore } from '../routing/manifest/store.svelte';\nimport type { ServerOptions } from '../options/ServerOptions';\nimport type { FetchMiddleware, FetchMiddlewareAPI, HeadersObject } from '../types/FetchMiddleware';\n\n// Symbol for marking load function fetches\nexport const FORGE_LOAD_SYMBOL = Symbol('forge-load-function');\n\n// Middleware storage\nlet middlewares: Array<FetchMiddleware> = [];\nlet originalFetch: typeof window.fetch | null = null;\n\n// Helper to determine if a URL is an internal route\nfunction isInternalRoute(url: string): boolean {\n try {\n const urlObj = new URL(url, window.location.origin);\n return urlObj.origin === window.location.origin && !urlObj.pathname.startsWith('/api/');\n } catch {\n // Relative URL, assume internal\n return !url.startsWith('/api/');\n }\n}\n\n// Initialize fetch override immediately when module is imported\nfunction initializeFetch(): void {\n if (typeof window !== 'undefined' && !originalFetch) {\n originalFetch = window.fetch;\n\n window.fetch = async function(input: RequestInfo | URL, init: RequestInit = {}): Promise<Response> {\n // Start with the original init\n let currentInit: RequestInit = { ...init };\n\n // Run all configured middleware\n for (const middleware of middlewares) {\n try {\n if (middleware.length === 2) {\n // Callback style (legacy): (headers, next) => {}\n // Convert headers for middleware\n const headers = new Headers(currentInit.headers);\n const headersObject: HeadersObject = Object.fromEntries(headers.entries());\n\n await new Promise<void>((resolve, reject) => {\n try {\n (middleware as any)(headersObject, (error?: any) => {\n if (error) {\n reject(error);\n } else {\n // Convert headers back\n const finalHeaders = new Headers();\n Object.entries(headersObject).forEach(([key, value]) => {\n if (value !== undefined) {\n finalHeaders.set(key, value);\n }\n });\n currentInit.headers = finalHeaders;\n resolve();\n }\n });\n } catch (error) {\n reject(error);\n }\n });\n } else {\n // New style middleware (returns RequestInit)\n const result = await (middleware as any)(currentInit, input);\n\n if (result && typeof result === 'object') {\n // Middleware returned a value - use it as new RequestInit\n currentInit = result;\n }\n }\n } catch (error) {\n console.error('🔴 Middleware error:', error);\n throw error;\n }\n }\n\n // Check if this is a framework-controlled request\n const hasForgeSymbol = (currentInit as any)?.[FORGE_LOAD_SYMBOL];\n\n console.log('[FETCH OVERRIDE] Request', {\n url: input,\n hasForgeSymbol,\n headers: currentInit?.headers\n });\n\n // Make the actual request (browser will follow redirects by default)\n const response = await originalFetch!(input, currentInit);\n\n console.log('[FETCH OVERRIDE] Response', {\n url: input,\n responseUrl: response.url,\n redirected: response.redirected,\n status: response.status,\n type: response.type,\n hasForgeSymbol\n });\n\n // Handle redirects for framework-controlled requests\n // response.redirected tells us if any redirects happened\n // response.url contains the final URL after all redirects\n if (hasForgeSymbol && response.redirected) {\n const requestedUrl = typeof input === 'string' ? input : input.url;\n const finalUrl = response.url;\n\n console.log('[FORGE REDIRECT] Detected redirect', {\n requested: requestedUrl,\n final: finalUrl,\n redirected: response.redirected\n });\n\n // Check if it's an internal route redirect\n if (isInternalRoute(finalUrl)) {\n // Extract pathname and search params from the full URL\n // This ensures the pushstate event handler receives a path it can match\n const url = new URL(finalUrl);\n const redirectPath = url.pathname + url.search;\n\n // Use history.pushState to trigger forge's SPA navigation\n // This will be intercepted by forge's event listeners and handle the navigation\n console.log('[FORGE REDIRECT] Using pushState for SPA navigation to:', redirectPath, 'from:', finalUrl);\n history.pushState(null, '', redirectPath);\n\n // Return a fake response to prevent errors in navigation.svelte.ts\n return new Response(JSON.stringify({ layout: [], view: {} }), {\n status: 200,\n headers: { 'Content-Type': 'application/json' }\n });\n }\n }\n\n return response;\n };\n }\n}\n\n// Initialize fetch override immediately\ninitializeFetch();\n\n// Export fetch API with middleware configuration\nexport const fetch: FetchMiddlewareAPI & { getMiddlewareCount(): number } = {\n /**\n * Add middleware to the fetch pipeline\n */\n configUpdate(middleware: FetchMiddleware): void {\n if (typeof middleware !== 'function') {\n throw new Error('Middleware must be a function');\n }\n middlewares.push(middleware);\n },\n \n /**\n * Reset all middleware\n */\n reset(): void {\n middlewares.length = 0;\n },\n \n /**\n * Get current middleware count (for debugging)\n */\n getMiddlewareCount(): number {\n return middlewares.length;\n }\n};\n\nlet routing;\n\nexport async function createApp<T extends HTMLElement = HTMLElement>(\n node: T,\n options: ServerOptions\n): Promise<void> {\n\n // Use server-injected component directory if available, otherwise fall back to options\n let base_path = window['__COMPONENT_DIR__'] || options.component_dir\n\n if(!base_path && typeof base_path !== 'string') {\n throw new Error('No component directory provided');\n }\n let routes = window['__ROUTING__']\n routing = initialize_route_matchers(routes)\n\n if (window && window.location) {\n const application_url = (window.location.pathname || '/').split('?')[0];\n const needle = routing.find(r => r.parser(application_url));\n let route = needle ? routes.find(r => r.path === needle.pattern) : null;\n if (needle && route) {\n const params = needle.parser(application_url) ||{};\n // Parse query parameters and combine with path parameters\n const urlParams = new URLSearchParams(window.location.search);\n const queryParams = Object.fromEntries(urlParams.entries()) || {};\n const combinedParams = { ...params, ...queryParams };\n updateManifestStore()\n loadRoute(node, base_path, route, combinedParams,params, queryParams);\n bootstrap_events(base_path, routes, routing);\n } else {\n console.warn('No matching route found for:', application_url);\n // No route found - let SSR-rendered content remain\n // The page is already rendered by the server\n }\n\n }\n}\n\n\n"],"names":["makeUrlParser","pattern","parser","pathToRegex","pathname","initialize_route_matchers","routes","route","_extends","n","e","t","Action","readOnly","obj","warning","cond","message","BeforeUnloadEventType","PopStateEventType","createBrowserHistory","options","_options","_options$window","window","globalHistory","getIndexAndLocation","_window$location","search","hash","state","blockedPopTx","handlePop","blockers","nextAction","_getIndexAndLocation","nextIndex","nextLocation","delta","index","go","applyTx","action","_getIndexAndLocation2","location","listeners","createEvents","createHref","to","createPath","getNextLocation","parsePath","createKey","getHistoryStateAndUrl","allowTx","retry","_getIndexAndLocation3","push","_getHistoryStateAndUr","historyState","url","replace","_getHistoryStateAndUr2","history","listener","blocker","unblock","promptBeforeUnload","event","handlers","fn","handler","arg","_ref","_ref$pathname","_ref$search","_ref$hash","path","parsedPath","hashIndex","searchIndex","ROOT","page","urlJoin","parts","part","i","loadRoute","node","base_path","combinedParams","urlParams","query","useCompiledClient","layouts_paths","layout","p","view_path","layouts","view","hydrate","RecursiveLoader","error","updateRoute","params","server_loading","update","serverData","redirectDetected","fetchOptions","FORGE_LOAD_SYMBOL","response","data","MANIFEST_STORE","$","updateManifestStore","bootstrap_events","matchers","currentUrl","a","_a","_b","method","r","m","queryParams","requires_server_data","_","fullUrl","originalPushState","originalReplaceState","args","result","evt","newUrl","currentPathname","fullPath","middlewares","originalFetch","isInternalRoute","urlObj","initializeFetch","input","init","currentInit","middleware","headers","headersObject","resolve","reject","finalHeaders","key","value","hasForgeSymbol","request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