@i18n-micro/path-strategy 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/dist/base-strategy-BNdOdpRE.cjs +2 -0
- package/dist/base-strategy-BNdOdpRE.cjs.map +1 -0
- package/dist/{base-strategy-PVpkf05w.js → base-strategy-DmOQzfP1.js} +127 -109
- package/dist/base-strategy-DmOQzfP1.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/dist/no-prefix-strategy.cjs +1 -1
- package/dist/no-prefix-strategy.cjs.map +1 -1
- package/dist/no-prefix-strategy.d.ts +1 -2
- package/dist/no-prefix-strategy.mjs +2 -2
- package/dist/no-prefix-strategy.mjs.map +1 -1
- package/dist/prefix-and-default-strategy.cjs +1 -1
- package/dist/prefix-and-default-strategy.cjs.map +1 -1
- package/dist/prefix-and-default-strategy.d.ts +1 -2
- package/dist/prefix-and-default-strategy.mjs +2 -7
- package/dist/prefix-and-default-strategy.mjs.map +1 -1
- package/dist/prefix-except-default-strategy.cjs +1 -1
- package/dist/prefix-except-default-strategy.cjs.map +1 -1
- package/dist/prefix-except-default-strategy.d.ts +2 -4
- package/dist/prefix-except-default-strategy.mjs +58 -57
- package/dist/prefix-except-default-strategy.mjs.map +1 -1
- package/dist/prefix-strategy.cjs +1 -1
- package/dist/prefix-strategy.cjs.map +1 -1
- package/dist/prefix-strategy.d.ts +1 -2
- package/dist/prefix-strategy.mjs +1 -1
- package/dist/prefix-strategy.mjs.map +1 -1
- package/dist/types.d.ts +0 -1
- package/package.json +2 -2
- package/dist/base-strategy-CF5n6eGB.cjs +0 -2
- package/dist/base-strategy-CF5n6eGB.cjs.map +0 -1
- package/dist/base-strategy-PVpkf05w.js.map +0 -1
package/README.md
CHANGED
|
@@ -95,7 +95,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
95
95
|
locales: [/* ... */],
|
|
96
96
|
localizedRouteNamePrefix: 'localized-',
|
|
97
97
|
router: { hasRoute, resolve },
|
|
98
|
-
// optional: globalLocaleRoutes, routeLocales, routesLocaleLinks, noPrefixRedirect
|
|
98
|
+
// optional: globalLocaleRoutes, routeLocales, routesLocaleLinks, noPrefixRedirect
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
const pathStrategy = new Strategy(context)
|
|
@@ -155,7 +155,6 @@ Import from `@i18n-micro/path-strategy/types`.
|
|
|
155
155
|
| `globalLocaleRoutes` | `Record<string, Record<string, string> \| false>`: custom path per route/locale; `false` = unlocalized. |
|
|
156
156
|
| `routeLocales` | `Record<string, string[]>`: route path or base name → list of locale codes; limits hreflang entries. |
|
|
157
157
|
| `routesLocaleLinks` | `Record<string, string>`: base name → key for `routeLocales` lookup (e.g. `'products-id'` → `'products'`). |
|
|
158
|
-
| `includeDefaultLocaleRoute` | When set, SEO and links can include the default locale variant. |
|
|
159
158
|
| `noPrefixRedirect` | When `true` (default), `NoPrefixPathStrategy.getRedirect` strips a leading locale segment (e.g. `/en/about` → `/about`). Set to `false` to disable. |
|
|
160
159
|
| `debug` | Enable debug logging. |
|
|
161
160
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const ct=/#/g,ht=/&/g,ut=/\//g,ft=/=/g,q=/\+/g,Y=/%5e/gi,dt=/%60/gi,pt=/%7b/gi,mt=/%7c/gi,gt=/%7d/gi,Pt=/%20/gi;function Z(o){return encodeURI(""+o).replace(mt,"|")}function yt(o){return Z(o).replace(pt,"{").replace(gt,"}").replace(Y,"^")}function w(o){return Z(typeof o=="string"?o:JSON.stringify(o)).replace(q,"%2B").replace(Pt,"+").replace(ct,"%23").replace(ht,"%26").replace(dt,"`").replace(Y,"^").replace(ut,"%2F")}function E(o){return w(o).replace(ft,"%3D")}function A(o=""){try{return decodeURIComponent(""+o)}catch{return""+o}}function Rt(o){return A(o.replace(q," "))}function Lt(o){return A(o.replace(q," "))}function xt(o=""){const t=Object.create(null);o[0]==="?"&&(o=o.slice(1));for(const e of o.split("&")){const a=e.match(/([^=]+)=?(.*)/)||[];if(a.length<2)continue;const s=Rt(a[1]);if(s==="__proto__"||s==="constructor")continue;const r=Lt(a[2]||"");t[s]===void 0?t[s]=r:Array.isArray(t[s])?t[s].push(r):t[s]=[t[s],r]}return t}function bt(o,t){return(typeof t=="number"||typeof t=="boolean")&&(t=String(t)),t?Array.isArray(t)?t.map(e=>`${E(o)}=${w(e)}`).join("&"):`${E(o)}=${w(t)}`:E(o)}function Nt(o){return Object.keys(o).filter(t=>o[t]!==void 0).map(t=>bt(t,o[t])).filter(Boolean).join("&")}const zt=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,vt=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,St=/^([/\\]\s*){2,}[^/\\]/,Bt=/^\.?\//;function v(o,t={}){return typeof t=="boolean"&&(t={acceptRelative:t}),t.strict?zt.test(o):vt.test(o)||(t.acceptRelative?St.test(o):!1)}function Wt(o="",t){return o.endsWith("/")}function S(o="",t){return(Wt(o)?o.slice(0,-1):o)||"/"}function Ft(o="",t){return o.endsWith("/")?o:o+"/"}function U(o=""){return o.startsWith("/")}function k(o=""){return(U(o)?o.slice(1):o)||"/"}function O(o=""){return U(o)?o:"/"+o}function Q(o=""){return o.split("://").map(t=>t.replace(/\/{2,}/g,"/")).join("://")}function At(o,t){const e=I(o),a={...xt(e.search),...t};return e.search=Nt(a),et(e)}function _t(o){return!o||o==="/"}function Ut(o){return o&&o!=="/"}function T(o,...t){let e=o||"";for(const a of t.filter(s=>Ut(s)))if(e){const s=a.replace(Bt,"");e=Ft(e)+s}else e=a;return e}function Ct(o,t){return A(S(o))===A(S(t))}function Et(o,t){if(!t||t==="#")return o;const e=I(o);return e.hash=t===""?"":"#"+yt(t),et(e)}const tt=Symbol.for("ufo:protocolRelative");function I(o="",t){const e=o.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(e){const[,d,g=""]=e;return{protocol:d.toLowerCase(),pathname:g,href:d+g,auth:"",host:"",search:"",hash:""}}if(!v(o,{acceptRelative:!0}))return _(o);const[,a="",s,r=""]=o.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,n="",l=""]=r.match(/([^#/?]*)(.*)?/)||[];a==="file:"&&(l=l.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:i,search:h,hash:u}=_(l);return{protocol:a.toLowerCase(),auth:s?s.slice(0,Math.max(0,s.length-1)):"",host:n,pathname:i,search:h,hash:u,[tt]:!a}}function _(o=""){const[t="",e="",a=""]=(o.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:e,hash:a}}function et(o){const t=o.pathname||"",e=o.search?(o.search.startsWith("?")?"":"?")+o.search:"",a=o.hash||"",s=o.auth?o.auth+"@":"",r=o.host||"";return(o.protocol||o[tt]?(o.protocol||"")+"//":"")+s+r+t+e+a}const wt=/\/([^/]+)$/;function kt(o="",t){const{pathname:e}=I(o),a=e.match(wt);return a?a[1]:void 0}function H(o){return(_(o.startsWith("/")?o:`/${o}`).pathname||"").split("/").filter(Boolean)}const y=o=>_t(o??"")?"/":O(S(Q(o)))||"/";function $t(o){const t=Q(o||"/");return S(t)||"/"}function P(...o){const t=o.filter(r=>typeof r=="string"&&r!=="");if(t.length===0)return"/";const[e,...a]=t,s=T(e,...a)||"/";return v(s)?s:O(s)}function K(o){return o&&_(o).pathname||""}function $(o,t,e){let a=At(o,t??{});if(e&&e!=="#"){const s=e.startsWith("#")?e.slice(1):e;a=Et(a,s)}return a}function x(o){if(!o)return"";let t="";for(let e=0;e<o.length;e++)t+=o[e]==="-"?"/":o[e];return t}function G(o){if(!o)return"";const t=o.indexOf("-");return t===-1?o:T(o.slice(0,t),o.slice(t+1))}function M(o){if(!o)return"";const t=o.lastIndexOf("-");return t===-1?o:T(o.slice(0,t),o.slice(t+1))}function jt(o){const t=H(o);return t.length>1?t.slice(0,-1).join("-"):""}function qt(o){return kt(o||"/")??""}function X(o,t){const e=K(o),a=y(e);if(a==="/")return{pathWithoutLocale:"/",localeFromPath:null};if(!U(a))return{pathWithoutLocale:a,localeFromPath:null};const s=a.indexOf("/",1),r=s===-1?a.slice(1):a.slice(1,s);if(r&&t.includes(r)){const n=1+r.length,l=a.slice(n);return{pathWithoutLocale:y(l||"/"),localeFromPath:r}}return{pathWithoutLocale:a,localeFromPath:null}}function at(o,t){const e=K(o);if(e==="/"||e===""||!U(e))return null;const a=e.indexOf("/",1),s=a===-1?e.slice(1):e.slice(1,a);return s&&t.includes(s)?s:null}function D(o,t){const e=o.name?.toString();if(!e)return null;const a=t.localizedRouteNamePrefix||"localized-",s=e.startsWith(a)?e.slice(a.length):e,r=[...t.locales].sort((n,l)=>l.code.length-n.code.length);for(const n of r){const l=`-${n.code}`;if(!s.endsWith(l))continue;const i=s.length-n.code.length-1;if(i>=0&&s[i]==="-")return s.slice(0,-l.length)}return s}function st(o,t,e="localized-"){return`${e}${o}-${t}`}function j(o,t){if(o==null)return!1;const e=String(o).trim();if(e===""||e==="index")return!0;const a=t?.localizedRouteNamePrefix??"localized-",s=t?.localeCodes??[],r=`${a}index-`;if(!e.startsWith(r))return!1;const n=e.slice(r.length);return s.length===0?n.length>=2:s.includes(n)}const Ot=/:(\w+)\(\)|:(\w+)(?!\w)|\[\.\.\.(\w+)\]/g;class ot{constructor(t){this.ctx=t}resolvePathWithParams(t,e={}){return!e||Object.keys(e).length===0?t:t.replace(Ot,(a,s,r,n)=>{const l=s||r||n;if(!l)return a;const i=e[l];return i==null||i===""?a:Array.isArray(i)?i.join("/"):String(i)})}analyzeRoute(t){const e=this.ctx.locales.map(r=>r.code),{pathWithoutLocale:a}=X(t.path||"/",e);let s=null;return t.name&&(s=D(t,{locales:this.ctx.locales,localizedRouteNamePrefix:this.ctx.localizedRouteNamePrefix||"localized-"})),{pathWithoutLocale:a,baseRouteName:s}}getPathWithoutLocaleAndBaseName(t){return this.analyzeRoute(t)}getLookupKeys(t,e){const a=[];a.push(t);const s=k(t);if(s!==t&&a.push(s),(t==="/"||s==="")&&a.push(""),e){a.push(`/${e}`),a.push(e);const r=x(e);r&&r!==e&&a.push(r);const n=G(e);n&&a.push(n);const l=M(e);l&&a.push(l)}return a}resolveCustomPath(t,e){const a=this.ctx.globalLocaleRoutes;if(!a||Object.keys(a).length===0)return null;const{pathWithoutLocale:s,baseRouteName:r}=this.analyzeRoute(t),n=this.getLookupKeys(s,r);for(const l of n){const i=a[l];if(i&&typeof i=="object"&&!Array.isArray(i)){const h=i[e];if(typeof h=="string")return this.resolvePathWithParams(h,t.params??{})}}return null}getPathForUnlocalizedRoute(t){const e=this.ctx.globalLocaleRoutes;if(!e)return null;const{pathWithoutLocale:a,baseRouteName:s}=this.analyzeRoute(t),r=this.getLookupKeys(a,s);for(const n of r)if(e[n]===!1){if(s&&(n===s||n===`/${s}`)){const l=x(s);return l?P("/",l):`/${s}`}return a}return null}getPathForUnlocalizedRouteByName(t){const e=this.ctx.globalLocaleRoutes;if(!e)return null;const a=[t,`/${t}`,k(t)];for(const s of a)if(e[s]===!1){const r=x(s.startsWith("/")?s.slice(1):s);return r?P("/",r):s.startsWith("/")?s:`/${s}`}return null}getAllowedLocalesForRoute(t){const e=this.ctx.routeLocales;if(!e||Object.keys(e).length===0)return this.ctx.locales.map(n=>n.code);const{pathWithoutLocale:a,baseRouteName:s}=this.analyzeRoute(t);let r=this.getLookupKeys(a,s);s&&this.ctx.routesLocaleLinks?.[s]&&(r=[this.ctx.routesLocaleLinks[s],...r]);for(const n of r){const l=e[n];if(Array.isArray(l)&&l.length>0)return l.filter(i=>this.ctx.locales.some(h=>h.code===i))}return this.ctx.locales.map(n=>n.code)}getParentPathForNested(t,e){if(t.length<=1)return"/";const a=t.length>1?t.slice(0,-1).join("-"):"",s=this.ctx.globalLocaleRoutes;if(a&&s?.[a]&&typeof s[a]=="object"){const r=s[a];if(r[e])return y(r[e])}return P("/",...t.slice(0,-1))}}class Qt{constructor(t){this.ctx=t,this.resolver=new ot(t)}setRouter(t){this.ctx.router=t}getDefaultLocale(){return this.ctx.defaultLocale}getLocales(){return this.ctx.locales}getStrategy(){return this.ctx.strategy}getLocalizedRouteNamePrefix(){return this.ctx.localizedRouteNamePrefix||"localized-"}getGlobalLocaleRoutes(){return this.ctx.globalLocaleRoutes}getRouteLocales(){return this.ctx.routeLocales}getRoutesLocaleLinks(){return this.ctx.routesLocaleLinks}getNoPrefixRedirect(){return this.ctx.noPrefixRedirect}getRouteBaseName(t,e){const a=e?[{code:e}]:this.ctx.locales;return D(t,{locales:a,localizedRouteNamePrefix:this.getLocalizedRouteNamePrefix()})}getBaseRouteName(t,e){return this.getRouteBaseName(t,e)}resolvePathForLocale(t,e){const a={path:t,name:null,fullPath:t,params:{}},s=this.resolver.resolveCustomPath(a,e);return y(s||t)}buildLocalizedName(t,e){return st(t,e,this.getLocalizedRouteNamePrefix())}getLocaleObject(t){return this.ctx.locales.find(e=>e.code===t)}applyBaseUrl(t,e){if(typeof e=="string"){if(v(e))return e}else if(e.path&&v(e.path))return e;const a=this.getLocaleObject(t);if(!a?.baseUrl)return e;const s=S(a.baseUrl);if(typeof e=="string"){const l=y(e.startsWith("/")?e:`/${e}`);return P(s,l)}const r=y(e.path||""),n=P(s,r);return v(n)?n:{...e,path:n,fullPath:n}}preserveQueryAndHash(t,e){if(!e||!e.query&&!e.hash)return t;const a=typeof t=="string"?{path:t}:{...t};e.query&&(a.query={...e.query,...a.query}),!a.hash&&e.hash&&(a.hash=e.hash);const s=a.path??"";return a.fullPath=$(s,a.query,a.hash),a}resolvePathWithParams(t,e={}){return this.resolver.resolvePathWithParams(t,e)}getPathWithoutLocaleAndBaseName(t){return this.resolver.getPathWithoutLocaleAndBaseName(t)}getCustomPathSegment(t,e){return this.resolver.resolveCustomPath(t,e)}getAllowedLocalesForRoute(t){return this.resolver.getAllowedLocalesForRoute(t)}getCanonicalPath(t,e){return null}getPathForUnlocalizedRouteByName(t){return this.resolver.getPathForUnlocalizedRouteByName(t)}tryResolveByLocalizedName(t,e,a){const s=this.getLocalizedRouteNamePrefix(),r=`${s}${t}-${e}`,n=`${s}${t}`;let l;if(this.ctx.router.hasRoute(r))l=r;else if(this.ctx.router.hasRoute(n))l=n;else return this.debugLog("tryResolveByLocalizedName",{routeName:t,targetLocale:e,tried:[r,n],found:!1}),null;this.debugLog("tryResolveByLocalizedName",{routeName:t,targetLocale:e,localizedName:l,found:!0});const i={...a?.params};l===n&&(i.locale=e);let h;try{h=this.ctx.router.resolve({name:l,params:i,query:a?.query,hash:a?.hash})}catch{return this.debugLog("tryResolveByLocalizedName resolve error",{localizedName:l,params:i}),null}return this.debugLog("tryResolveByLocalizedName resolved",{localizedName:l,path:h?.path,fullPath:h?.fullPath}),h?.path?{name:l,path:h.path,fullPath:h.fullPath,params:h.params,query:h.query??a?.query,hash:h.hash??a?.hash}:null}tryResolveByLocalizedNameWithParams(t,e,a,s){const r=this.getLocalizedRouteNamePrefix(),n=`${r}${t}-${e}`,l=`${r}${t}`;let i;if(this.ctx.router.hasRoute(n))i=n;else if(this.ctx.router.hasRoute(l))i=l;else return this.debugLog("tryResolveByLocalizedNameWithParams",{routeName:t,targetLocale:e,params:a,tried:[n,l],found:!1}),null;this.debugLog("tryResolveByLocalizedNameWithParams",{routeName:t,targetLocale:e,params:a,localizedName:i,found:!0});const h={...a};i===l&&(h.locale=e);let u;try{u=this.ctx.router.resolve({name:i,params:h,query:s?.query,hash:s?.hash})}catch{return this.debugLog("tryResolveByLocalizedNameWithParams resolve error",{localizedName:i,resolveParams:h}),null}return this.debugLog("tryResolveByLocalizedNameWithParams resolved",{path:u?.path,fullPath:u?.fullPath}),!u?.path||u.path==="/"?null:{name:i,path:u.path,fullPath:u.fullPath,params:u.params,query:u.query??s?.query,hash:u.hash??s?.hash}}getPathForUnlocalizedRoute(t){return this.resolver.getPathForUnlocalizedRoute(t)}buildPathFromBaseNameAndParams(t,e,a){const s=Object.keys(e).filter(u=>e[u]!==void 0&&e[u]!==null&&e[u]!=="");if(s.length===0)return null;let r;const n=s[0];if(s.length===1&&n!==void 0&&t.endsWith(`-${n}`))r=P("/",`${t.slice(0,t.length-n.length-1)}-:${n}`);else{const u=x(t),d=u?u.split("/").filter(Boolean):[t],g=Math.min(s.length,d.length),R=d.slice(0,d.length-g).concat(s.slice(0,g).map(B=>`:${B}`));r=P("/",...R)}const l=this.resolvePathWithParams(r,e),i=this.buildLocalizedPath(l,a,!1),h=this.applyBaseUrl(a,i);return typeof h=="string"?h:h.path??i}getPathWithoutLocale(t){return X(t,this.ctx.locales.map(e=>e.code))}getLocaleFromPath(t){return at(t,this.ctx.locales.map(e=>e.code))}shouldReturn404(t){const{pathWithoutLocale:e,localeFromPath:a}=this.getPathWithoutLocale(t);if(a===null)return null;const s=e==="/"?"/":e.replace(/^\//,""),r=this.ctx.globalLocaleRoutes;if(r&&(r[e]===!1||r[s]===!1))return"Unlocalized route cannot have locale prefix";const n=this.ctx.routeLocales;if(n&&Object.keys(n).length>0){const l=n[e]??n[s];if(Array.isArray(l)&&l.length>0){const i=this.ctx.locales.map(u=>u.code),h=l.filter(u=>i.includes(u));if(h.length>0&&!h.includes(a))return"Locale not allowed for this route"}}return null}getSeoAttributes(t){const e=this.resolveLocaleFromPath(t.path)??this.ctx.defaultLocale,a=this.getCanonicalPath(t,e)??t.path,s=this.buildFullUrl(e,a),r=this.getAllowedLocalesForRoute(t),l=this.ctx.locales.filter(i=>r.includes(i.code)).map(i=>{const h=this.localeRoute(i.code,t,t),d=(h.path??h.fullPath??"")||"/";return{rel:"alternate",hreflang:i.code,href:this.buildFullUrl(i.code,d)}});return{canonical:s,hreflangs:l}}buildFullUrl(t,e){const a=this.applyBaseUrl(t,e);return typeof a=="string"?a:a.path??e}getSwitchLocaleFallbackWhenNoRoute(t,e){return{...t,name:e}}switchLocaleRoute(t,e,a,s){const r=this.getBaseRouteName(a,t);if(!r)return a;const n=this.buildLocalizedRouteName(r,e),l=`${this.getLocalizedRouteNamePrefix()}${r}`;let i,h=!1;if(this.ctx.router.hasRoute(n))i=n;else if(this.ctx.router.hasRoute(l))i=l,h=!0;else if(this.ctx.router.hasRoute(r))i=r;else return this.getSwitchLocaleFallbackWhenNoRoute(a,n);const u=s.i18nRouteParams?.[e]||{},d={...a.params||{},...u};h?d.locale=e:delete d.locale;const g={name:i,params:d,query:a.query,hash:a.hash};return this.applyBaseUrl(e,g)}localeRoute(t,e,a){const s=this.normalizeRouteInput(e,a),r=this.resolveLocaleRoute(t,s,a);this.debugLog("localeRoute raw",{rawPath:typeof r=="string"?r:r.path,rawFullPath:typeof r=="string"?r:r.fullPath});const n=this.ensureRouteLike(r,s.kind==="route"?s.sourceRoute:void 0);return this.debugLog("localeRoute after ensureRouteLike",{path:n.path,fullPath:n.fullPath}),n}ensureRouteLike(t,e){if(typeof t=="string"){const r=t,n=e?.query||e?.hash?$(r,e?.query,e?.hash):r;return{path:r,fullPath:n,...e?.query&&{query:e.query},...e?.hash&&{hash:e.hash}}}let a=t.fullPath??t.path??"",s=t.path??a.split("?")[0]?.split("#")[0]??a;if(!s&&!a){const r=t.name?.toString()??e?.name?.toString()??"";j(r,{localizedRouteNamePrefix:this.getLocalizedRouteNamePrefix(),localeCodes:this.ctx.locales.map(n=>n.code)})&&(s="/",a="/")}return{...t,path:s,fullPath:a}}normalizeRouteInput(t,e){if(typeof t=="string")return{kind:"path",path:t};const a=t,s=a.name?.toString()??null;let r;try{r=this.ctx.router.resolve(t),this.debugLog("normalizeRouteInput router.resolve ok",{inputName:s,resolvedPath:r.path,resolvedName:r.name})}catch{r={name:s,path:a.path??"/",fullPath:a.fullPath??a.path??"/",params:a.params??{},query:a.query??{},hash:a.hash??""},this.debugLog("normalizeRouteInput router.resolve catch fallback",{inputName:s,resolvedPath:r.path})}return{kind:"route",inputName:s,sourceRoute:a,resolved:r}}debugLog(...t){}resolveLocaleRoute(t,e,a){if(e.kind==="path"){const c=this.resolvePathForLocale(e.path,t),f=this.buildLocalizedPath(c,t,!1),p=this.applyBaseUrl(t,f);return this.debugLog("branch=path",{targetLocale:t,path:e.path,finalPath:f,out:typeof p=="string"?p:p.path}),p}const{inputName:s,sourceRoute:r,resolved:n}=e,l=r.params&&Object.keys(r.params??{}).length>0,i=this.getRouteBaseName(n)??s??n.name?.toString()??null,h=n.name?.toString();if(this.debugLog("input",{targetLocale:t,inputName:s,resolvedPath:n.path,resolvedName:n.name,params:r.params,hasParams:l,baseName:i}),s){const c=this.getPathForUnlocalizedRouteByName(s);if(c!==null)return this.debugLog("branch=unlocalizedByName",{inputName:s,unlocalizedByName:c}),this.preserveQueryAndHash(c,r)}if(s&&l){const c=this.tryResolveByLocalizedNameWithParams(s,t,r.params??{},r);if(c!==null)return this.debugLog("branch=routeWithParams",{inputName:s,path:c.path,fullPath:c.fullPath}),this.preserveQueryAndHash(this.applyBaseUrl(t,c),r)}if(s&&!l){let c=this.tryResolveByLocalizedName(s,t,r);const f=this.getLocalizedRouteNamePrefix();if(c===null&&i!=null&&i!==s&&s.startsWith(f)&&(c=this.tryResolveByLocalizedName(i,t,r)),c!==null)return this.debugLog("branch=routeByLocalizedName",{inputName:s,path:c.path,fullPath:c.fullPath}),this.preserveQueryAndHash(this.applyBaseUrl(t,c),r)}const u=this.getPathForUnlocalizedRoute(n);if(u!==null){const c=this.buildLocalizedPath(u,t,!1);return this.debugLog("branch=unlocalizedPath",{unlocalizedPath:u,path:c}),this.preserveQueryAndHash(this.applyBaseUrl(t,c),r)}const d=this.getCustomPathSegment(n,t);if(d!==null){const c=n.name?.toString()??s??"",f=c?G(c):"",p=c?M(c):"",m=this.ctx.globalLocaleRoutes,N=f.includes("/")&&m?.[f],b=p.includes("/")&&m?.[p],rt=N||b,nt=b?p:f;let F;if(rt){const C=H(nt),z=C.length>1?C.slice(0,-1).join("-"):"",J=z&&m?.[z]&&typeof m[z]=="object"&&!Array.isArray(m[z])?m[z]:null,lt=J?.[t]?y(J[t]):P("/",...C.slice(0,-1)),it=d.startsWith("/")?d.slice(1):d;F=P(lt,it)}else F=y(d);const V=this.buildLocalizedPath(F,t,!0);return this.debugLog("branch=customSegment",{customSegment:d,pathWithoutLocale:F,finalPath:V}),this.preserveQueryAndHash(this.applyBaseUrl(t,V),r)}const g=i??s;if(this.debugLog("before effectiveBaseName check",{baseName:i,inputName:s,effectiveBaseName:g,resolvedName:n.name?.toString()}),!g)return this.debugLog("branch=noBaseName",{return:"src"}),r;if(!l&&n.path&&n.path!=="/"&&n.name){const{pathWithoutLocale:c,baseRouteName:f}=this.getPathWithoutLocaleAndBaseName(n);if(c&&c!=="/"){const p=f&&c===f?P("/",x(f)):c,m=this.buildLocalizedPath(p,t,!1);return this.debugLog("branch=pathFromResolved",{pathWithoutLocale:c,baseRouteName:f,pathToUse:p,finalPath:m}),this.preserveQueryAndHash(this.applyBaseUrl(t,m),r)}}const R=h===s?g:s??g;this.debugLog("fallback build",{resolvedNameStr:h,inputName:s,baseNameForPath:R,targetLocale:t,hasParams:l});const B=this.buildLocalizedRouteName(R,t),L={...r,name:B,params:{...r.params}};if(l){let c=null;try{const f=this.ctx.router.resolve({name:R,params:r.params});if(f?.path){const p=f.path==="/"?"/":(()=>{const{pathWithoutLocale:b}=this.getPathWithoutLocale(f.path);return b&&b!=="/"?b:f.path})(),m=this.buildLocalizedPath(p,t,!1),N=this.applyBaseUrl(t,m);c=typeof N=="string"?N:N.path??m}}catch{c=this.buildPathFromBaseNameAndParams(R,r.params??{},t)}c&&(L.path=c,L.fullPath=c)}else{const c=j(R)?"/":P("/",x(R)),f=this.buildLocalizedPath(c,t,!1),p=this.applyBaseUrl(t,f),m=typeof p=="string"?p:p.path??f;this.debugLog("fallback !hasParams",{pathWithoutLocale:c,finalPath:f,pathStr:m}),L.path=m,L.fullPath=m}L.path&&delete L.name;const W=this.preserveQueryAndHash(this.applyBaseUrl(t,L),r);return this.debugLog("branch=fallbackNewRoute return",{baseName:i,targetName:B,hasParams:l,newRoutePath:L.path,outPath:typeof W=="string"?W:W.path}),W}extractLocaleFromPath(t){if(!t)return null;const a=t.split("?")[0]?.split("#")[0];if(!a||a==="/")return null;const s=a.split("/").filter(Boolean);if(s.length===0)return null;const r=s[0];return r&&this.ctx.locales.map(l=>l.code).includes(r)?r:null}getCurrentLocale(t,e){const a=this.ctx.strategy;if(this.ctx.hashMode){const l=e?.();return l||this.ctx.defaultLocale}if(a==="no_prefix"){const l=e?.();return l||this.ctx.defaultLocale}const s=t.path||t.fullPath||"";if(a==="prefix_and_default"&&(s==="/"||s==="")){const l=e?.();if(l)return l}if(t.params?.locale)return String(t.params.locale);const r=this.extractLocaleFromPath(s);if(r)return r;if(a==="prefix_except_default")return this.ctx.defaultLocale;const n=e?.();return n||this.ctx.defaultLocale}getPluginRouteName(t,e){if(this.ctx.disablePageLocales)return"general";const a=this.getRouteBaseName(t);return a||(t.name??"").toString().replace(this.getLocalizedRouteNamePrefix(),"").replace(new RegExp(`-${e}$`),"")}getCurrentLocaleName(t){const e=this.getCurrentLocale(t);return this.ctx.locales.find(s=>s.code===e)?.displayName??null}}exports.BasePathStrategy=Qt;exports.RouteResolver=ot;exports.buildLocalizedName=st;exports.buildUrl=$;exports.cleanDoubleSlashes=Q;exports.getCleanPath=K;exports.getLocaleFromPath=at;exports.getPathSegments=H;exports.getPathWithoutLocale=X;exports.getRouteBaseName=D;exports.isIndexRouteName=j;exports.isSamePath=Ct;exports.joinUrl=P;exports.lastPathSegment=qt;exports.nameKeyFirstSlash=G;exports.nameKeyLastSlash=M;exports.normalizePath=y;exports.normalizePathForCompare=$t;exports.parentKeyFromSlashKey=jt;exports.transformNameKeyToPath=x;exports.withLeadingSlash=O;exports.withoutLeadingSlash=k;
|
|
2
|
+
//# sourceMappingURL=base-strategy-BNdOdpRE.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-strategy-BNdOdpRE.cjs","sources":["../../../node_modules/.pnpm/ufo@1.6.1/node_modules/ufo/dist/index.mjs","../src/utils/path.ts","../src/core/normalizer.ts","../src/utils/route-name.ts","../src/core/resolver.ts","../src/strategies/base-strategy.ts"],"sourcesContent":["const n = /[^\\0-\\x7E]/;\nconst t = /[\\x2E\\u3002\\uFF0E\\uFF61]/g;\nconst o = {\n overflow: \"Overflow Error\",\n \"not-basic\": \"Illegal Input\",\n \"invalid-input\": \"Invalid Input\"\n};\nconst e = Math.floor;\nconst r = String.fromCharCode;\nfunction s(n2) {\n throw new RangeError(o[n2]);\n}\nconst c = function(n2, t2) {\n return n2 + 22 + 75 * (n2 < 26) - ((t2 != 0) << 5);\n};\nconst u = function(n2, t2, o2) {\n let r2 = 0;\n for (n2 = o2 ? e(n2 / 700) : n2 >> 1, n2 += e(n2 / t2); n2 > 455; r2 += 36) {\n n2 = e(n2 / 35);\n }\n return e(r2 + 36 * n2 / (n2 + 38));\n};\nfunction toASCII(o2) {\n return function(n2, o3) {\n const e2 = n2.split(\"@\");\n let r2 = \"\";\n e2.length > 1 && (r2 = e2[0] + \"@\", n2 = e2[1]);\n const s2 = function(n3, t2) {\n const o4 = [];\n let e3 = n3.length;\n for (; e3--; ) {\n o4[e3] = t2(n3[e3]);\n }\n return o4;\n }((n2 = n2.replace(t, \".\")).split(\".\"), o3).join(\".\");\n return r2 + s2;\n }(o2, function(t2) {\n return n.test(t2) ? \"xn--\" + function(n2) {\n const t3 = [];\n const o3 = (n2 = function(n3) {\n const t4 = [];\n let o4 = 0;\n const e2 = n3.length;\n for (; o4 < e2; ) {\n const r2 = n3.charCodeAt(o4++);\n if (r2 >= 55296 && r2 <= 56319 && o4 < e2) {\n const e3 = n3.charCodeAt(o4++);\n (64512 & e3) == 56320 ? t4.push(((1023 & r2) << 10) + (1023 & e3) + 65536) : (t4.push(r2), o4--);\n } else {\n t4.push(r2);\n }\n }\n return t4;\n }(n2)).length;\n let f = 128;\n let i = 0;\n let l = 72;\n for (const o4 of n2) {\n o4 < 128 && t3.push(r(o4));\n }\n const h = t3.length;\n let p = h;\n for (h && t3.push(\"-\"); p < o3; ) {\n let o4 = 2147483647;\n for (const t4 of n2) {\n t4 >= f && t4 < o4 && (o4 = t4);\n }\n const a = p + 1;\n o4 - f > e((2147483647 - i) / a) && s(\"overflow\"), i += (o4 - f) * a, f = o4;\n for (const o5 of n2) {\n if (o5 < f && ++i > 2147483647 && s(\"overflow\"), o5 == f) {\n let n3 = i;\n for (let o6 = 36; ; o6 += 36) {\n const s2 = o6 <= l ? 1 : o6 >= l + 26 ? 26 : o6 - l;\n if (n3 < s2) {\n break;\n }\n const u2 = n3 - s2;\n const f2 = 36 - s2;\n t3.push(r(c(s2 + u2 % f2, 0))), n3 = e(u2 / f2);\n }\n t3.push(r(c(n3, 0))), l = u(i, a, p == h), i = 0, ++p;\n }\n }\n ++i, ++f;\n }\n return t3.join(\"\");\n }(t2) : t2;\n });\n}\n\nconst HASH_RE = /#/g;\nconst AMPERSAND_RE = /&/g;\nconst SLASH_RE = /\\//g;\nconst EQUAL_RE = /=/g;\nconst IM_RE = /\\?/g;\nconst PLUS_RE = /\\+/g;\nconst ENC_CARET_RE = /%5e/gi;\nconst ENC_BACKTICK_RE = /%60/gi;\nconst ENC_CURLY_OPEN_RE = /%7b/gi;\nconst ENC_PIPE_RE = /%7c/gi;\nconst ENC_CURLY_CLOSE_RE = /%7d/gi;\nconst ENC_SPACE_RE = /%20/gi;\nconst ENC_SLASH_RE = /%2f/gi;\nconst ENC_ENC_SLASH_RE = /%252f/gi;\nfunction encode(text) {\n return encodeURI(\"\" + text).replace(ENC_PIPE_RE, \"|\");\n}\nfunction encodeHash(text) {\n return encode(text).replace(ENC_CURLY_OPEN_RE, \"{\").replace(ENC_CURLY_CLOSE_RE, \"}\").replace(ENC_CARET_RE, \"^\");\n}\nfunction encodeQueryValue(input) {\n return encode(typeof input === \"string\" ? input : JSON.stringify(input)).replace(PLUS_RE, \"%2B\").replace(ENC_SPACE_RE, \"+\").replace(HASH_RE, \"%23\").replace(AMPERSAND_RE, \"%26\").replace(ENC_BACKTICK_RE, \"`\").replace(ENC_CARET_RE, \"^\").replace(SLASH_RE, \"%2F\");\n}\nfunction encodeQueryKey(text) {\n return encodeQueryValue(text).replace(EQUAL_RE, \"%3D\");\n}\nfunction encodePath(text) {\n return encode(text).replace(HASH_RE, \"%23\").replace(IM_RE, \"%3F\").replace(ENC_ENC_SLASH_RE, \"%2F\").replace(AMPERSAND_RE, \"%26\").replace(PLUS_RE, \"%2B\");\n}\nfunction encodeParam(text) {\n return encodePath(text).replace(SLASH_RE, \"%2F\");\n}\nfunction decode(text = \"\") {\n try {\n return decodeURIComponent(\"\" + text);\n } catch {\n return \"\" + text;\n }\n}\nfunction decodePath(text) {\n return decode(text.replace(ENC_SLASH_RE, \"%252F\"));\n}\nfunction decodeQueryKey(text) {\n return decode(text.replace(PLUS_RE, \" \"));\n}\nfunction decodeQueryValue(text) {\n return decode(text.replace(PLUS_RE, \" \"));\n}\nfunction encodeHost(name = \"\") {\n return toASCII(name);\n}\n\nfunction parseQuery(parametersString = \"\") {\n const object = /* @__PURE__ */ Object.create(null);\n if (parametersString[0] === \"?\") {\n parametersString = parametersString.slice(1);\n }\n for (const parameter of parametersString.split(\"&\")) {\n const s = parameter.match(/([^=]+)=?(.*)/) || [];\n if (s.length < 2) {\n continue;\n }\n const key = decodeQueryKey(s[1]);\n if (key === \"__proto__\" || key === \"constructor\") {\n continue;\n }\n const value = decodeQueryValue(s[2] || \"\");\n if (object[key] === void 0) {\n object[key] = value;\n } else if (Array.isArray(object[key])) {\n object[key].push(value);\n } else {\n object[key] = [object[key], value];\n }\n }\n return object;\n}\nfunction encodeQueryItem(key, value) {\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n value = String(value);\n }\n if (!value) {\n return encodeQueryKey(key);\n }\n if (Array.isArray(value)) {\n return value.map(\n (_value) => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}`\n ).join(\"&\");\n }\n return `${encodeQueryKey(key)}=${encodeQueryValue(value)}`;\n}\nfunction stringifyQuery(query) {\n return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem(k, query[k])).filter(Boolean).join(\"&\");\n}\n\nconst PROTOCOL_STRICT_REGEX = /^[\\s\\w\\0+.-]{2,}:([/\\\\]{1,2})/;\nconst PROTOCOL_REGEX = /^[\\s\\w\\0+.-]{2,}:([/\\\\]{2})?/;\nconst PROTOCOL_RELATIVE_REGEX = /^([/\\\\]\\s*){2,}[^/\\\\]/;\nconst PROTOCOL_SCRIPT_RE = /^[\\s\\0]*(blob|data|javascript|vbscript):$/i;\nconst TRAILING_SLASH_RE = /\\/$|\\/\\?|\\/#/;\nconst JOIN_LEADING_SLASH_RE = /^\\.?\\//;\nfunction isRelative(inputString) {\n return [\"./\", \"../\"].some((string_) => inputString.startsWith(string_));\n}\nfunction hasProtocol(inputString, opts = {}) {\n if (typeof opts === \"boolean\") {\n opts = { acceptRelative: opts };\n }\n if (opts.strict) {\n return PROTOCOL_STRICT_REGEX.test(inputString);\n }\n return PROTOCOL_REGEX.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(inputString) : false);\n}\nfunction isScriptProtocol(protocol) {\n return !!protocol && PROTOCOL_SCRIPT_RE.test(protocol);\n}\nfunction hasTrailingSlash(input = \"\", respectQueryAndFragment) {\n if (!respectQueryAndFragment) {\n return input.endsWith(\"/\");\n }\n return TRAILING_SLASH_RE.test(input);\n}\nfunction withoutTrailingSlash(input = \"\", respectQueryAndFragment) {\n if (!respectQueryAndFragment) {\n return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || \"/\";\n }\n if (!hasTrailingSlash(input, true)) {\n return input || \"/\";\n }\n let path = input;\n let fragment = \"\";\n const fragmentIndex = input.indexOf(\"#\");\n if (fragmentIndex !== -1) {\n path = input.slice(0, fragmentIndex);\n fragment = input.slice(fragmentIndex);\n }\n const [s0, ...s] = path.split(\"?\");\n const cleanPath = s0.endsWith(\"/\") ? s0.slice(0, -1) : s0;\n return (cleanPath || \"/\") + (s.length > 0 ? `?${s.join(\"?\")}` : \"\") + fragment;\n}\nfunction withTrailingSlash(input = \"\", respectQueryAndFragment) {\n if (!respectQueryAndFragment) {\n return input.endsWith(\"/\") ? input : input + \"/\";\n }\n if (hasTrailingSlash(input, true)) {\n return input || \"/\";\n }\n let path = input;\n let fragment = \"\";\n const fragmentIndex = input.indexOf(\"#\");\n if (fragmentIndex !== -1) {\n path = input.slice(0, fragmentIndex);\n fragment = input.slice(fragmentIndex);\n if (!path) {\n return fragment;\n }\n }\n const [s0, ...s] = path.split(\"?\");\n return s0 + \"/\" + (s.length > 0 ? `?${s.join(\"?\")}` : \"\") + fragment;\n}\nfunction hasLeadingSlash(input = \"\") {\n return input.startsWith(\"/\");\n}\nfunction withoutLeadingSlash(input = \"\") {\n return (hasLeadingSlash(input) ? input.slice(1) : input) || \"/\";\n}\nfunction withLeadingSlash(input = \"\") {\n return hasLeadingSlash(input) ? input : \"/\" + input;\n}\nfunction cleanDoubleSlashes(input = \"\") {\n return input.split(\"://\").map((string_) => string_.replace(/\\/{2,}/g, \"/\")).join(\"://\");\n}\nfunction withBase(input, base) {\n if (isEmptyURL(base) || hasProtocol(input)) {\n return input;\n }\n const _base = withoutTrailingSlash(base);\n if (input.startsWith(_base)) {\n return input;\n }\n return joinURL(_base, input);\n}\nfunction withoutBase(input, base) {\n if (isEmptyURL(base)) {\n return input;\n }\n const _base = withoutTrailingSlash(base);\n if (!input.startsWith(_base)) {\n return input;\n }\n const trimmed = input.slice(_base.length);\n return trimmed[0] === \"/\" ? trimmed : \"/\" + trimmed;\n}\nfunction withQuery(input, query) {\n const parsed = parseURL(input);\n const mergedQuery = { ...parseQuery(parsed.search), ...query };\n parsed.search = stringifyQuery(mergedQuery);\n return stringifyParsedURL(parsed);\n}\nfunction filterQuery(input, predicate) {\n if (!input.includes(\"?\")) {\n return input;\n }\n const parsed = parseURL(input);\n const query = parseQuery(parsed.search);\n const filteredQuery = Object.fromEntries(\n Object.entries(query).filter(([key, value]) => predicate(key, value))\n );\n parsed.search = stringifyQuery(filteredQuery);\n return stringifyParsedURL(parsed);\n}\nfunction getQuery(input) {\n return parseQuery(parseURL(input).search);\n}\nfunction isEmptyURL(url) {\n return !url || url === \"/\";\n}\nfunction isNonEmptyURL(url) {\n return url && url !== \"/\";\n}\nfunction joinURL(base, ...input) {\n let url = base || \"\";\n for (const segment of input.filter((url2) => isNonEmptyURL(url2))) {\n if (url) {\n const _segment = segment.replace(JOIN_LEADING_SLASH_RE, \"\");\n url = withTrailingSlash(url) + _segment;\n } else {\n url = segment;\n }\n }\n return url;\n}\nfunction joinRelativeURL(..._input) {\n const JOIN_SEGMENT_SPLIT_RE = /\\/(?!\\/)/;\n const input = _input.filter(Boolean);\n const segments = [];\n let segmentsDepth = 0;\n for (const i of input) {\n if (!i || i === \"/\") {\n continue;\n }\n for (const [sindex, s] of i.split(JOIN_SEGMENT_SPLIT_RE).entries()) {\n if (!s || s === \".\") {\n continue;\n }\n if (s === \"..\") {\n if (segments.length === 1 && hasProtocol(segments[0])) {\n continue;\n }\n segments.pop();\n segmentsDepth--;\n continue;\n }\n if (sindex === 1 && segments[segments.length - 1]?.endsWith(\":/\")) {\n segments[segments.length - 1] += \"/\" + s;\n continue;\n }\n segments.push(s);\n segmentsDepth++;\n }\n }\n let url = segments.join(\"/\");\n if (segmentsDepth >= 0) {\n if (input[0]?.startsWith(\"/\") && !url.startsWith(\"/\")) {\n url = \"/\" + url;\n } else if (input[0]?.startsWith(\"./\") && !url.startsWith(\"./\")) {\n url = \"./\" + url;\n }\n } else {\n url = \"../\".repeat(-1 * segmentsDepth) + url;\n }\n if (input[input.length - 1]?.endsWith(\"/\") && !url.endsWith(\"/\")) {\n url += \"/\";\n }\n return url;\n}\nfunction withHttp(input) {\n return withProtocol(input, \"http://\");\n}\nfunction withHttps(input) {\n return withProtocol(input, \"https://\");\n}\nfunction withoutProtocol(input) {\n return withProtocol(input, \"\");\n}\nfunction withProtocol(input, protocol) {\n let match = input.match(PROTOCOL_REGEX);\n if (!match) {\n match = input.match(/^\\/{2,}/);\n }\n if (!match) {\n return protocol + input;\n }\n return protocol + input.slice(match[0].length);\n}\nfunction normalizeURL(input) {\n const parsed = parseURL(input);\n parsed.pathname = encodePath(decodePath(parsed.pathname));\n parsed.hash = encodeHash(decode(parsed.hash));\n parsed.host = encodeHost(decode(parsed.host));\n parsed.search = stringifyQuery(parseQuery(parsed.search));\n return stringifyParsedURL(parsed);\n}\nfunction resolveURL(base = \"\", ...inputs) {\n if (typeof base !== \"string\") {\n throw new TypeError(\n `URL input should be string received ${typeof base} (${base})`\n );\n }\n const filteredInputs = inputs.filter((input) => isNonEmptyURL(input));\n if (filteredInputs.length === 0) {\n return base;\n }\n const url = parseURL(base);\n for (const inputSegment of filteredInputs) {\n const urlSegment = parseURL(inputSegment);\n if (urlSegment.pathname) {\n url.pathname = withTrailingSlash(url.pathname) + withoutLeadingSlash(urlSegment.pathname);\n }\n if (urlSegment.hash && urlSegment.hash !== \"#\") {\n url.hash = urlSegment.hash;\n }\n if (urlSegment.search && urlSegment.search !== \"?\") {\n if (url.search && url.search !== \"?\") {\n const queryString = stringifyQuery({\n ...parseQuery(url.search),\n ...parseQuery(urlSegment.search)\n });\n url.search = queryString.length > 0 ? \"?\" + queryString : \"\";\n } else {\n url.search = urlSegment.search;\n }\n }\n }\n return stringifyParsedURL(url);\n}\nfunction isSamePath(p1, p2) {\n return decode(withoutTrailingSlash(p1)) === decode(withoutTrailingSlash(p2));\n}\nfunction isEqual(a, b, options = {}) {\n if (!options.trailingSlash) {\n a = withTrailingSlash(a);\n b = withTrailingSlash(b);\n }\n if (!options.leadingSlash) {\n a = withLeadingSlash(a);\n b = withLeadingSlash(b);\n }\n if (!options.encoding) {\n a = decode(a);\n b = decode(b);\n }\n return a === b;\n}\nfunction withFragment(input, hash) {\n if (!hash || hash === \"#\") {\n return input;\n }\n const parsed = parseURL(input);\n parsed.hash = hash === \"\" ? \"\" : \"#\" + encodeHash(hash);\n return stringifyParsedURL(parsed);\n}\nfunction withoutFragment(input) {\n return stringifyParsedURL({ ...parseURL(input), hash: \"\" });\n}\nfunction withoutHost(input) {\n const parsed = parseURL(input);\n return (parsed.pathname || \"/\") + parsed.search + parsed.hash;\n}\n\nconst protocolRelative = Symbol.for(\"ufo:protocolRelative\");\nfunction parseURL(input = \"\", defaultProto) {\n const _specialProtoMatch = input.match(\n /^[\\s\\0]*(blob:|data:|javascript:|vbscript:)(.*)/i\n );\n if (_specialProtoMatch) {\n const [, _proto, _pathname = \"\"] = _specialProtoMatch;\n return {\n protocol: _proto.toLowerCase(),\n pathname: _pathname,\n href: _proto + _pathname,\n auth: \"\",\n host: \"\",\n search: \"\",\n hash: \"\"\n };\n }\n if (!hasProtocol(input, { acceptRelative: true })) {\n return defaultProto ? parseURL(defaultProto + input) : parsePath(input);\n }\n const [, protocol = \"\", auth, hostAndPath = \"\"] = input.replace(/\\\\/g, \"/\").match(/^[\\s\\0]*([\\w+.-]{2,}:)?\\/\\/([^/@]+@)?(.*)/) || [];\n let [, host = \"\", path = \"\"] = hostAndPath.match(/([^#/?]*)(.*)?/) || [];\n if (protocol === \"file:\") {\n path = path.replace(/\\/(?=[A-Za-z]:)/, \"\");\n }\n const { pathname, search, hash } = parsePath(path);\n return {\n protocol: protocol.toLowerCase(),\n auth: auth ? auth.slice(0, Math.max(0, auth.length - 1)) : \"\",\n host,\n pathname,\n search,\n hash,\n [protocolRelative]: !protocol\n };\n}\nfunction parsePath(input = \"\") {\n const [pathname = \"\", search = \"\", hash = \"\"] = (input.match(/([^#?]*)(\\?[^#]*)?(#.*)?/) || []).splice(1);\n return {\n pathname,\n search,\n hash\n };\n}\nfunction parseAuth(input = \"\") {\n const [username, password] = input.split(\":\");\n return {\n username: decode(username),\n password: decode(password)\n };\n}\nfunction parseHost(input = \"\") {\n const [hostname, port] = (input.match(/([^/:]*):?(\\d+)?/) || []).splice(1);\n return {\n hostname: decode(hostname),\n port\n };\n}\nfunction stringifyParsedURL(parsed) {\n const pathname = parsed.pathname || \"\";\n const search = parsed.search ? (parsed.search.startsWith(\"?\") ? \"\" : \"?\") + parsed.search : \"\";\n const hash = parsed.hash || \"\";\n const auth = parsed.auth ? parsed.auth + \"@\" : \"\";\n const host = parsed.host || \"\";\n const proto = parsed.protocol || parsed[protocolRelative] ? (parsed.protocol || \"\") + \"//\" : \"\";\n return proto + auth + host + pathname + search + hash;\n}\nconst FILENAME_STRICT_REGEX = /\\/([^/]+\\.[^/]+)$/;\nconst FILENAME_REGEX = /\\/([^/]+)$/;\nfunction parseFilename(input = \"\", opts) {\n const { pathname } = parseURL(input);\n const matches = opts?.strict ? pathname.match(FILENAME_STRICT_REGEX) : pathname.match(FILENAME_REGEX);\n return matches ? matches[1] : void 0;\n}\n\nclass $URL {\n protocol;\n host;\n auth;\n pathname;\n query = {};\n hash;\n constructor(input = \"\") {\n if (typeof input !== \"string\") {\n throw new TypeError(\n `URL input should be string received ${typeof input} (${input})`\n );\n }\n const parsed = parseURL(input);\n this.protocol = decode(parsed.protocol);\n this.host = decode(parsed.host);\n this.auth = decode(parsed.auth);\n this.pathname = decodePath(parsed.pathname);\n this.query = parseQuery(parsed.search);\n this.hash = decode(parsed.hash);\n }\n get hostname() {\n return parseHost(this.host).hostname;\n }\n get port() {\n return parseHost(this.host).port || \"\";\n }\n get username() {\n return parseAuth(this.auth).username;\n }\n get password() {\n return parseAuth(this.auth).password || \"\";\n }\n get hasProtocol() {\n return this.protocol.length;\n }\n get isAbsolute() {\n return this.hasProtocol || this.pathname[0] === \"/\";\n }\n get search() {\n const q = stringifyQuery(this.query);\n return q.length > 0 ? \"?\" + q : \"\";\n }\n get searchParams() {\n const p = new URLSearchParams();\n for (const name in this.query) {\n const value = this.query[name];\n if (Array.isArray(value)) {\n for (const v of value) {\n p.append(name, v);\n }\n } else {\n p.append(\n name,\n typeof value === \"string\" ? value : JSON.stringify(value)\n );\n }\n }\n return p;\n }\n get origin() {\n return (this.protocol ? this.protocol + \"//\" : \"\") + encodeHost(this.host);\n }\n get fullpath() {\n return encodePath(this.pathname) + this.search + encodeHash(this.hash);\n }\n get encodedAuth() {\n if (!this.auth) {\n return \"\";\n }\n const { username, password } = parseAuth(this.auth);\n return encodeURIComponent(username) + (password ? \":\" + encodeURIComponent(password) : \"\");\n }\n get href() {\n const auth = this.encodedAuth;\n const originWithAuth = (this.protocol ? this.protocol + \"//\" : \"\") + (auth ? auth + \"@\" : \"\") + encodeHost(this.host);\n return this.hasProtocol && this.isAbsolute ? originWithAuth + this.fullpath : this.fullpath;\n }\n append(url) {\n if (url.hasProtocol) {\n throw new Error(\"Cannot append a URL with protocol\");\n }\n Object.assign(this.query, url.query);\n if (url.pathname) {\n this.pathname = withTrailingSlash(this.pathname) + withoutLeadingSlash(url.pathname);\n }\n if (url.hash) {\n this.hash = url.hash;\n }\n }\n toJSON() {\n return this.href;\n }\n toString() {\n return this.href;\n }\n}\nfunction createURL(input) {\n return new $URL(input);\n}\n\nexport { $URL, cleanDoubleSlashes, createURL, decode, decodePath, decodeQueryKey, decodeQueryValue, encode, encodeHash, encodeHost, encodeParam, encodePath, encodeQueryItem, encodeQueryKey, encodeQueryValue, filterQuery, getQuery, hasLeadingSlash, hasProtocol, hasTrailingSlash, isEmptyURL, isEqual, isNonEmptyURL, isRelative, isSamePath, isScriptProtocol, joinRelativeURL, joinURL, normalizeURL, parseAuth, parseFilename, parseHost, parsePath, parseQuery, parseURL, resolveURL, stringifyParsedURL, stringifyQuery, withBase, withFragment, withHttp, withHttps, withLeadingSlash, withProtocol, withQuery, withTrailingSlash, withoutBase, withoutFragment, withoutHost, withoutLeadingSlash, withoutProtocol, withoutTrailingSlash };\n","/**\n * Path utilities: delegate to ufo for URL/paths; custom logic only for route names (kebab/slash).\n */\nimport type { QueryObject } from 'ufo'\nimport {\n cleanDoubleSlashes,\n hasProtocol,\n isEmptyURL,\n joinURL,\n parseFilename,\n parsePath,\n withFragment,\n withLeadingSlash,\n withoutTrailingSlash,\n withQuery,\n} from 'ufo'\n\n/** Path segments without leading/repeated slashes (ufo parsePath.pathname). */\nexport function getPathSegments(pathOrSlashKey: string): string[] {\n const pathname = parsePath(pathOrSlashKey.startsWith('/') ? pathOrSlashKey : `/${pathOrSlashKey}`).pathname || ''\n return pathname.split('/').filter(Boolean)\n}\n\nexport const normalizePath = (p: string): string => {\n if (isEmptyURL(p ?? '')) return '/'\n return withLeadingSlash(withoutTrailingSlash(cleanDoubleSlashes(p))) || '/'\n}\n\n/** Path for comparison: collapse slashes, remove trailing slash, empty -> '/'. */\nexport function normalizePathForCompare(p: string): string {\n const collapsed = cleanDoubleSlashes(p || '/')\n const trimmed = withoutTrailingSlash(collapsed)\n return trimmed || '/'\n}\n\n/**\n * Join URL segments (ufo handles protocols and slashes correctly).\n * For path-style (no protocol) result always has leading slash.\n */\nexport function joinUrl(...segments: (string | undefined | null)[]): string {\n const valid = segments.filter((s): s is string => typeof s === 'string' && s !== '')\n if (valid.length === 0) return '/'\n const [base, ...rest] = valid\n const joined = joinURL(base!, ...rest) || '/'\n if (hasProtocol(joined)) return joined\n return withLeadingSlash(joined)\n}\n\n/**\n * Safely strips query and hash from path (ufo parsePath).\n * /news?id=1#top -> /news\n */\nexport function getCleanPath(path: string | null | undefined): string {\n if (!path) return ''\n const parsed = parsePath(path)\n return parsed.pathname || ''\n}\n\n/**\n * Builds full URL from path, query and hash (ufo withQuery + withFragment).\n */\nexport function buildUrl(path: string, query?: Record<string, unknown>, hash?: string): string {\n let url = withQuery(path, (query ?? {}) as QueryObject)\n if (hash && hash !== '#') {\n const fragment = hash.startsWith('#') ? hash.slice(1) : hash\n url = withFragment(url, fragment)\n }\n return url\n}\n\n/**\n * Parent path. /a/b/c -> /a/b, /a -> /, / -> null\n */\nexport function getParentPath(routePath: string): string | null {\n const segments = getPathSegments(routePath)\n if (segments.length === 0) return null\n if (segments.length <= 1) return '/'\n return joinUrl('/', ...segments.slice(0, -1))\n}\n\n/**\n * kebab -> path key: activity-skiing-locale -> activity/skiing/locale\n */\nexport function transformNameKeyToPath(nameKey: string): string {\n if (!nameKey) return ''\n let out = ''\n for (let i = 0; i < nameKey.length; i++) {\n out += nameKey[i] === '-' ? '/' : nameKey[i]\n }\n return out\n}\n\n/** First hyphen -> slash: activity-skiing-locale -> activity/skiing-locale */\nexport function nameKeyFirstSlash(nameKey: string): string {\n if (!nameKey) return ''\n const idx = nameKey.indexOf('-')\n return idx === -1 ? nameKey : joinURL(nameKey.slice(0, idx), nameKey.slice(idx + 1))\n}\n\n/** Last hyphen -> slash: activity-locale-skiing -> activity-locale/skiing */\nexport function nameKeyLastSlash(nameKey: string): string {\n if (!nameKey) return ''\n const idx = nameKey.lastIndexOf('-')\n return idx === -1 ? nameKey : joinURL(nameKey.slice(0, idx), nameKey.slice(idx + 1))\n}\n\n/** Parent key from slash-key: activity-locale/hiking -> activity-locale; a/b/c -> a-b */\nexport function parentKeyFromSlashKey(keyWithSlash: string): string {\n const segments = getPathSegments(keyWithSlash)\n return segments.length > 1 ? segments.slice(0, -1).join('-') : ''\n}\n\n/** Last path segment: /change-activity/hiking -> hiking (ufo parseFilename). */\nexport function lastPathSegment(path: string): string {\n return parseFilename(path || '/') ?? ''\n}\n","/**\n * Path normalization: extract locale from path and pathWithoutLocale (ufo getCleanPath, hasLeadingSlash).\n */\nimport { hasLeadingSlash } from 'ufo'\nimport { getCleanPath, normalizePath } from '../utils/path'\n\nexport interface PathWithoutLocaleResult {\n pathWithoutLocale: string\n localeFromPath: string | null\n}\n\n/**\n * Parses path: if first segment is a known locale, returns path without it and locale code.\n */\nexport function getPathWithoutLocale(path: string, localeCodes: string[]): PathWithoutLocaleResult {\n const clean = getCleanPath(path)\n const normalized = normalizePath(clean)\n\n if (normalized === '/') {\n return { pathWithoutLocale: '/', localeFromPath: null }\n }\n\n if (!hasLeadingSlash(normalized)) {\n return { pathWithoutLocale: normalized, localeFromPath: null }\n }\n\n const nextSlash = normalized.indexOf('/', 1)\n const firstSegment = nextSlash === -1 ? normalized.slice(1) : normalized.slice(1, nextSlash)\n\n if (firstSegment && localeCodes.includes(firstSegment)) {\n const lengthToCut = 1 + firstSegment.length\n const remaining = normalized.slice(lengthToCut)\n return {\n pathWithoutLocale: normalizePath(remaining || '/'),\n localeFromPath: firstSegment,\n }\n }\n\n return { pathWithoutLocale: normalized, localeFromPath: null }\n}\n\n/**\n * Determines locale from first path segment.\n */\nexport function getLocaleFromPath(path: string, localeCodes: string[]): string | null {\n const clean = getCleanPath(path)\n\n if (clean === '/' || clean === '') return null\n\n if (!hasLeadingSlash(clean)) return null\n\n const nextSlash = clean.indexOf('/', 1)\n const segment = nextSlash === -1 ? clean.slice(1) : clean.slice(1, nextSlash)\n if (segment && localeCodes.includes(segment)) {\n return segment\n }\n\n return null\n}\n","/**\n * Route name utilities: base name, localized name.\n */\n\nimport type { Locale } from '@i18n-micro/types'\nimport type { RouteLike } from '../core/types'\n\nexport interface GetRouteBaseNameOptions {\n locales: Pick<Locale, 'code'>[]\n localizedRouteNamePrefix?: string\n}\n\n/**\n * Base route name without prefix (localized-) and suffix (-{locale}).\n * Suffix is stripped only when it is a full segment (preceded by hyphen),\n * so names like product-screen are not broken when locale is en.\n */\nexport function getRouteBaseName(route: RouteLike, options: GetRouteBaseNameOptions): string | null {\n const name = route.name?.toString()\n if (!name) return null\n\n const prefix = options.localizedRouteNamePrefix || 'localized-'\n const base = name.startsWith(prefix) ? name.slice(prefix.length) : name\n\n // Sort by length descending: en-US before en — otherwise we strip the wrong suffix\n const sortedLocales = [...options.locales].sort((a, b) => b.code.length - a.code.length)\n\n for (const locale of sortedLocales) {\n const suffix = `-${locale.code}`\n if (!base.endsWith(suffix)) continue\n // Strip only when locale code is a separate segment (preceded by hyphen: ...-en, not ...screen)\n const charBeforeLocale = base.length - locale.code.length - 1\n if (charBeforeLocale >= 0 && base[charBeforeLocale] === '-') {\n return base.slice(0, -suffix.length)\n }\n }\n return base\n}\n\n/** Builds localized name: localized-{baseName}-{locale}. */\nexport function buildLocalizedName(baseName: string, locale: string, prefix = 'localized-'): string {\n return `${prefix}${baseName}-${locale}`\n}\n\nexport interface IsIndexRouteNameOptions {\n localizedRouteNamePrefix?: string\n localeCodes?: string[]\n}\n\n/**\n * Returns true if the given route name or base name refers to the index (root) route.\n * - Base name: 'index' or ''.\n * - Full route name: 'index', or 'localized-index-{locale}' for any locale in localeCodes.\n * Use this instead of ad-hoc checks like (name === 'index' || name.endsWith('-index') || name === 'localized-index-' + defaultLocale).\n */\nexport function isIndexRouteName(name: string | null | undefined, options?: IsIndexRouteNameOptions): boolean {\n if (name == null) return false\n const s = String(name).trim()\n if (s === '' || s === 'index') return true\n const prefix = options?.localizedRouteNamePrefix ?? 'localized-'\n const localeCodes = options?.localeCodes ?? []\n const localizedIndexPrefix = `${prefix}index-`\n if (!s.startsWith(localizedIndexPrefix)) return false\n const localePart = s.slice(localizedIndexPrefix.length)\n return localeCodes.length === 0 ? localePart.length >= 2 : localeCodes.includes(localePart)\n}\n","/**\n * RouteResolver — single point for resolving custom paths from globalLocaleRoutes.\n * Uses normalizer and route-name utilities; lookup keys in one place (getLookupKeys).\n */\n\nimport { withoutLeadingSlash } from 'ufo'\nimport { joinUrl, nameKeyFirstSlash, nameKeyLastSlash, normalizePath, transformNameKeyToPath } from '../utils/path'\nimport { getRouteBaseName } from '../utils/route-name'\nimport { getPathWithoutLocale } from './normalizer'\nimport type { PathStrategyContext, ResolvedRouteLike } from './types'\n\n/**\n * Single pre-compiled regex that matches all Nuxt route param patterns in one pass:\n * :key() — optional param (group 1)\n * :key — required param (group 2, not followed by word char)\n * [...key] — catch-all param (group 3)\n */\nconst PARAM_PATTERN = /:(\\w+)\\(\\)|:(\\w+)(?!\\w)|\\[\\.\\.\\.(\\w+)\\]/g\n\nexport class RouteResolver {\n constructor(private ctx: PathStrategyContext) {}\n\n /**\n * Substitutes params into path template (:key, :key(), [...key]).\n * Uses a single pre-compiled regex for all keys in one pass — no per-key RegExp allocation.\n */\n resolvePathWithParams(path: string, params: Record<string, unknown> = {}): string {\n if (!params || Object.keys(params).length === 0) return path\n\n return path.replace(PARAM_PATTERN, (match, optKey?: string, reqKey?: string, catchAllKey?: string) => {\n const key = optKey || reqKey || catchAllKey\n if (!key) return match\n\n const value = params[key]\n if (value === undefined || value === null || value === '') return match\n\n return Array.isArray(value) ? (value as unknown[]).join('/') : String(value)\n })\n }\n\n /**\n * Analyzes route: path without locale and base name (normalizer + route-name).\n */\n private analyzeRoute(route: ResolvedRouteLike): { pathWithoutLocale: string; baseRouteName: string | null } {\n const localeCodes = this.ctx.locales.map((l) => l.code)\n const { pathWithoutLocale } = getPathWithoutLocale(route.path || '/', localeCodes)\n\n let baseRouteName: string | null = null\n if (route.name) {\n baseRouteName = getRouteBaseName(route, {\n locales: this.ctx.locales,\n localizedRouteNamePrefix: this.ctx.localizedRouteNamePrefix || 'localized-',\n })\n }\n\n return { pathWithoutLocale, baseRouteName }\n }\n\n /** Public access to route analysis (for strategies). */\n getPathWithoutLocaleAndBaseName(route: ResolvedRouteLike): { pathWithoutLocale: string; baseRouteName: string | null } {\n return this.analyzeRoute(route)\n }\n\n /**\n * Lookup keys for config (same order for resolveCustomPath, getPathForUnlocalizedRoute, getAllowedLocalesForRoute).\n */\n private getLookupKeys(pathWithoutLocale: string, baseRouteName: string | null): string[] {\n const keys: string[] = []\n\n keys.push(pathWithoutLocale)\n\n const pathKey = withoutLeadingSlash(pathWithoutLocale)\n if (pathKey && pathKey !== pathWithoutLocale) keys.push(pathKey)\n // Support root path lookup: '' as key when path is '/'\n if (pathWithoutLocale === '/' || pathKey === '') keys.push('')\n\n if (baseRouteName) {\n keys.push(`/${baseRouteName}`)\n keys.push(baseRouteName)\n\n const asPath = transformNameKeyToPath(baseRouteName)\n if (asPath && asPath !== baseRouteName) keys.push(asPath)\n\n const firstSlash = nameKeyFirstSlash(baseRouteName)\n if (firstSlash) keys.push(firstSlash)\n\n const lastSlash = nameKeyLastSlash(baseRouteName)\n if (lastSlash) keys.push(lastSlash)\n }\n\n return keys\n }\n\n /**\n * Resolves custom path for targetLocale from globalLocaleRoutes.\n */\n resolveCustomPath(route: ResolvedRouteLike, targetLocale: string): string | null {\n const gr = this.ctx.globalLocaleRoutes\n if (!gr || Object.keys(gr).length === 0) return null\n\n const { pathWithoutLocale, baseRouteName } = this.analyzeRoute(route)\n const keys = this.getLookupKeys(pathWithoutLocale, baseRouteName)\n\n for (const key of keys) {\n const rule = gr[key]\n if (rule && typeof rule === 'object' && !Array.isArray(rule)) {\n const customPath = (rule as Record<string, string>)[targetLocale]\n if (typeof customPath === 'string') {\n return this.resolvePathWithParams(customPath, route.params ?? {})\n }\n }\n }\n\n return null\n }\n\n /**\n * Unlocalized route (globalLocaleRoutes[key] === false) — returns path without locale.\n */\n getPathForUnlocalizedRoute(route: ResolvedRouteLike): string | null {\n const gr = this.ctx.globalLocaleRoutes\n if (!gr) return null\n\n const { pathWithoutLocale, baseRouteName } = this.analyzeRoute(route)\n const keys = this.getLookupKeys(pathWithoutLocale, baseRouteName)\n\n for (const key of keys) {\n if (gr[key] === false) {\n if (baseRouteName && (key === baseRouteName || key === `/${baseRouteName}`)) {\n const pathForm = transformNameKeyToPath(baseRouteName)\n return pathForm ? joinUrl('/', pathForm) : `/${baseRouteName}`\n }\n return pathWithoutLocale\n }\n }\n\n return null\n }\n\n /**\n * Unlocalized by name (when no route object available).\n */\n getPathForUnlocalizedRouteByName(routeName: string): string | null {\n const gr = this.ctx.globalLocaleRoutes\n if (!gr) return null\n\n const keys = [routeName, `/${routeName}`, withoutLeadingSlash(routeName)]\n\n for (const key of keys) {\n if (gr[key] === false) {\n const pathForm = transformNameKeyToPath(key.startsWith('/') ? key.slice(1) : key)\n return pathForm ? joinUrl('/', pathForm) : key.startsWith('/') ? key : `/${key}`\n }\n }\n return null\n }\n\n /**\n * Allowed locales for route (routeLocales).\n */\n getAllowedLocalesForRoute(route: ResolvedRouteLike): string[] {\n const rl = this.ctx.routeLocales\n if (!rl || Object.keys(rl).length === 0) {\n return this.ctx.locales.map((l) => l.code)\n }\n\n const { pathWithoutLocale, baseRouteName } = this.analyzeRoute(route)\n let keys = this.getLookupKeys(pathWithoutLocale, baseRouteName)\n\n if (baseRouteName && this.ctx.routesLocaleLinks?.[baseRouteName]) {\n const linkedName = this.ctx.routesLocaleLinks[baseRouteName]\n keys = [linkedName, ...keys]\n }\n\n for (const key of keys) {\n const allowed = rl[key]\n if (Array.isArray(allowed) && allowed.length > 0) {\n return allowed.filter((code) => this.ctx.locales.some((l) => l.code === code))\n }\n }\n\n return this.ctx.locales.map((l) => l.code)\n }\n\n /**\n * Parent path for nested route (parent key -> targetLocale path).\n */\n getParentPathForNested(nameSegments: string[], targetLocale: string): string {\n if (nameSegments.length <= 1) return '/'\n\n const parentKey = nameSegments.length > 1 ? nameSegments.slice(0, -1).join('-') : ''\n const gr = this.ctx.globalLocaleRoutes\n\n if (parentKey && gr?.[parentKey] && typeof gr[parentKey] === 'object') {\n const parentRules = gr[parentKey] as Record<string, string>\n if (parentRules[targetLocale]) {\n return normalizePath(parentRules[targetLocale])\n }\n }\n\n return joinUrl('/', ...nameSegments.slice(0, -1))\n }\n}\n","import type { Locale } from '@i18n-micro/types'\nimport { hasProtocol, withoutTrailingSlash } from 'ufo'\nimport { getLocaleFromPath as normalizerGetLocaleFromPath, getPathWithoutLocale as normalizerGetPathWithoutLocale } from '../core/normalizer'\nimport { RouteResolver } from '../core/resolver'\nimport type {\n NormalizedRouteInput,\n PathStrategy,\n PathStrategyContext,\n ResolvedRouteLike,\n RouteLike,\n RouterAdapter,\n SeoAttributes,\n SwitchLocaleOptions,\n} from '../core/types'\nimport { buildUrl, getPathSegments, joinUrl, nameKeyFirstSlash, nameKeyLastSlash, normalizePath, transformNameKeyToPath } from '../utils/path'\nimport { isIndexRouteName, buildLocalizedName as utilBuildLocalizedName, getRouteBaseName as utilGetRouteBaseName } from '../utils/route-name'\n\nexport abstract class BasePathStrategy implements PathStrategy {\n protected resolver: RouteResolver\n\n constructor(protected ctx: PathStrategyContext) {\n this.resolver = new RouteResolver(ctx)\n }\n\n setRouter(router: RouterAdapter): void {\n this.ctx.router = router\n }\n\n getDefaultLocale(): string {\n return this.ctx.defaultLocale\n }\n\n getLocales(): Locale[] {\n return this.ctx.locales\n }\n\n getStrategy(): PathStrategyContext['strategy'] {\n return this.ctx.strategy\n }\n\n getLocalizedRouteNamePrefix(): string {\n return this.ctx.localizedRouteNamePrefix || 'localized-'\n }\n\n getGlobalLocaleRoutes(): PathStrategyContext['globalLocaleRoutes'] {\n return this.ctx.globalLocaleRoutes\n }\n\n getRouteLocales(): PathStrategyContext['routeLocales'] {\n return this.ctx.routeLocales\n }\n\n getRoutesLocaleLinks(): PathStrategyContext['routesLocaleLinks'] {\n return this.ctx.routesLocaleLinks\n }\n\n getNoPrefixRedirect(): boolean | undefined {\n return this.ctx.noPrefixRedirect\n }\n\n /**\n * Returns base route name without locale prefix/suffix.\n * @param route - Route object\n * @param locale - Optional locale to strip suffix for (if not provided, tries all locales)\n */\n getRouteBaseName(route: RouteLike, locale?: string): string | null {\n const locales = locale ? [{ code: locale }] : this.ctx.locales\n return utilGetRouteBaseName(route, {\n locales,\n localizedRouteNamePrefix: this.getLocalizedRouteNamePrefix(),\n })\n }\n\n /** Alias for internal use - strips localization prefix/suffix for specific locale. */\n protected getBaseRouteName(route: RouteLike, locale: string): string | null {\n return this.getRouteBaseName(route, locale)\n }\n\n /** Resolves target path for a locale, checking globalLocaleRoutes first. */\n protected resolvePathForLocale(path: string, targetLocale: string): string {\n const mockRoute: ResolvedRouteLike = {\n path,\n name: null,\n fullPath: path,\n params: {},\n }\n const customSegment = this.resolver.resolveCustomPath(mockRoute, targetLocale)\n if (customSegment) return normalizePath(customSegment)\n return normalizePath(path)\n }\n\n protected buildLocalizedName(baseName: string, locale: string): string {\n return utilBuildLocalizedName(baseName, locale, this.getLocalizedRouteNamePrefix())\n }\n\n /** Builds path for target locale (strategy decides: with or without prefix). */\n protected abstract buildLocalizedPath(path: string, locale: string, isCustom: boolean): string\n\n /** Builds localized route name for target locale. */\n protected abstract buildLocalizedRouteName(baseName: string, locale: string): string\n\n protected getLocaleObject(code: string): Locale | undefined {\n return this.ctx.locales.find((l) => l.code === code)\n }\n\n protected applyBaseUrl(localeCode: string, route: RouteLike | string): RouteLike | string {\n if (typeof route === 'string') {\n if (hasProtocol(route)) return route\n } else if (route.path && hasProtocol(route.path)) {\n return route\n }\n\n const locale = this.getLocaleObject(localeCode)\n if (!locale?.baseUrl) {\n return route\n }\n\n const baseUrl = withoutTrailingSlash(locale.baseUrl)\n\n if (typeof route === 'string') {\n const path = normalizePath(route.startsWith('/') ? route : `/${route}`)\n return joinUrl(baseUrl, path)\n }\n\n const resolvedPath = normalizePath(route.path || '')\n const fullPath = joinUrl(baseUrl, resolvedPath)\n // For external URLs (with protocol), return string to prevent NuxtLink from adding base path\n if (hasProtocol(fullPath)) {\n return fullPath\n }\n return {\n ...route,\n path: fullPath,\n fullPath,\n }\n }\n\n /**\n * Merges target route (strategy result) with query and hash from source route.\n * Returns normalized RouteLike object.\n */\n protected preserveQueryAndHash(target: RouteLike | string, source?: RouteLike | null): RouteLike | string {\n if (!source || (!source.query && !source.hash)) {\n return target\n }\n\n const result: RouteLike = typeof target === 'string' ? { path: target } : { ...target }\n\n if (source.query) {\n result.query = { ...source.query, ...result.query }\n }\n if (!result.hash && source.hash) {\n result.hash = source.hash\n }\n\n const basePath = result.path ?? ''\n result.fullPath = buildUrl(basePath, result.query, result.hash)\n\n return result\n }\n\n protected resolvePathWithParams(path: string, params: Record<string, unknown> = {}): string {\n return this.resolver.resolvePathWithParams(path, params)\n }\n\n protected getPathWithoutLocaleAndBaseName(route: ResolvedRouteLike): { pathWithoutLocale: string; baseRouteName: string | null } {\n return this.resolver.getPathWithoutLocaleAndBaseName(route)\n }\n\n /** Look up custom path segment for targetLocale in globalLocaleRoutes. */\n protected getCustomPathSegment(route: ResolvedRouteLike, targetLocale: string): string | null {\n return this.resolver.resolveCustomPath(route, targetLocale)\n }\n\n protected getAllowedLocalesForRoute(route: ResolvedRouteLike): string[] {\n return this.resolver.getAllowedLocalesForRoute(route)\n }\n\n getCanonicalPath(_route: ResolvedRouteLike, _targetLocale: string): string | null {\n return null\n }\n\n protected getPathForUnlocalizedRouteByName(routeName: string): string | null {\n return this.resolver.getPathForUnlocalizedRouteByName(routeName)\n }\n\n /**\n * Try to resolve route by localized name. Returns RouteLike with query/hash from sourceRoute to preserve them.\n */\n protected tryResolveByLocalizedName(routeName: string, targetLocale: string, sourceRoute?: RouteLike): RouteLike | null {\n const prefix = this.getLocalizedRouteNamePrefix()\n // Try with locale suffix first (custom paths), then without (standard routes)\n const localizedNameWithSuffix = `${prefix}${routeName}-${targetLocale}`\n const localizedNameWithoutSuffix = `${prefix}${routeName}`\n\n let localizedName: string\n if (this.ctx.router.hasRoute(localizedNameWithSuffix)) {\n localizedName = localizedNameWithSuffix\n } else if (this.ctx.router.hasRoute(localizedNameWithoutSuffix)) {\n localizedName = localizedNameWithoutSuffix\n } else {\n this.debugLog('tryResolveByLocalizedName', {\n routeName,\n targetLocale,\n tried: [localizedNameWithSuffix, localizedNameWithoutSuffix],\n found: false,\n })\n return null\n }\n\n this.debugLog('tryResolveByLocalizedName', { routeName, targetLocale, localizedName, found: true })\n // If using route without locale suffix (e.g. localized-page), add locale param\n const params = { ...sourceRoute?.params }\n if (localizedName === localizedNameWithoutSuffix) {\n params.locale = targetLocale\n }\n let resolved: ReturnType<typeof this.ctx.router.resolve>\n try {\n resolved = this.ctx.router.resolve({\n name: localizedName,\n params,\n query: sourceRoute?.query,\n hash: sourceRoute?.hash,\n })\n } catch {\n // Router threw error (e.g. missing required param) - try path-based fallback\n this.debugLog('tryResolveByLocalizedName resolve error', { localizedName, params })\n return null\n }\n this.debugLog('tryResolveByLocalizedName resolved', { localizedName, path: resolved?.path, fullPath: resolved?.fullPath })\n if (!resolved?.path) return null\n return {\n name: localizedName,\n path: resolved.path,\n fullPath: resolved.fullPath,\n params: resolved.params,\n query: resolved.query ?? sourceRoute?.query,\n hash: resolved.hash ?? sourceRoute?.hash,\n }\n }\n\n /**\n * Try to resolve route by localized name with params. Returns RouteLike to preserve query/hash.\n */\n protected tryResolveByLocalizedNameWithParams(\n routeName: string,\n targetLocale: string,\n params: Record<string, unknown>,\n sourceRoute?: RouteLike,\n ): RouteLike | null {\n const prefix = this.getLocalizedRouteNamePrefix()\n // Try with locale suffix first (custom paths), then without (standard routes)\n const localizedNameWithSuffix = `${prefix}${routeName}-${targetLocale}`\n const localizedNameWithoutSuffix = `${prefix}${routeName}`\n\n let localizedName: string\n if (this.ctx.router.hasRoute(localizedNameWithSuffix)) {\n localizedName = localizedNameWithSuffix\n } else if (this.ctx.router.hasRoute(localizedNameWithoutSuffix)) {\n localizedName = localizedNameWithoutSuffix\n } else {\n this.debugLog('tryResolveByLocalizedNameWithParams', {\n routeName,\n targetLocale,\n params,\n tried: [localizedNameWithSuffix, localizedNameWithoutSuffix],\n found: false,\n })\n return null\n }\n\n this.debugLog('tryResolveByLocalizedNameWithParams', { routeName, targetLocale, params, localizedName, found: true })\n // If using route without locale suffix (e.g. localized-page), add locale param\n const resolveParams = { ...params }\n if (localizedName === localizedNameWithoutSuffix) {\n resolveParams.locale = targetLocale\n }\n let resolved: ReturnType<typeof this.ctx.router.resolve>\n try {\n resolved = this.ctx.router.resolve({\n name: localizedName,\n params: resolveParams,\n query: sourceRoute?.query,\n hash: sourceRoute?.hash,\n })\n } catch {\n // Router threw error (e.g. missing required param) - return null\n this.debugLog('tryResolveByLocalizedNameWithParams resolve error', { localizedName, resolveParams })\n return null\n }\n this.debugLog('tryResolveByLocalizedNameWithParams resolved', { path: resolved?.path, fullPath: resolved?.fullPath })\n if (!resolved?.path || resolved.path === '/') return null\n return {\n name: localizedName,\n path: resolved.path,\n fullPath: resolved.fullPath,\n params: resolved.params,\n query: resolved.query ?? sourceRoute?.query,\n hash: resolved.hash ?? sourceRoute?.hash,\n }\n }\n\n protected getPathForUnlocalizedRoute(route: ResolvedRouteLike): string | null {\n return this.resolver.getPathForUnlocalizedRoute(route)\n }\n\n /**\n * Builds localized path from baseName + params when router does not have the route.\n * Tries two conventions:\n * 1) Hyphen form (Nuxt test-[id].vue → /test-:id): when single param key equals last baseName segment (e.g. test-id + id → test-:id).\n * 2) Slash form (kebab→slash): path segments from baseName, last N replaced by :paramKey (e.g. test-id → /test/:id).\n */\n protected buildPathFromBaseNameAndParams(baseName: string, params: Record<string, unknown>, targetLocale: string): string | null {\n const paramKeys = Object.keys(params).filter((k) => params[k] !== undefined && params[k] !== null && params[k] !== '')\n if (paramKeys.length === 0) return null\n let pathTemplate: string\n const firstKey = paramKeys[0]\n if (paramKeys.length === 1 && firstKey !== undefined && baseName.endsWith(`-${firstKey}`)) {\n pathTemplate = joinUrl('/', `${baseName.slice(0, baseName.length - firstKey.length - 1)}-:${firstKey}`)\n } else {\n const pathForm = transformNameKeyToPath(baseName)\n const pathSegments = pathForm ? pathForm.split('/').filter(Boolean) : [baseName]\n const replaceCount = Math.min(paramKeys.length, pathSegments.length)\n const templateSegments = pathSegments.slice(0, pathSegments.length - replaceCount).concat(paramKeys.slice(0, replaceCount).map((k) => `:${k}`))\n pathTemplate = joinUrl('/', ...templateSegments)\n }\n const pathWithParams = this.resolvePathWithParams(pathTemplate, params)\n const finalPath = this.buildLocalizedPath(pathWithParams, targetLocale, false)\n const withBase = this.applyBaseUrl(targetLocale, finalPath)\n return typeof withBase === 'string' ? withBase : ((withBase as RouteLike).path ?? finalPath)\n }\n\n protected getPathWithoutLocale(path: string): { pathWithoutLocale: string; localeFromPath: string | null } {\n return normalizerGetPathWithoutLocale(\n path,\n this.ctx.locales.map((l) => l.code),\n )\n }\n\n getLocaleFromPath(path: string): string | null {\n return normalizerGetLocaleFromPath(\n path,\n this.ctx.locales.map((l) => l.code),\n )\n }\n\n abstract resolveLocaleFromPath(path: string): string | null\n\n /**\n * Returns path to redirect to, or null if no redirect needed.\n * Use in middleware: strategy.getRedirect(to.fullPath, detectedLocale)\n */\n abstract getRedirect(currentPath: string, targetLocale: string): string | null\n\n /**\n * Returns path to redirect to for client-side navigation based on preferred locale.\n * Returns null if no redirect needed. Each strategy implements its own logic.\n */\n abstract getClientRedirect(currentPath: string, preferredLocale: string): string | null\n\n /**\n * Checks if the current path should return 404.\n * Returns error message if 404 should be returned, null otherwise.\n * Base implementation checks unlocalized routes and routeLocales restrictions.\n */\n shouldReturn404(currentPath: string): string | null {\n const { pathWithoutLocale, localeFromPath } = this.getPathWithoutLocale(currentPath)\n\n // No locale in URL - no 404 from strategy perspective\n if (localeFromPath === null) return null\n\n const pathKey = pathWithoutLocale === '/' ? '/' : pathWithoutLocale.replace(/^\\//, '')\n const gr = this.ctx.globalLocaleRoutes\n\n // Unlocalized route with locale prefix is 404\n if (gr && (gr[pathWithoutLocale] === false || gr[pathKey] === false)) {\n return 'Unlocalized route cannot have locale prefix'\n }\n\n // Check routeLocales restrictions\n const rl = this.ctx.routeLocales\n if (rl && Object.keys(rl).length > 0) {\n const allowed = rl[pathWithoutLocale] ?? rl[pathKey]\n if (Array.isArray(allowed) && allowed.length > 0) {\n const validCodes = this.ctx.locales.map((l) => l.code)\n const allowedCodes = allowed.filter((code) => validCodes.includes(code))\n if (allowedCodes.length > 0 && !allowedCodes.includes(localeFromPath)) {\n return 'Locale not allowed for this route'\n }\n }\n }\n\n return null\n }\n\n /**\n * Builds SEO attributes (canonical + hreflangs) from current route.\n * Respects routeLocales: only allowed locales for this route get an hreflang entry.\n * routesLocaleLinks is used when resolving the route key for routeLocales lookup.\n */\n getSeoAttributes(currentRoute: ResolvedRouteLike): SeoAttributes {\n const currentLocale = this.resolveLocaleFromPath(currentRoute.path) ?? this.ctx.defaultLocale\n const canonicalPath = this.getCanonicalPath(currentRoute, currentLocale) ?? currentRoute.path\n const canonical = this.buildFullUrl(currentLocale, canonicalPath)\n\n const allowedCodes = this.getAllowedLocalesForRoute(currentRoute)\n const localesToEmit = this.ctx.locales.filter((l) => allowedCodes.includes(l.code))\n const hreflangs = localesToEmit.map((locale) => {\n const localized = this.localeRoute(locale.code, currentRoute, currentRoute)\n const pathStr = localized.path ?? localized.fullPath ?? ''\n const normalizedPath = pathStr || '/'\n return {\n rel: 'alternate' as const,\n hreflang: locale.code,\n href: this.buildFullUrl(locale.code, normalizedPath),\n }\n })\n\n return { canonical, hreflangs }\n }\n\n /**\n * Builds full URL (path + optional baseUrl for locale).\n */\n protected buildFullUrl(localeCode: string, path: string): string {\n const result = this.applyBaseUrl(localeCode, path)\n return typeof result === 'string' ? result : (result.path ?? path)\n }\n\n /** When router knows neither targetName nor baseName — what to return (strategy may override). */\n protected getSwitchLocaleFallbackWhenNoRoute(route: ResolvedRouteLike, targetName: string): RouteLike | string {\n return { ...route, name: targetName }\n }\n\n /**\n * Default: baseName → buildLocalizedRouteName → hasRoute → applyBaseUrl; fallback to baseName.\n */\n switchLocaleRoute(fromLocale: string, toLocale: string, route: ResolvedRouteLike, options: SwitchLocaleOptions): RouteLike | string {\n const baseName = this.getBaseRouteName(route, fromLocale)\n if (!baseName) return route\n\n // Try route name with locale suffix first (custom paths), then without suffix (standard routes)\n const nameWithSuffix = this.buildLocalizedRouteName(baseName, toLocale)\n const nameWithoutSuffix = `${this.getLocalizedRouteNamePrefix()}${baseName}`\n let targetName: string\n let needsLocaleParam = false\n\n if (this.ctx.router.hasRoute(nameWithSuffix)) {\n targetName = nameWithSuffix\n } else if (this.ctx.router.hasRoute(nameWithoutSuffix)) {\n targetName = nameWithoutSuffix\n needsLocaleParam = true\n } else if (this.ctx.router.hasRoute(baseName)) {\n targetName = baseName\n } else {\n return this.getSwitchLocaleFallbackWhenNoRoute(route, nameWithSuffix)\n }\n\n const i18nParams = options.i18nRouteParams?.[toLocale] || {}\n const newParams: Record<string, unknown> = { ...(route.params || {}), ...i18nParams }\n // Add locale param if using route without locale suffix (e.g. localized-index with /:locale param)\n if (needsLocaleParam) {\n newParams.locale = toLocale\n } else {\n delete (newParams as Record<string, unknown>).locale\n }\n\n const newRoute: RouteLike = {\n name: targetName,\n params: newParams,\n query: route.query,\n hash: route.hash,\n }\n return this.applyBaseUrl(toLocale, newRoute)\n }\n\n /**\n * Template Method: BaseStrategy knows \"how\" (normalize → delegate to strategy).\n * Always returns RouteLike with path and fullPath (never a string).\n */\n localeRoute(targetLocale: string, routeOrPath: RouteLike | string, currentRoute?: ResolvedRouteLike): RouteLike {\n const normalized = this.normalizeRouteInput(routeOrPath, currentRoute)\n const raw = this.resolveLocaleRoute(targetLocale, normalized, currentRoute)\n this.debugLog('localeRoute raw', {\n rawPath: typeof raw === 'string' ? raw : (raw as RouteLike).path,\n rawFullPath: typeof raw === 'string' ? raw : (raw as RouteLike).fullPath,\n })\n const result = this.ensureRouteLike(raw, normalized.kind === 'route' ? normalized.sourceRoute : undefined)\n this.debugLog('localeRoute after ensureRouteLike', { path: result.path, fullPath: result.fullPath })\n return result\n }\n\n /** Normalizes resolveLocaleRoute result into RouteLike (path and fullPath always set). */\n protected ensureRouteLike(value: RouteLike | string, source?: RouteLike | null): RouteLike {\n if (typeof value === 'string') {\n const path = value\n const fullPath = source?.query || source?.hash ? buildUrl(path, source?.query, source?.hash) : path\n return {\n path,\n fullPath,\n ...(source?.query && { query: source.query }),\n ...(source?.hash && { hash: source.hash }),\n }\n }\n let fullPath = value.fullPath ?? value.path ?? ''\n let path = value.path ?? fullPath.split('?')[0]?.split('#')[0] ?? fullPath\n if (!path && !fullPath) {\n const name = value.name?.toString() ?? source?.name?.toString() ?? ''\n if (\n isIndexRouteName(name, {\n localizedRouteNamePrefix: this.getLocalizedRouteNamePrefix(),\n localeCodes: this.ctx.locales.map((l) => l.code),\n })\n ) {\n path = '/'\n fullPath = '/'\n }\n }\n return { ...value, path, fullPath }\n }\n\n /**\n * Normalizes localeRoute input into a single structure (path string or route with resolved).\n */\n protected normalizeRouteInput(routeOrPath: RouteLike | string, _currentRoute?: ResolvedRouteLike): NormalizedRouteInput {\n if (typeof routeOrPath === 'string') {\n return { kind: 'path', path: routeOrPath }\n }\n const sourceRoute = routeOrPath as RouteLike\n const inputName = sourceRoute.name?.toString() ?? null\n let resolved: ResolvedRouteLike\n try {\n resolved = this.ctx.router.resolve(routeOrPath)\n this.debugLog('normalizeRouteInput router.resolve ok', { inputName, resolvedPath: resolved.path, resolvedName: resolved.name })\n } catch {\n resolved = {\n name: inputName,\n path: sourceRoute.path ?? '/',\n fullPath: sourceRoute.fullPath ?? sourceRoute.path ?? '/',\n params: sourceRoute.params ?? {},\n query: sourceRoute.query ?? {},\n hash: sourceRoute.hash ?? '',\n } as ResolvedRouteLike\n this.debugLog('normalizeRouteInput router.resolve catch fallback', { inputName, resolvedPath: resolved.path })\n }\n return { kind: 'route', inputName, sourceRoute, resolved }\n }\n\n /** Logging when ctx.debug (for localeRoute debugging). Disabled by default. */\n private debugLog(..._args: unknown[]): void {\n // if (this.ctx.debug) console.log('[i18n:resolveLocaleRoute]', ..._args)\n }\n\n /**\n * Default resolution: uses buildLocalizedPath and buildLocalizedRouteName.\n * Strategies with different logic (e.g. prefix-except-default) override this method.\n */\n protected resolveLocaleRoute(targetLocale: string, normalized: NormalizedRouteInput, _currentRoute?: ResolvedRouteLike): RouteLike | string {\n if (normalized.kind === 'path') {\n const resolvedPath = this.resolvePathForLocale(normalized.path, targetLocale)\n const finalPath = this.buildLocalizedPath(resolvedPath, targetLocale, false)\n const out = this.applyBaseUrl(targetLocale, finalPath)\n this.debugLog('branch=path', { targetLocale, path: normalized.path, finalPath, out: typeof out === 'string' ? out : (out as RouteLike).path })\n return out\n }\n\n const { inputName, sourceRoute: src, resolved } = normalized\n const hasParams = src.params && Object.keys(src.params ?? {}).length > 0\n const baseName = this.getRouteBaseName(resolved) ?? inputName ?? resolved.name?.toString() ?? null\n const resolvedNameStr = resolved.name?.toString()\n\n this.debugLog('input', {\n targetLocale,\n inputName,\n resolvedPath: resolved.path,\n resolvedName: resolved.name,\n params: src.params,\n hasParams,\n baseName,\n })\n\n if (inputName) {\n const unlocalizedByName = this.getPathForUnlocalizedRouteByName(inputName)\n if (unlocalizedByName !== null) {\n this.debugLog('branch=unlocalizedByName', { inputName, unlocalizedByName })\n return this.preserveQueryAndHash(unlocalizedByName, src)\n }\n }\n\n if (inputName && hasParams) {\n const routeWithParams = this.tryResolveByLocalizedNameWithParams(inputName, targetLocale, src.params ?? {}, src)\n if (routeWithParams !== null) {\n this.debugLog('branch=routeWithParams', { inputName, path: routeWithParams.path, fullPath: routeWithParams.fullPath })\n return this.preserveQueryAndHash(this.applyBaseUrl(targetLocale, routeWithParams), src)\n }\n }\n\n // Resolve by inputName first; if not found and inputName looks like a localized name (prefix-base-locale), try baseName.\n // Do not try baseName when user asked for base name 'index' (resolved route may be current page -> baseName 'page').\n if (inputName && !hasParams) {\n let routeByLocalizedName = this.tryResolveByLocalizedName(inputName, targetLocale, src)\n const prefix = this.getLocalizedRouteNamePrefix()\n if (routeByLocalizedName === null && baseName != null && baseName !== inputName && inputName.startsWith(prefix)) {\n routeByLocalizedName = this.tryResolveByLocalizedName(baseName, targetLocale, src)\n }\n if (routeByLocalizedName !== null) {\n this.debugLog('branch=routeByLocalizedName', { inputName, path: routeByLocalizedName.path, fullPath: routeByLocalizedName.fullPath })\n return this.preserveQueryAndHash(this.applyBaseUrl(targetLocale, routeByLocalizedName), src)\n }\n }\n\n const unlocalizedPath = this.getPathForUnlocalizedRoute(resolved)\n if (unlocalizedPath !== null) {\n const path = this.buildLocalizedPath(unlocalizedPath, targetLocale, false)\n this.debugLog('branch=unlocalizedPath', { unlocalizedPath, path })\n return this.preserveQueryAndHash(this.applyBaseUrl(targetLocale, path), src)\n }\n\n const customSegment = this.getCustomPathSegment(resolved, targetLocale)\n if (customSegment !== null) {\n const routeName = resolved.name?.toString() ?? inputName ?? ''\n const keyFirstSlash = routeName ? nameKeyFirstSlash(routeName) : ''\n const keyLastSlash = routeName ? nameKeyLastSlash(routeName) : ''\n const gr = this.ctx.globalLocaleRoutes\n const isNestedFirst = keyFirstSlash.includes('/') && gr?.[keyFirstSlash]\n const isNestedLast = keyLastSlash.includes('/') && gr?.[keyLastSlash]\n const isNested = isNestedFirst || isNestedLast\n const keyWithSlash = isNestedLast ? keyLastSlash : keyFirstSlash\n let pathWithoutLocale: string\n if (isNested) {\n const nameSegments = getPathSegments(keyWithSlash)\n const parentKey = nameSegments.length > 1 ? nameSegments.slice(0, -1).join('-') : ''\n const parentRules =\n parentKey && gr?.[parentKey] && typeof gr[parentKey] === 'object' && !Array.isArray(gr[parentKey])\n ? (gr[parentKey] as Record<string, string>)\n : null\n const parentPath = parentRules?.[targetLocale] ? normalizePath(parentRules[targetLocale]) : joinUrl('/', ...nameSegments.slice(0, -1))\n const segment = customSegment.startsWith('/') ? customSegment.slice(1) : customSegment\n pathWithoutLocale = joinUrl(parentPath, segment)\n } else {\n pathWithoutLocale = normalizePath(customSegment)\n }\n const finalPath = this.buildLocalizedPath(pathWithoutLocale, targetLocale, true)\n this.debugLog('branch=customSegment', { customSegment, pathWithoutLocale, finalPath })\n return this.preserveQueryAndHash(this.applyBaseUrl(targetLocale, finalPath), src)\n }\n\n const effectiveBaseName = baseName ?? inputName\n this.debugLog('before effectiveBaseName check', { baseName, inputName, effectiveBaseName, resolvedName: resolved.name?.toString() })\n if (!effectiveBaseName) {\n this.debugLog('branch=noBaseName', { return: 'src' })\n return src\n }\n\n if (!hasParams && resolved.path && resolved.path !== '/' && resolved.name) {\n const { pathWithoutLocale, baseRouteName } = this.getPathWithoutLocaleAndBaseName(resolved)\n if (pathWithoutLocale && pathWithoutLocale !== '/') {\n const pathToUse =\n baseRouteName && pathWithoutLocale === baseRouteName ? joinUrl('/', transformNameKeyToPath(baseRouteName)) : pathWithoutLocale\n const finalPath = this.buildLocalizedPath(pathToUse, targetLocale, false)\n this.debugLog('branch=pathFromResolved', { pathWithoutLocale, baseRouteName, pathToUse, finalPath })\n return this.preserveQueryAndHash(this.applyBaseUrl(targetLocale, finalPath), src)\n }\n }\n\n const baseNameForPath = resolvedNameStr === inputName ? effectiveBaseName : (inputName ?? effectiveBaseName)\n this.debugLog('fallback build', { resolvedNameStr, inputName, baseNameForPath, targetLocale, hasParams })\n const targetName = this.buildLocalizedRouteName(baseNameForPath, targetLocale)\n const newRoute: RouteLike = {\n ...src,\n name: targetName,\n params: { ...src.params },\n }\n if (!hasParams) {\n const pathWithoutLocale = isIndexRouteName(baseNameForPath) ? '/' : joinUrl('/', transformNameKeyToPath(baseNameForPath))\n const finalPath = this.buildLocalizedPath(pathWithoutLocale, targetLocale, false)\n const withBase = this.applyBaseUrl(targetLocale, finalPath)\n const pathStr = typeof withBase === 'string' ? withBase : ((withBase as RouteLike).path ?? finalPath)\n this.debugLog('fallback !hasParams', { pathWithoutLocale, finalPath, pathStr })\n newRoute.path = pathStr\n newRoute.fullPath = pathStr\n } else {\n let pathStr: string | null = null\n try {\n const resolvedWithParams = this.ctx.router.resolve({ name: baseNameForPath, params: src.params })\n if (resolvedWithParams?.path) {\n const pathToUse =\n resolvedWithParams.path === '/'\n ? '/'\n : (() => {\n const { pathWithoutLocale } = this.getPathWithoutLocale(resolvedWithParams.path)\n return pathWithoutLocale && pathWithoutLocale !== '/' ? pathWithoutLocale : resolvedWithParams.path\n })()\n const finalPath = this.buildLocalizedPath(pathToUse, targetLocale, false)\n const withBase = this.applyBaseUrl(targetLocale, finalPath)\n pathStr = typeof withBase === 'string' ? withBase : ((withBase as RouteLike).path ?? finalPath)\n }\n } catch {\n // Router does not have baseName route: build path from baseNameForPath + params (path template)\n pathStr = this.buildPathFromBaseNameAndParams(baseNameForPath, src.params ?? {}, targetLocale)\n }\n if (pathStr) {\n newRoute.path = pathStr\n newRoute.fullPath = pathStr\n }\n }\n // If we have a path, remove 'name' to prevent NuxtLink from calling router.resolve with non-existent route name\n if (newRoute.path) {\n delete newRoute.name\n }\n const out = this.preserveQueryAndHash(this.applyBaseUrl(targetLocale, newRoute), src)\n this.debugLog('branch=fallbackNewRoute return', {\n baseName,\n targetName,\n hasParams,\n newRoutePath: newRoute.path,\n outPath: typeof out === 'string' ? out : (out as RouteLike).path,\n })\n return out\n }\n\n /**\n * Extracts locale from URL path by checking the first path segment.\n */\n private extractLocaleFromPath(path: string): string | null {\n if (!path) return null\n\n // Remove query params and hash\n const querySplit = path.split('?')\n const cleanPath = querySplit[0]?.split('#')[0]\n\n if (!cleanPath || cleanPath === '/') return null\n\n const pathSegments = cleanPath.split('/').filter(Boolean)\n if (pathSegments.length === 0) return null\n\n const firstSegment = pathSegments[0]\n if (!firstSegment) return null\n\n const availableLocales = this.ctx.locales.map((l) => l.code)\n if (availableLocales.includes(firstSegment)) {\n return firstSegment\n }\n\n return null\n }\n\n /**\n * Determines current locale from route, considering hashMode, noPrefix, prefix_and_default at /, etc.\n */\n getCurrentLocale(route: ResolvedRouteLike, getDefaultLocale?: () => string | null | undefined): string {\n const strategy = this.ctx.strategy\n\n // 1. Check hashMode\n if (this.ctx.hashMode) {\n const fromGetter = getDefaultLocale?.()\n if (fromGetter) return fromGetter\n return this.ctx.defaultLocale\n }\n\n // 2. Check no_prefix strategy\n if (strategy === 'no_prefix') {\n const fromGetter = getDefaultLocale?.()\n if (fromGetter) return fromGetter\n return this.ctx.defaultLocale\n }\n\n const path = route.path || route.fullPath || ''\n\n // 2b. prefix_and_default at /: useState/cookie can override — / is valid for any locale\n if (strategy === 'prefix_and_default' && (path === '/' || path === '')) {\n const fromGetter = getDefaultLocale?.()\n if (fromGetter) return fromGetter\n }\n\n // 3. Check route.params.locale (for existing routes)\n if (route.params?.locale) {\n return String(route.params.locale)\n }\n\n // 4. Extract locale from URL path (for non-existent routes)\n const localeFromPath = this.extractLocaleFromPath(path)\n if (localeFromPath) {\n return localeFromPath\n }\n\n // 5. For prefix_except_default: URL without locale prefix = defaultLocale\n if (strategy === 'prefix_except_default') {\n return this.ctx.defaultLocale\n }\n\n // 6. Check getter (for no_prefix and other strategies)\n const fromGetter = getDefaultLocale?.()\n if (fromGetter) return fromGetter\n\n // 7. Return defaultLocale as fallback\n return this.ctx.defaultLocale\n }\n\n /**\n * Returns the route name for plugin translation loading.\n * If disablePageLocales is true, returns 'general'.\n */\n getPluginRouteName(route: ResolvedRouteLike, locale: string): string {\n if (this.ctx.disablePageLocales) {\n return 'general'\n }\n const baseName = this.getRouteBaseName(route)\n if (!baseName) {\n // Fallback: extract from route name\n const name = (route.name ?? '').toString()\n return name.replace(this.getLocalizedRouteNamePrefix(), '').replace(new RegExp(`-${locale}$`), '')\n }\n return baseName\n }\n\n /**\n * Returns displayName of the current locale, or null if not found.\n */\n getCurrentLocaleName(route: ResolvedRouteLike): string | null {\n const currentLocaleCode = this.getCurrentLocale(route)\n const localeObj = this.ctx.locales.find((l) => l.code === currentLocaleCode)\n return localeObj?.displayName ?? null\n }\n\n /**\n * Formats path for router.resolve based on strategy.\n * Each strategy should override this with its own logic.\n */\n abstract formatPathForResolve(path: string, fromLocale: string, toLocale: string): string\n}\n"],"names":["HASH_RE","AMPERSAND_RE","SLASH_RE","EQUAL_RE","PLUS_RE","ENC_CARET_RE","ENC_BACKTICK_RE","ENC_CURLY_OPEN_RE","ENC_PIPE_RE","ENC_CURLY_CLOSE_RE","ENC_SPACE_RE","encode","text","encodeHash","encodeQueryValue","input","encodeQueryKey","decode","decodeQueryKey","decodeQueryValue","parseQuery","parametersString","object","parameter","s","key","value","encodeQueryItem","_value","stringifyQuery","query","k","PROTOCOL_STRICT_REGEX","PROTOCOL_REGEX","PROTOCOL_RELATIVE_REGEX","JOIN_LEADING_SLASH_RE","hasProtocol","inputString","opts","hasTrailingSlash","respectQueryAndFragment","withoutTrailingSlash","withTrailingSlash","hasLeadingSlash","withoutLeadingSlash","withLeadingSlash","cleanDoubleSlashes","string_","withQuery","parsed","parseURL","mergedQuery","stringifyParsedURL","isEmptyURL","url","isNonEmptyURL","joinURL","base","segment","url2","_segment","isSamePath","p1","p2","withFragment","hash","protocolRelative","defaultProto","_specialProtoMatch","_proto","_pathname","parsePath","protocol","auth","hostAndPath","host","path","pathname","search","FILENAME_REGEX","parseFilename","matches","getPathSegments","pathOrSlashKey","normalizePath","p","normalizePathForCompare","collapsed","joinUrl","segments","valid","rest","joined","getCleanPath","buildUrl","fragment","transformNameKeyToPath","nameKey","out","i","nameKeyFirstSlash","idx","nameKeyLastSlash","parentKeyFromSlashKey","keyWithSlash","lastPathSegment","getPathWithoutLocale","localeCodes","clean","normalized","nextSlash","firstSegment","lengthToCut","remaining","getLocaleFromPath","getRouteBaseName","route","options","name","prefix","sortedLocales","a","b","locale","suffix","charBeforeLocale","buildLocalizedName","baseName","isIndexRouteName","localizedIndexPrefix","localePart","PARAM_PATTERN","RouteResolver","ctx","params","match","optKey","reqKey","catchAllKey","l","pathWithoutLocale","baseRouteName","keys","pathKey","asPath","firstSlash","lastSlash","targetLocale","gr","rule","customPath","pathForm","routeName","rl","allowed","code","nameSegments","parentKey","parentRules","BasePathStrategy","router","locales","utilGetRouteBaseName","mockRoute","customSegment","utilBuildLocalizedName","localeCode","baseUrl","resolvedPath","fullPath","target","source","result","basePath","_route","_targetLocale","sourceRoute","localizedNameWithSuffix","localizedNameWithoutSuffix","localizedName","resolved","resolveParams","paramKeys","pathTemplate","firstKey","pathSegments","replaceCount","templateSegments","pathWithParams","finalPath","withBase","normalizerGetPathWithoutLocale","normalizerGetLocaleFromPath","currentPath","localeFromPath","validCodes","allowedCodes","currentRoute","currentLocale","canonicalPath","canonical","hreflangs","localized","normalizedPath","targetName","fromLocale","toLocale","nameWithSuffix","nameWithoutSuffix","needsLocaleParam","i18nParams","newParams","newRoute","routeOrPath","raw","_currentRoute","inputName","_args","src","hasParams","resolvedNameStr","unlocalizedByName","routeWithParams","routeByLocalizedName","unlocalizedPath","keyFirstSlash","keyLastSlash","isNestedFirst","isNestedLast","isNested","parentPath","effectiveBaseName","pathToUse","baseNameForPath","pathStr","resolvedWithParams","cleanPath","getDefaultLocale","strategy","fromGetter","currentLocaleCode"],"mappings":"aA2FA,MAAMA,GAAU,KACVC,GAAe,KACfC,GAAW,MACXC,GAAW,KAEXC,EAAU,MACVC,EAAe,QACfC,GAAkB,QAClBC,GAAoB,QACpBC,GAA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