import{EVE_ROUTE_PREFIX}from"#protocol/routes.js";const EVE_SVELTEKIT_SERVICE_PREFIX=`/_eve_internal/eve`;function normalizeRoutePrefix(e){let t=(e.startsWith(`/`)?e:`/${e}`).replace(/\/+$/,``);if(t.length===0)throw Error(`Eve SvelteKit service prefix cannot resolve to the root route.`);return t}function joinRoutePrefix(e,t){return`${e.replace(/\/+$/,``)}/${t.replace(/^\/+/,``)}`}function normalizeOrigin(e){return new URL(e.trim()).origin}function createEveVercelRewrite(t){return{destination:`${joinRoutePrefix(t,EVE_ROUTE_PREFIX)}/:path*`,source:`${EVE_ROUTE_PREFIX}/:path*`}}export{EVE_SVELTEKIT_SERVICE_PREFIX,createEveVercelRewrite,joinRoutePrefix,normalizeOrigin,normalizeRoutePrefix};