deploy: v0.12 fix 存档key名

This commit is contained in:
2026-06-24 03:09:02 +00:00
parent 7a08d49fe3
commit e0a5281119
58743 changed files with 7297269 additions and 39505 deletions
+1
View File
@@ -0,0 +1 @@
function t(){throw new Error("Couldn't find next-intl config file. Please follow the instructions at https://next-intl.dev/docs/getting-started/app-router")}export{t as default};
+1
View File
@@ -0,0 +1 @@
export{default as unstable_extractMessages}from"./extractor/extractMessages.js";export{defineCodec}from"./extractor/format/ExtractorCodec.js";
@@ -0,0 +1 @@
import s from"./catalog/CatalogManager.js";import t from"./extractor/MessageExtractor.js";class o{constructor(o,a={}){const e=a.extractor??new t(a);this.manager=new s(o,{...a,extractor:e}),this[Symbol.dispose]=this[Symbol.dispose].bind(this),this.installExitHandlers()}async extractAll(){await this.manager.loadMessages(),await this.manager.save()}[Symbol.dispose](){this.uninstallExitHandlers(),this.manager[Symbol.dispose]()}installExitHandlers(){const s=this[Symbol.dispose];process.on("exit",s),process.on("SIGINT",s),process.on("SIGTERM",s)}uninstallExitHandlers(){const s=this[Symbol.dispose];process.off("exit",s),process.off("SIGINT",s),process.off("SIGTERM",s)}}export{o as default};
@@ -0,0 +1 @@
import e from"fs";import s from"fs/promises";import t from"path";class a{onChangeCallbacks=(()=>new Set)();constructor(e){this.messagesDir=e.messagesDir,this.sourceLocale=e.sourceLocale,this.extension=e.extension,this.locales=e.locales}async getTargetLocales(){return this.targetLocales||("infer"===this.locales?this.targetLocales=await this.readTargetLocales():this.targetLocales=this.locales.filter((e=>e!==this.sourceLocale))),this.targetLocales}async readTargetLocales(){try{return(await s.readdir(this.messagesDir)).filter((e=>e.endsWith(this.extension))).map((e=>t.basename(e,this.extension))).filter((e=>e!==this.sourceLocale))}catch{return[]}}subscribeLocalesChange(e){this.onChangeCallbacks.add(e),"infer"!==this.locales||this.watcher||this.startWatcher()}unsubscribeLocalesChange(e){this.onChangeCallbacks.delete(e),0===this.onChangeCallbacks.size&&this.stopWatcher()}async startWatcher(){this.watcher||(await s.mkdir(this.messagesDir,{recursive:!0}),this.watcher=e.watch(this.messagesDir,{persistent:!1,recursive:!1},((e,s)=>{null!=s&&s.endsWith(this.extension)&&!s.includes(t.sep)&&this.onChange()})))}stopWatcher(){this.watcher&&(this.watcher.close(),this.watcher=void 0)}async onChange(){const e=new Set(this.targetLocales||[]);this.targetLocales=await this.readTargetLocales();const s=new Set(this.targetLocales),t=this.targetLocales.filter((s=>!e.has(s))),a=Array.from(e).filter((e=>!s.has(e)));if(t.length>0||a.length>0)for(const e of this.onChangeCallbacks)e({added:t,removed:a})}}export{a as default};
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
import e from"fs/promises";import t from"path";class r{constructor(e){this.messagesPath=e.messagesPath,this.codec=e.codec,this.extension=e.extension}getFileName(e){return e+this.extension}getFilePath(e){return t.join(this.messagesPath,this.getFileName(e))}async read(t){const r=this.getFilePath(t);let i;try{i=await e.readFile(r,"utf8")}catch(e){if(e&&"object"==typeof e&&"code"in e&&"ENOENT"===e.code)return[];throw new Error(`Error while reading ${this.getFileName(t)}:\n> ${e}`,{cause:e})}try{return this.codec.decode(i,{locale:t})}catch(e){throw new Error(`Error while decoding ${this.getFileName(t)}:\n> ${e}`,{cause:e})}}async write(r,i){const a=this.getFilePath(i.locale),s=this.codec.encode(r,i);try{const r=t.dirname(a);await e.mkdir(r,{recursive:!0}),await e.writeFile(a,s)}catch(e){console.error(`❌ Failed to write catalog: ${e}`)}}async getLastModified(t){const r=this.getFilePath(t);try{return(await e.stat(r)).mtime}catch{return}}}export{r as default};
@@ -0,0 +1 @@
class e{isSaving=!1;pendingResolvers=[];constructor(e=50){this.delayMs=e}async schedule(e){return new Promise(((s,i)=>{this.pendingResolvers.push({resolve:s,reject:i}),this.nextSaveTask=e,this.isSaving||this.saveTimeout?this.saveTimeout&&this.scheduleSave():this.executeSave()}))}scheduleSave(){this.saveTimeout&&clearTimeout(this.saveTimeout),this.saveTimeout=setTimeout((()=>{this.saveTimeout=void 0,this.executeSave()}),this.delayMs)}async executeSave(){if(this.isSaving)return;const e=this.nextSaveTask;if(!e)return;const s=this.pendingResolvers;this.pendingResolvers=[],this.nextSaveTask=void 0,this.isSaving=!0;try{const i=await e();s.forEach((({resolve:e})=>e(i)))}catch(e){s.forEach((({reject:s})=>s(e)))}finally{this.isSaving=!1,this.pendingResolvers.length>0&&this.scheduleSave()}}[Symbol.dispose](){this.saveTimeout&&(clearTimeout(this.saveTimeout),this.saveTimeout=void 0),this.pendingResolvers=[],this.nextSaveTask=void 0,this.isSaving=!1}}export{e as default};
@@ -0,0 +1 @@
import t from"path";import{getFormatExtension as s,resolveCodec as e}from"./format/index.js";let o=null;function a(a){const n=this.getOptions(),r=this.async(),i=s(n.messages.format);(async function(t,s){return o||(o=await e(t.messages.format,s)),o})(n,this.rootContext).then((s=>{const e=t.basename(this.resourcePath,i),o=s.toJSONString(a,{locale:e}),n=`export default JSON.parse(${JSON.stringify(o)});`;r(null,n)})).catch(r)}export{a as default};
@@ -0,0 +1 @@
import t from"./ExtractionCompiler.js";import o from"./extractor/MessageExtractor.js";import{getDefaultProjectRoot as r}from"./utils.js";async function e(e){const a=new t(e,{extractor:new o({isDevelopment:!1,projectRoot:r()})});await a.extractAll()}export{e as default};
@@ -0,0 +1 @@
import t from"./extractor/MessageExtractor.js";let e;function o(o){const r=this.async(),s=this.rootContext,c="development"===process.env["NODE_ENV".trim()];e||(e=new t({isDevelopment:c,projectRoot:s,sourceMap:this.sourceMap})),e.extract(this.resourcePath,o).then((t=>{r(null,t.code,t.map)})).catch(r)}export{o as default};
@@ -0,0 +1 @@
class e{constructor(e){this.maxSize=e,this.cache=new Map}set(e,t){if(!this.cache.has(e)&&this.cache.size>=this.maxSize){const e=this.cache.keys().next().value;void 0!==e&&this.cache.delete(e)}this.cache.set(e,{key:e,value:t})}get(e){const t=this.cache.get(e);if(t)return this.cache.delete(e),this.cache.set(e,t),t.value}}export{e as default};
@@ -0,0 +1 @@
import{createRequire as e}from"module";import t from"path";import{transform as s}from"@swc/core";import{getDefaultProjectRoot as o}from"../utils.js";import r from"./LRUCache.js";const i=e(import.meta.url);class c{compileCache=(()=>new r(750))();constructor(e){this.isDevelopment=e.isDevelopment??!1,this.projectRoot=e.projectRoot??o(),this.sourceMap=e.sourceMap??!1}async extract(e,o){const r=[o,e].join("!"),c=this.compileCache.get(r);if(c)return c;if(!o.includes("useExtracted")&&!o.includes("getExtracted"))return{messages:[],code:o};const a=t.relative(this.projectRoot,e),p=await s(o,{jsc:{target:"esnext",parser:{syntax:"typescript",tsx:!0,decorators:!0},experimental:{cacheRoot:"node_modules/.cache/swc",disableBuiltinTransformsForInternalTesting:!0,disableAllLints:!0,plugins:[[i.resolve("next-intl-swc-plugin-extractor"),{isDevelopment:this.isDevelopment,filePath:a}]]}},sourceMaps:this.sourceMap,sourceFileName:a,filename:a}),l=p.output,n=JSON.parse(JSON.parse(l).results),m={code:p.code,map:p.map,messages:n};return this.compileCache.set(r,m),m}}export{c as default};
@@ -0,0 +1 @@
function n(n){return n}export{n as defineCodec};
@@ -0,0 +1 @@
import{getSortedMessages as o,setNestedProperty as t}from"../../utils.js";import{defineCodec as e}from"../ExtractorCodec.js";var r=e((()=>({decode(o){const t=JSON.parse(o),e=[];return s(t,((o,t)=>{e.push({id:t,message:o})})),e},encode(e){const r={};for(const s of o(e))t(r,s.id,s.message);return JSON.stringify(r,null,2)+"\n"},toJSONString:o=>o})));function s(o,t,e=""){for(const r of Object.keys(o)){const n=e?e+"."+r:r,c=o[r];"string"==typeof c?t(c,n):"object"==typeof c&&s(c,t,n)}}export{r as default};
@@ -0,0 +1 @@
import e from"po-parser";import{setNestedProperty as t,getSortedMessages as s}from"../../utils.js";import{defineCodec as r}from"../ExtractorCodec.js";var n=r((()=>{const r={"Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"8bit","X-Generator":"next-intl","X-Crowdin-SourceKey":"msgstr"},n=".",o=new Map;return{decode(t,s){const r=e.parse(t);r.meta&&o.set(s.locale,r.meta);return(r.messages||[]).map((e=>{const{extractedComments:t,msgctxt:s,msgid:r,msgstr:o,...a}=e;if(t&&t.length>1)throw new Error(`Multiple extracted comments are not supported. Found ${t.length} comments for msgid "${r}".`);return{...a,id:s?[s,r].join(n):r,message:o,...t&&t.length>0&&{description:t[0]}}}))},encode(t,a){const m=s(t).map((e=>{const{description:t,id:s,message:r,...o}=e,a=s.lastIndexOf(n),m=s.includes(n);return{msgid:m?s.slice(a+1):s,msgstr:r,...t&&{extractedComments:[t]},...m&&{msgctxt:s.slice(0,a)},...o}}));return e.serialize({meta:{Language:a.locale,...r,...o.get(a.locale)},messages:m})},toJSONString(e,s){const r=this.decode(e,s),n={};for(const e of r)t(n,e.id,e.message);return JSON.stringify(n)}}}));export{n as default};
+1
View File
@@ -0,0 +1 @@
import o from"path";import{throwError as e}from"../../plugin/utils.js";const t={json:{codec:()=>import("./codecs/JSONCodec.js"),extension:".json"},po:{codec:()=>import("./codecs/POCodec.js"),extension:".po"}};function n(o){return"string"==typeof o&&o in t}function c(o){return n(o)?t[o].extension:o.extension}async function r(c,r){if(n(c)){return(0,(await t[c].codec()).default)()}{const t=o.isAbsolute(c.codec)?c.codec:o.resolve(r,c.codec);let n;try{n=await import(t)}catch(o){e(`Could not load codec from "${t}".\n${o}`)}const i=n.default;return i&&"function"==typeof i||e(`Codec at "${t}" must have a default export returned from \`defineCodec\`.`),i()}}export{t as default,c as getFormatExtension,r as resolveCodec};
@@ -0,0 +1 @@
import t from"path";class i{static EXTENSIONS=["ts","tsx","js","jsx"];static IGNORED_DIRECTORIES=["node_modules",".next",".git"];static isSourceFile(s){const e=t.extname(s);return i.EXTENSIONS.map((t=>"."+t)).includes(e)}static shouldEnterDirectory(s,e){const r=t.basename(s);return!i.IGNORED_DIRECTORIES.includes(r)||i.isIgnoredDirectoryExplicitlyIncluded(s,e)}static isIgnoredDirectoryExplicitlyIncluded(t,s){return s.some((s=>i.isWithinPath(s,t)))}static isWithinPath(i,s){const e=t.relative(s,i);return""===e||!e.startsWith("..")}}export{i as default};
@@ -0,0 +1 @@
import e from"fs/promises";import i from"path";import r from"./SourceFileFilter.js";class t{static async walkSourceFiles(o,s,a=[]){const c=await e.readdir(o,{withFileTypes:!0});for(const e of c){const c=i.join(o,e.name);if(e.isDirectory()){if(!r.shouldEnterDirectory(c,s))continue;await t.walkSourceFiles(c,s,a)}else r.isSourceFile(e.name)&&a.push(c)}return a}static async getSourceFiles(e){const i=(await Promise.all(e.map((i=>t.walkSourceFiles(i,e))))).flat();return new Set(i)}}export{t as default};
@@ -0,0 +1 @@
import t from"fs/promises";import s from"path";import{subscribe as e}from"@parcel/watcher";import o from"./SourceFileFilter.js";import r from"./SourceFileScanner.js";class i{subscriptions=[];constructor(t,s){this.roots=t,this.onChange=s}async start(){if(this.subscriptions.length>0)return;const t=o.IGNORED_DIRECTORIES.map((t=>`**/${t}/**`));for(const s of this.roots){const o=await e(s,(async(t,s)=>{if(t)return void console.error(t);const e=await this.normalizeEvents(s);e.length>0&&this.onChange(e)}),{ignore:t});this.subscriptions.push(o)}}async normalizeEvents(s){const e=[],i=[];await Promise.all(s.map((async s=>{if("create"===s.type)try{if((await t.stat(s.path)).isDirectory())return void e.push(s.path)}catch{}i.push(s)})));let a=[];if(e.length>0)try{const t=await r.getSourceFiles(e);a=Array.from(t).map((t=>({type:"create",path:t})))}catch{}const n=[...i,...a],c=new Set,p=[];for(const t of n){const s=`${t.type}:${t.path}`;c.has(s)||(c.add(s),p.push(t))}return p.filter((t=>"delete"===t.type||o.isSourceFile(t.path)))}async expandDirectoryDeleteEvents(t,e){const r=[];for(const i of t)if("delete"!==i.type||o.isSourceFile(i.path))r.push(i);else{const t=s.resolve(i.path),a=[];for(const s of e)o.isWithinPath(s,t)&&a.push(s);if(a.length>0)for(const t of a)r.push({type:"delete",path:t});else r.push(i)}return r}async stop(){await Promise.all(this.subscriptions.map((t=>t.unsubscribe()))),this.subscriptions=[]}[Symbol.dispose](){this.stop()}}export{i as default};
+1
View File
@@ -0,0 +1 @@
function n(n,e,t){const r=e.split(".");let o=n;for(let n=0;n<r.length-1;n++){const e=r[n];e in o&&"object"==typeof o[e]&&null!==o[e]||(o[e]={}),o=o[e]}o[r[r.length-1]]=t}function e(n){return n.toSorted(((n,e)=>{const t=n.references?.[0],o=e.references?.[0];return t&&o?r(t,o):0}))}function t(n,e){return n.localeCompare(e,"en")}function r(n,e){const r=t(n.path,e.path);return 0!==r?r:(n.line??0)-(e.line??0)}function o(){return process.cwd()}export{r as compareReferences,o as getDefaultProjectRoot,e as getSortedMessages,t as localeCompare,n as setNestedProperty};
+1
View File
@@ -0,0 +1 @@
export{useFormatter,useTranslations}from"./react-client/index.js";export{default as NextIntlClientProvider}from"./shared/NextIntlClientProvider.js";export{IntlProvider,_useExtracted as useExtracted,useLocale,useMessages,useNow,useTimeZone}from"use-intl/react";export*from"use-intl/core";
+1
View File
@@ -0,0 +1 @@
export{default as useLocale}from"./react-server/useLocale.js";export{default as useTranslations}from"./react-server/useTranslations.js";export{default as useFormatter}from"./react-server/useFormatter.js";export{default as useNow}from"./react-server/useNow.js";export{default as useTimeZone}from"./react-server/useTimeZone.js";export{default as useMessages}from"./react-server/useMessages.js";export{default as NextIntlClientProvider}from"./react-server/NextIntlClientProviderServer.js";export{default as useExtracted}from"./react-server/useExtracted.js";export*from"use-intl/core";
+1
View File
@@ -0,0 +1 @@
export{default}from"./middleware/middleware.js";
@@ -0,0 +1 @@
import{normalizeTrailingSlash as e}from"../shared/utils.js";import{getHost as a,getNormalizedPathname as t,getLocalePrefixes as n,isLocaleSupportedOnDomain as o,applyBasePath as r,formatTemplatePathname as l}from"./utils.js";function s({internalTemplateName:s,localizedPathnames:m,request:i,resolvedLocale:p,routing:c}){const f=i.nextUrl.clone(),h=a(i.headers);function u(a,t){return a.pathname=e(a.pathname),i.nextUrl.basePath&&((a=new URL(a)).pathname=r(a.pathname,i.nextUrl.basePath)),`<${a.toString()}>; rel="alternate"; hreflang="${t}"`}function d(e,a){if(m&&"object"==typeof m){const t=m[p];return l(e,t??s,m[a]??s)}return e}h&&(f.port="",f.host=h),f.protocol=i.headers.get("x-forwarded-proto")??f.protocol,f.pathname=t(f.pathname,c.locales,c.localePrefix);const x=n(c.locales,c.localePrefix,!1).flatMap((([e,a])=>{function t(e){return"/"===e?a:a+e}let n;if(c.domains){return c.domains.filter((a=>o(e,a))).map((a=>(n=new URL(f),n.port="",n.host=a.domain,n.pathname=d(f.pathname,e),e===a.defaultLocale&&"always"!==c.localePrefix.mode||(n.pathname=t(n.pathname)),u(n,e))))}{let a;a=m&&"object"==typeof m?d(f.pathname,e):f.pathname,e===c.defaultLocale&&"always"!==c.localePrefix.mode||(a=t(a)),n=new URL(a,f)}return u(n,e)}));if(!c.domains||0===c.domains.length){const e=d(f.pathname,c.defaultLocale);if(e){const a=new URL(e,f);x.push(u(a,"x-default"))}}return x.join(", ")}export{s as default};
+1
View File
@@ -0,0 +1 @@
import{NextResponse as e}from"next/server";import{receiveRoutingConfig as t}from"../routing/config.js";import{HEADER_LOCALE_NAME as r}from"../shared/constants.js";import{matchesPathname as a,normalizeTrailingSlash as o,getLocalePrefix as l,getLocalizedTemplate as n}from"../shared/utils.js";import s from"./getAlternateLinksHeaderValue.js";import i from"./resolveLocale.js";import c from"./syncCookie.js";import{sanitizePathname as d,isLocaleSupportedOnDomain as f,getNormalizedPathname as m,getPathnameMatch as h,getInternalTemplate as x,formatTemplatePathname as p,formatPathname as u,getBestMatchingDomain as U,applyBasePath as P,getLocaleAsPrefix as g}from"./utils.js";function v(v){const L=t(v);return function(t){let v;try{v=decodeURI(t.nextUrl.pathname)}catch{return e.next()}const j=d(v),{domain:w,locale:k}=i(L,t.headers,t.cookies,j),b=w?w.defaultLocale===k:k===L.defaultLocale,q=L.domains?.filter((e=>f(k,e)))||[],R=null!=L.domains&&!w;function y(a){const l=new URL(a,t.url);t.nextUrl.basePath&&(l.pathname=P(l.pathname,t.nextUrl.basePath));const n=new Headers(t.headers);n.set(r,k);return o(t.nextUrl.pathname)!==o(l.pathname)?e.rewrite(l,{request:{headers:n}}):e.next({request:{headers:n}})}function H(r,a){const l=new URL(r,t.url);if(l.pathname=o(l.pathname),q.length>0&&!a&&w){const e=U(w,k,q);e&&(a=e.domain,e.defaultLocale===k&&"as-needed"===L.localePrefix.mode&&(l.pathname=m(l.pathname,L.locales,L.localePrefix)))}if(a&&(l.host=a,t.headers.get("x-forwarded-host"))){l.protocol=t.headers.get("x-forwarded-proto")??t.nextUrl.protocol;const e=a.split(":")[1];l.port=e??t.headers.get("x-forwarded-port")??""}return t.nextUrl.basePath&&(l.pathname=P(l.pathname,t.nextUrl.basePath)),T=!0,e.redirect(l.toString())}const z=m(j,L.locales,L.localePrefix),A=h(j,L.locales,L.localePrefix,w),C=null!=A,I="never"===L.localePrefix.mode||b&&"as-needed"===L.localePrefix.mode;let N,S,T,V=z;const B=L.pathnames;if(B){let e;if([e,S]=x(B,z,k),S){const r=B[S],o=n(r,k,S);if(a(o,z))V=p(z,o,S);else{let a;a=e?n(r,e,S):S;const s=I?void 0:l(k,L.localePrefix),i=p(z,a,o);N=H(u(i,s,t.nextUrl.search))}}}if(!N)if("/"!==V||C){const e=u(V,g(k),t.nextUrl.search);if(C){const r=u(z,A.prefix,t.nextUrl.search);if("never"===L.localePrefix.mode)N=H(u(z,void 0,t.nextUrl.search));else if(A.exact)if(b&&I)N=H(u(z,void 0,t.nextUrl.search));else if(L.domains){const t=U(w,A.locale,q);N=w?.domain===t?.domain||R?y(e):H(r,t?.domain)}else N=y(e);else N=H(r)}else N=I?y(e):H(u(z,l(k,L.localePrefix),t.nextUrl.search))}else N=I?y(u(V,g(k),t.nextUrl.search)):H(u(z,l(k,L.localePrefix),t.nextUrl.search));return c(t,N,k,L,w),!T&&"never"!==L.localePrefix.mode&&L.alternateLinks&&L.locales.length>1&&N.headers.set("Link",s({routing:L,internalTemplateName:S,localizedPathnames:null!=S&&B?B[S]:void 0,request:t,resolvedLocale:k})),N}}export{v as default};
@@ -0,0 +1 @@
import{match as e}from"@formatjs/intl-localematcher";import o from"negotiator";import{getPathnameMatch as l,isLocaleSupportedOnDomain as t,getHost as a}from"./utils.js";function c(l,t,a){let c;const n=new o({headers:{"accept-language":l.get("accept-language")||void 0}}).languages();try{const o=function(e){return e.slice().sort(((e,o)=>o.length-e.length))}(t);c=e(n,o,a)}catch{}return c}function n(e,o){if(e.localeCookie&&o.has(e.localeCookie.name)){const l=o.get(e.localeCookie.name)?.value;if(l&&e.locales.includes(l))return l}}function i(e,o,t,a){let i;return a&&(i=l(a,e.locales,e.localePrefix)?.locale),!i&&e.localeDetection&&(i=n(e,t)),!i&&e.localeDetection&&(i=c(o,e.locales,e.defaultLocale)),i||(i=e.defaultLocale),i}function r(e,o,r,f){const u=function(e,o){const l=a(e);if(l)return o.find((e=>e.domain===l))}(o,e.domains);if(!u)return{locale:i(e,o,r,f)};let s;if(f){const o=l(f,e.locales,e.localePrefix,u)?.locale;if(o){if(!t(o,u))return{locale:o,domain:u};s=o}}if(!s&&e.localeDetection){const o=n(e,r);o&&t(o,u)&&(s=o)}if(!s&&e.localeDetection){const e=c(o,u.locales,u.defaultLocale);e&&(s=e)}return s||(s=u.defaultLocale),{locale:s,domain:u}}function f(e,o,l,t){return e.domains?r(e,o,l,t):{locale:i(e,o,l,t)}}export{f as default,c as getAcceptLanguageLocale};
+1
View File
@@ -0,0 +1 @@
import{getAcceptLanguageLocale as e}from"./resolveLocale.js";function o(o,a,l,s,t){if(!s.localeCookie)return;const{name:i,...c}=s.localeCookie,r=o.cookies.has(i);if(r&&o.cookies.get(i)?.value!==l)a.cookies.set(i,l,{path:o.nextUrl.basePath||void 0,...c});else if(!r){e(o.headers,t?.locales||s.locales,s.defaultLocale)!==l&&a.cookies.set(i,l,{path:o.nextUrl.basePath||void 0,...c})}}export{o as default};
+1
View File
@@ -0,0 +1 @@
import{normalizeTrailingSlash as e,getSortedPathnames as t,matchesPathname as n,prefixPathname as r,getLocalePrefix as o,templateToRegex as c,getLocalizedTemplate as i}from"../shared/utils.js";function s(e,r,o){const c=t(Object.keys(e));for(const t of c){const c=e[t];if("string"==typeof c){if(n(c,r))return[void 0,t]}else{const s=Object.entries(c),f=s.findIndex((([e])=>e===o));f>0&&s.unshift(s.splice(f,1)[0]);for(const[o]of s){const c=i(e[t],o,t);if(n(c,r))return[o,t]}}}for(const t of Object.keys(e))if(n(t,r))return[void 0,t];return[void 0,void 0]}function f(t,n,r,o){let c="";return c+=h(r,d(n,t)),c=e(c),c}function l(t,n,r){t.endsWith("/")||(t+="/");const o=u(n,r),c=new RegExp(`^(${o.map((([,e])=>e.replaceAll("/","\\/"))).join("|")})/(.*)`,"i"),i=t.match(c);let s=i?"/"+i[2]:t;return"/"!==s&&(s=e(s)),s}function u(e,t,n=!0){const r=e.map((e=>[e,o(e,t)]));return n&&r.sort(((e,t)=>t[1].length-e[1].length)),r}function a(e,t,n,r){const o=u(t,n);r&&o.sort((([e],[t])=>{if(e===r.defaultLocale)return-1;if(t===r.defaultLocale)return 1;const n=r.locales.includes(e),o=r.locales.includes(t);return n&&!o?-1:!n&&o?1:0}));for(const[t,n]of o){let r,o;if(e===n||e.startsWith(n+"/"))r=o=!0;else{const t=e.toLowerCase(),c=n.toLowerCase();(t===c||t.startsWith(c+"/"))&&(r=!1,o=!0)}if(o)return{locale:t,prefix:n,matchedPrefix:e.slice(0,n.length),exact:r}}}function d(t,n){const r=e(n),o=e(t),i=c(o).exec(r);if(!i)return;const s={},f=o.match(/\[([^\]]+)\]/g)??[];for(let e=1;e<i.length;e++){const t=f[e-1];if(!t)continue;const n=t.replace(/[[\]]/g,""),r=i[e]??"";s[n]=r}return s}function h(e,t){if(!t)return e;let n=e=e.replace(/\[\[/g,"[").replace(/\]\]/g,"]");return Object.entries(t).forEach((([e,t])=>{n=n.replace(`[${e}]`,t)})),n}function p(e,t,n){let o=e;return t&&(o=r(t,o)),n&&(o+=n),o}function g(e){return e.get("x-forwarded-host")??e.get("host")??void 0}function x(e,t){return t.defaultLocale===e||t.locales.includes(e)}function m(e,t,n){let r;return e&&x(t,e)&&(r=e),r||(r=n.find((e=>e.defaultLocale===t))),r||(r=n.find((e=>e.locales.includes(t)))),r}function j(t,n){return e(n+t)}function L(e){return`/${e}`}function v(e){return e.replace(/\\/g,"%5C").replace(/\/+/g,"/")}export{j as applyBasePath,p as formatPathname,h as formatPathnameTemplate,f as formatTemplatePathname,m as getBestMatchingDomain,g as getHost,s as getInternalTemplate,L as getLocaleAsPrefix,u as getLocalePrefixes,l as getNormalizedPathname,a as getPathnameMatch,d as getRouteParams,x as isLocaleSupportedOnDomain,v as sanitizePathname};
@@ -0,0 +1 @@
export{default as createNavigation}from"./navigation/react-client/createNavigation.js";
@@ -0,0 +1 @@
export{default as createNavigation}from"./navigation/react-server/createNavigation.js";
@@ -0,0 +1 @@
import{useRouter as e,usePathname as t}from"next/navigation";import{useMemo as r}from"react";import{useLocale as o}from"use-intl";import n from"../shared/createSharedNavigationFns.js";import a from"../shared/syncLocaleCookie.js";import{getRoute as s}from"../shared/utils.js";import i from"./useBasePathname.js";function c(c){const{Link:u,config:m,getPathname:f,...h}=n(o,c);return{...h,Link:u,usePathname:function(){const e=i(m),t=o();return r((()=>e&&m.pathnames?s(t,e,m.pathnames):e),[t,e])},useRouter:function(){const n=e(),s=o(),i=t();return r((()=>{function e(e){return function(t,r){const{locale:o,...n}=r||{},c=[f({href:t,locale:o||s,forcePrefix:null!=o||void 0})];Object.keys(n).length>0&&c.push(n),a(m.localeCookie,i,s,o),e(...c)}}return{...n,push:e(n.push),replace:e(n.replace),prefetch:e(n.prefetch)}}),[s,i,n])},getPathname:f}}export{c as default};
@@ -0,0 +1 @@
import{usePathname as e}from"next/navigation";import{useMemo as r}from"react";import{useLocale as o}from"use-intl";import{hasPathnamePrefixed as t,unprefixPathname as i,getLocalePrefix as f,getLocaleAsPrefix as l}from"../../shared/utils.js";function n(n){const s=e(),a=o();return r((()=>{if(!s)return s;let e=s;const r=f(a,n.localePrefix);if(t(r,s))e=i(s,r);else if("never"!==n.localePrefix.mode&&n.localePrefix.prefixes){const r=l(a);t(r,s)&&(e=i(s,r))}return e}),[n.localePrefix,a,s])}export{n as default};
@@ -0,0 +1 @@
import e from"../shared/createSharedNavigationFns.js";import o from"./getServerLocale.js";function t(t){const{config:n,...r}=e(o,t);function a(e){return()=>{throw new Error(`\`${e}\` is not supported in Server Components. You can use this hook if you convert the calling component to a Client Component.`)}}return{...r,usePathname:a("usePathname"),useRouter:a("useRouter")}}export{t as default};
@@ -0,0 +1 @@
import e from"../../server/react-server/getConfig.js";async function r(){return(await e()).locale}export{r as default};
@@ -0,0 +1,2 @@
"use client";
import o from"next/link";import{usePathname as r}from"next/navigation";import{forwardRef as e}from"react";import{useLocale as t}from"use-intl";import i from"./syncLocaleCookie.js";import{jsx as n}from"react/jsx-runtime";function f({href:e,locale:f,localeCookie:c,onClick:m,prefetch:l,...a},p){const s=t(),u=null!=f&&f!==s,h=r();u&&(l=!1);return n(o,{ref:p,href:e,hrefLang:u?f:void 0,onClick:function(o){i(c,h,s,f),m&&m(o)},prefetch:l,...a})}var c=e(f);export{c as default};
@@ -0,0 +1 @@
import{redirect as e,permanentRedirect as t}from"next/navigation";import{forwardRef as o}from"react";import{receiveRoutingConfig as r}from"../../routing/config.js";import n from"../../shared/use.js";import{isLocalizableHref as a,isPromise as i}from"../../shared/utils.js";import c from"./BaseLink.js";import{serializeSearchParams as f,compileLocalizedPathname as m,applyPathnamePrefix as l,normalizeNameOrNameWithParams as s}from"./utils.js";import{jsx as p}from"react/jsx-runtime";function u(u,h){const j=r(h||{}),d=j.pathnames;function g({href:e,locale:t,...o},r){let f,m;"object"==typeof e?(f=e.pathname,m=e.params):f=e;const l=a(e),s=u(),h=i(s)?n(s):s,g=l?y({locale:t||h,href:null==d?f:{pathname:f,params:m},forcePrefix:null!=t||void 0}):f;return p(c,{ref:r,href:"object"==typeof e?{...e,pathname:g}:g,locale:t,localeCookie:j.localeCookie,...o})}const x=o(g);function y(e){const{forcePrefix:t,href:o,locale:r}=e;let n;return null==d?"object"==typeof o?(n=o.pathname,o.query&&(n+=f(o.query))):n=o:n=m({locale:r,...s(o),pathnames:j.pathnames}),l(n,r,j,t)}function k(e){return function(t,...o){return e(y(t),...o)}}const b=k(e),P=k(t);return{config:j,Link:x,redirect:b,permanentRedirect:P,getPathname:y}}export{u as default};
@@ -0,0 +1 @@
import{getBasePath as t}from"./utils.js";function e(e,o,n,a){if(!e||!(a!==n&&null!=a)||!o)return;const f=t(o),r=""!==f?f:"/",{name:c,...i}=e;i.path||(i.path=r);let l=`${c}=${a};`;for(const[t,e]of Object.entries(i)){l+=`${"maxAge"===t?"max-age":t}`,"boolean"!=typeof e&&(l+="="+e),l+=";"}document.cookie=l}export{e as default};
@@ -0,0 +1 @@
import{getSortedPathnames as e,matchesPathname as n,isLocalizableHref as t,prefixPathname as r,normalizeTrailingSlash as o,getLocalizedTemplate as a,getLocalePrefix as i}from"../../shared/utils.js";function c(e){return"string"==typeof e?{pathname:e}:e}function s(e){function n(e){return String(e)}const t=new URLSearchParams;for(const[r,o]of Object.entries(e))Array.isArray(o)?o.forEach((e=>{t.append(r,n(e))})):t.set(r,n(o));return"?"+t.toString()}function f({pathname:e,locale:n,params:t,pathnames:r,query:i}){function c(e){const c=r[e];let f;if(c){const r=a(c,n,e);f=r,t&&Object.entries(t).forEach((([e,n])=>{let t,r;Array.isArray(n)?(t=`(\\[)?\\[...${e}\\](\\])?`,r=n.map((e=>String(e))).join("/")):(t=`\\[${e}\\]`,r=String(n)),f=f.replace(new RegExp(t,"g"),r)})),f=f.replace(/\[\[\.\.\..+\]\]/g,""),f=function(e){return new URL(e,"http://l").pathname}(f)}else f=e;return f=o(f),i&&(f+=s(i)),f}if("string"==typeof e)return c(e);{const{pathname:n,...t}=e;return{...t,pathname:c(n)}}}function u(t,r,o){const i=e(Object.keys(o)),c=decodeURI(r);for(const e of i){const r=o[e];if("string"==typeof r){if(n(r,c))return e}else if(n(a(r,t,e),c))return e}return r}function l(e,n=window.location.pathname){return"/"===e?n:n.replace(e,"")}function p(e,n,o,a){const{mode:c}=o.localePrefix;let s;return void 0!==a?s=a:t(e)&&("always"===c?s=!0:"as-needed"===c&&(s=o.domains?!o.domains.some((e=>e.defaultLocale===n)):n!==o.defaultLocale)),s?r(i(n,o.localePrefix),e):e}export{p as applyPathnamePrefix,f as compileLocalizedPathname,l as getBasePath,u as getRoute,c as normalizeNameOrNameWithParams,s as serializeSearchParams};
+1
View File
@@ -0,0 +1 @@
export{default}from"./plugin/createNextIntlPlugin.js";
@@ -0,0 +1 @@
import e from"./extractor/initExtractionCompiler.js";import t from"./getNextConfig.js";import{warn as r}from"./utils.js";import o from"./declaration/createMessagesDeclaration.js";function n(n={}){const i="string"==typeof n?{requestConfig:n}:n;return function(n){return function(n,i){null!=i?.i18n&&r("An `i18n` property was found in your Next.js config. This likely causes conflicts and should therefore be removed if you use the App Router.\n\nIf you're in progress of migrating from the Pages Router, you can refer to this example: https://next-intl.dev/examples#app-router-migration\n");const s=n.experimental?.createMessagesDeclaration;return s&&o("string"==typeof s?[s]:s),e(n),t(n,i)}(i,n)}}export{n as default};
@@ -0,0 +1 @@
import e from"fs";import t from"path";import{once as s,throwError as o}from"../utils.js";import n from"../watchFile.js";const i=s("_NEXT_INTL_COMPILE_MESSAGES");function r(s){["info","start"].some((e=>process.argv.includes(e)))||i((()=>{for(const n of s){const s=t.resolve(n);e.existsSync(s)||o(`\`createMessagesDeclaration\` points to a non-existent file: ${s}`),s.endsWith(".json")||o(`\`createMessagesDeclaration\` needs to point to a JSON file. Received: ${s}`);const i=process.env["NODE_ENV".trim()];a(n),"development"===i&&c(n)}}))}function c(e){const t=n(e,(()=>{a(e,!0)}));process.on("exit",(()=>{t.close()}))}function a(t,s=!1){const o=t.replace(/\.json$/,".d.json.ts");function n(e){return`// This file is auto-generated by next-intl, do not edit directly.\n// See: https://next-intl.dev/docs/workflows/typescript#messages-arguments\n\ndeclare const messages: ${e.trim()};\nexport default messages;`}if(s)return e.promises.readFile(t,"utf-8").then((t=>e.promises.writeFile(o,n(t))));const i=e.readFileSync(t,"utf-8");e.writeFileSync(o,n(i))}export{r as default};
@@ -0,0 +1 @@
import e from"../../extractor/ExtractionCompiler.js";import{once as o}from"../utils.js";let s;const t=o("_NEXT_INTL_EXTRACT");function r(o){const r=o.experimental;if(!r?.extract)return;const c="development"===process.env["NODE_ENV".trim()];(c||process.argv.includes("build"))&&t((()=>{const o={srcPath:r.srcPath,sourceLocale:r.extract.sourceLocale,messages:r.messages};function t(){s&&(s[Symbol.dispose](),s=void 0)}s=new e(o,{isDevelopment:c,projectRoot:process.cwd()}),s.extractAll(),process.on("exit",t),process.on("SIGINT",t),process.on("SIGTERM",t)}))}export{r as default};
+1
View File
@@ -0,0 +1 @@
import e from"fs";import t from"path";import{getFormatExtension as r}from"../extractor/format/index.js";import s from"../extractor/source/SourceFileFilter.js";import{isNextJs16OrHigher as n,hasStableTurboConfig as o}from"./nextFlags.js";import{throwError as a}from"./utils.js";function i(e){return[`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.jsx`]}function l(r,s){function n(r){return e.existsSync(function(e){const r=[];return s&&r.push(s),r.push(e),t.resolve(...r)}(r))}if(r)return n(r)||a(`Could not find i18n config at ${r}, please provide a valid path.`),r;for(const e of[...i("./i18n/request"),...i("./src/i18n/request")])if(n(e))return e;a("Could not locate request configuration module.\n\nThis path is supported by default: ./(src/)i18n/request.{js,jsx,ts,tsx}\n\nAlternatively, you can specify a custom location in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(\n\nAlternatively, you can specify a custom location in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(\n './path/to/i18n/request.tsx'\n);")}function u(e,i){const u={};function c(){const t=e.experimental;return t.srcPath&&e.experimental?.messages||a("`srcPath` and `messages` are required when using `extractor`."),{loader:"next-intl/extractor/extractionLoader",options:{srcPath:t.srcPath,sourceLocale:t.extract.sourceLocale,messages:e.experimental.messages}}}function p(){return{loader:"next-intl/extractor/catalogLoader",options:{messages:e.experimental.messages}}}function m(){return i?.turbopack?.rules||i?.experimental?.turbo?.rules||{}}function x(e,t,r){e[t]?Array.isArray(e[t])?e[t].push(r):e[t]=[e[t],r]:e[t]=r}if(null!=process.env.TURBOPACK){e.requestConfig&&t.isAbsolute(e.requestConfig)&&a("Turbopack support for next-intl currently does not support absolute paths, please provide a relative one (e.g. './src/i18n/config.ts').\n\nFound: "+e.requestConfig);const f={"next-intl/config":l(e.requestConfig)};let g;if(e.experimental?.extract){n()||a("Message extraction requires Next.js 16 or higher."),g??=m();const t=(Array.isArray(e.experimental.srcPath)?e.experimental.srcPath:[e.experimental.srcPath]).map((e=>e.endsWith("/")?e.slice(0,-1):e));x(g,`*.{${s.EXTENSIONS.join(",")}}`,{loaders:[c()],condition:{path:`{${t.join(",")}}/**/*`,content:/(useExtracted|getExtracted)/}})}if(e.experimental?.messages){n()||a("Message catalog loading requires Next.js 16 or higher."),g??=m();x(g,`*${r(e.experimental.messages.format)}`,{loaders:[p()],condition:{path:`${e.experimental.messages.path}/**/*`},as:"*.js"})}o()&&!i?.experimental?.turbo?u.turbopack={...i?.turbopack,...g&&{rules:g},resolveAlias:{...i?.turbopack?.resolveAlias,...f}}:u.experimental={...i?.experimental,turbo:{...i?.experimental?.turbo,...g&&{rules:g},resolveAlias:{...i?.experimental?.turbo?.resolveAlias,...f}}}}else u.webpack=function(n,o){if(n.resolve||(n.resolve={}),n.resolve.alias||(n.resolve.alias={}),n.resolve.alias["next-intl/config"]=t.resolve(n.context,l(e.requestConfig,n.context)),e.experimental?.extract){n.module||(n.module={}),n.module.rules||(n.module.rules=[]);const r=e.experimental.srcPath;n.module.rules.push({test:new RegExp(`\\.(${s.EXTENSIONS.join("|")})$`),include:Array.isArray(r)?r.map((e=>t.resolve(n.context,e))):t.resolve(n.context,r||""),use:[c()]})}if(e.experimental?.messages){n.module||(n.module={}),n.module.rules||(n.module.rules=[]);const s=r(e.experimental.messages.format);n.module.rules.push({test:new RegExp(`${s.replace(/\./g,"\\.")}$`),include:t.resolve(n.context,e.experimental.messages.path),use:[p()],type:"javascript/auto"})}return"function"==typeof i?.webpack?i.webpack(n,o):n};return i?.trailingSlash&&(u.env={...i.env,_next_intl_trailing_slash:"true"}),Object.assign({},i,u)}export{u as default};
+1
View File
@@ -0,0 +1 @@
import{createRequire as t}from"module";function r(){try{const r=t(import.meta.url);return r("next/package.json").version}catch(t){throw new Error("Failed to get current Next.js version. This can happen if next-intl/plugin is imported into your app code outside of your next.config.js.",{cause:t})}}function n(t,r){const n=t.split(".").map(Number),e=r.split(".").map(Number);for(let t=0;t<3;t++){const r=n[t]||0,o=e[t]||0;if(r>o)return 1;if(r<o)return-1}return 0}function e(){return n(r(),"15.3.0")>=0}function o(){return n(r(),"16.0.0")>=0}export{e as hasStableTurboConfig,o as isNextJs16OrHigher};
+1
View File
@@ -0,0 +1 @@
function n(n){return`\n[next-intl] ${n}\n`}function o(o){throw new Error(n(o))}function r(o){console.warn(n(o))}function t(n){return function(o){"1"!==process.env[n]&&(process.env[n]="1",o())}}export{t as once,o as throwError,r as warn};
+1
View File
@@ -0,0 +1 @@
import r from"fs";import t from"path";function e(e,a){const n=t.dirname(e),o=t.basename(e);return r.watch(n,{persistent:!1,recursive:!1},((r,t)=>{t===o&&a()}))}export{e as default};
+1
View File
@@ -0,0 +1 @@
import{useFormatter as r,useTranslations as t}from"use-intl";function o(r,t){return(...r)=>{try{return t(...r)}catch{throw new Error(void 0)}}}const n=o(0,t),e=o(0,r);export{e as useFormatter,n as useTranslations};
@@ -0,0 +1 @@
import e from"../server/react-server/getConfigNow.js";import r from"../server/react-server/getFormats.js";import t from"../shared/NextIntlClientProvider.js";import{jsx as o}from"react/jsx-runtime";import s from"../server/react-server/getTimeZone.js";import a from"../server/react-server/getMessages.js";import m from"../server/react-server/getLocale.js";async function i({formats:i,locale:n,messages:v,now:f,timeZone:c,...g}){return o(t,{formats:void 0===i?await r():i,locale:n??await m(),messages:void 0===v?await a():v,now:f??await e(),timeZone:c??await s(),...g})}export{i as default};
+1
View File
@@ -0,0 +1 @@
import e from"../server/react-server/getConfig.js";import n from"../shared/use.js";function r(r){return function(e,r){try{return n(r)}catch(n){throw n instanceof TypeError&&n.message.includes("Cannot read properties of null (reading 'use')")?new Error(`\`${e}\` is not callable within an async component. Please refer to https://next-intl.dev/docs/environments/server-client-components#async-components`,{cause:n}):n}}(r,e())}export{r as default};
@@ -0,0 +1 @@
import r from"../server/react-server/getServerExtractor.js";import e from"./useConfig.js";function t(t){const o=e("useExtracted");return r(o,t)}export{t as default};
@@ -0,0 +1 @@
import r from"../server/react-server/getServerFormatter.js";import e from"./useConfig.js";function t(){const t=e("useFormatter");return r(t)}export{t as default};
+1
View File
@@ -0,0 +1 @@
import e from"./useConfig.js";function o(){return e("useLocale").locale}export{o as default};
@@ -0,0 +1 @@
import{getMessagesFromConfig as e}from"../server/react-server/getMessages.js";import s from"./useConfig.js";function r(){const r=s("useMessages");return e(r)}export{r as default};
+1
View File
@@ -0,0 +1 @@
import e from"../server/react-server/getDefaultNow.js";import o from"./useConfig.js";function t(t){null!=t?.updateInterval&&console.error("`useNow` doesn't support the `updateInterval` option in Server Components, the value will be ignored. If you need the value to update, you can convert the component to a Client Component.");return o("useNow").now??e()}export{t as default};
@@ -0,0 +1 @@
import e from"./useConfig.js";function o(){return e("useTimeZone").timeZone}export{o as default};
@@ -0,0 +1 @@
import r from"../server/react-server/getServerTranslator.js";import e from"./useConfig.js";function s(...[s]){const t=e("useTranslations");return r(t,s)}export{s as default};
+1
View File
@@ -0,0 +1 @@
export{default as defineRouting}from"./routing/defineRouting.js";
+1
View File
@@ -0,0 +1 @@
function e(e){return{...e,localePrefix:(a=e.localePrefix,"object"==typeof a?a:{mode:a||"always"}),localeCookie:(o=e.localeCookie,!!(o??1)&&{name:"NEXT_LOCALE",sameSite:"lax",..."object"==typeof o&&o}),localeDetection:e.localeDetection??!0,alternateLinks:e.alternateLinks??!0};var o,a}export{e as receiveRoutingConfig};
+1
View File
@@ -0,0 +1 @@
function t(t){return t}export{t as default};
+1
View File
@@ -0,0 +1 @@
export{getExtracted,getFormatter,getLocale,getMessages,getNow,getRequestConfig,getTimeZone,getTranslations,setRequestLocale}from"./server/react-client/index.js";
+1
View File
@@ -0,0 +1 @@
export{default as getRequestConfig}from"./server/react-server/getRequestConfig.js";export{default as getFormatter}from"./server/react-server/getFormatter.js";export{default as getNow}from"./server/react-server/getNow.js";export{default as getTimeZone}from"./server/react-server/getTimeZone.js";export{default as getExtracted}from"./server/react-server/getExtracted.js";export{default as getMessages}from"./server/react-server/getMessages.js";export{default as getLocale}from"./server/react-server/getLocale.js";export{default as getTranslations}from"./server/react-server/getTranslations.js";export{setCachedRequestLocale as setRequestLocale}from"./server/react-server/RequestLocaleCache.js";
@@ -0,0 +1 @@
function e(e){return()=>{throw new Error(`\`${e}\` is not supported in Client Components.`)}}function t(...t){return e("getRequestConfig")}const n=e("getFormatter"),o=e("getNow"),r=e("getTimeZone"),s=e("getMessages"),g=e("getLocale"),i=e("getExtracted"),a=e("getTranslations"),u=e("setRequestLocale");export{i as getExtracted,n as getFormatter,g as getLocale,s as getMessages,o as getNow,t as getRequestConfig,r as getTimeZone,a as getTranslations,u as setRequestLocale};
@@ -0,0 +1 @@
import{headers as t}from"next/headers";import{cache as e}from"react";import{HEADER_LOCALE_NAME as n}from"../../shared/constants.js";import{isPromise as r}from"../../shared/utils.js";import{getCachedRequestLocale as o}from"./RequestLocaleCache.js";const s=e((async function(){const e=t();return r(e)?await e:e}));const i=e((async function(){let t;try{t=(await s()).get(n)||void 0}catch(t){if(t instanceof Error&&"DYNAMIC_SERVER_USAGE"===t.digest){const e=new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl.dev/docs/routing/setup#static-rendering",{cause:t});throw e.digest=t.digest,e}throw t}return t}));async function a(){return o()||await i()}export{a as getRequestLocale};
@@ -0,0 +1 @@
import{cache as o}from"react";const n=o((function(){return{locale:void 0}}));function t(){return n().locale}function c(o){n().locale=o}export{t as getCachedRequestLocale,c as setCachedRequestLocale};
@@ -0,0 +1 @@
import t from"next-intl/config";export{default}from"next-intl/config";
@@ -0,0 +1 @@
import{cache as e}from"react";import{initializeConfig as t,_createIntlFormatters as o,_createCache as r}from"use-intl/core";import{isPromise as n}from"../../shared/utils.js";import{getRequestLocale as i}from"./RequestLocale.js";import s from"next-intl/config";const a=e((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const c=e((async function(e,t){let o=e({locale:t,get requestLocale(){return t?Promise.resolve(t):i()}});if(n(o)&&(o=await o),!o.locale)throw new Error("No locale was returned from `getRequestConfig`.\n\nSee https://next-intl.dev/docs/usage/configuration#i18n-request");return o})),m=e(o),l=e(r);const u=e((async function(e){const o=await c(s,e);return{...t(o),_formatters:m(l()),timeZone:o.timeZone||a()}}));export{u as default};
@@ -0,0 +1 @@
import{cache as t}from"react";import o from"./getConfig.js";const r=t((async function(t){return(await o(t)).now}));export{r as default};
@@ -0,0 +1 @@
import{cache as t}from"react";const e=t((function(){return new Date}));export{e as default};
@@ -0,0 +1 @@
import{cache as t}from"react";import r from"./getConfig.js";import o from"./getServerExtractor.js";const e=t((async function(t){let e,a;"string"==typeof t?e=t:t&&(a=t.locale,e=t.namespace);const n=await r(a);return o(n,e)}));export{e as default};
@@ -0,0 +1 @@
import{cache as t}from"react";import o from"./getConfig.js";const r=t((async function(){return(await o()).formats}));export{r as default};
@@ -0,0 +1 @@
import{cache as t}from"react";import r from"./getConfig.js";import o from"./getServerFormatter.js";const e=t((async function(t){const e=await r(t);return o(e)}));async function n(t){return e(t?.locale)}export{n as default};
@@ -0,0 +1 @@
import{cache as t}from"react";import o from"./getConfig.js";const r=t((async function(){return(await o()).locale}));export{r as default};
@@ -0,0 +1 @@
import{cache as e}from"react";import t from"./getConfig.js";function o(e){if(!e.messages)throw new Error("No messages found. Have you configured them correctly? See https://next-intl.dev/docs/configuration#messages");return e.messages}const n=e((async function(e){return o(await t(e))}));async function r(e){return n(e?.locale)}export{r as default,o as getMessagesFromConfig};
@@ -0,0 +1 @@
import o from"./getConfigNow.js";import t from"./getDefaultNow.js";async function a(a){return await o(a?.locale)??t()}export{a as default};
@@ -0,0 +1 @@
function t(t){return t}export{t as default};
@@ -0,0 +1 @@
import{cache as r}from"react";import o from"./getServerTranslator.js";var t=r((function(r,t){const n=o(r,t);function i(...[r,o,t]){return n(void 0,o,t,void 0)}return i.rich=function(...[r,o,t]){return n.rich(void 0,o,t,void 0)},i.markup=function(...[r,o,t]){return n.markup(void 0,o,t,void 0)},i.has=function(...[r]){return!0},i}));export{t as default};
@@ -0,0 +1 @@
import{cache as t}from"react";import{createFormatter as o}from"use-intl/core";import r from"./getDefaultNow.js";const e=t((function(t){return o({...t,get now(){return t.now??r()}})}));export{e as default};
@@ -0,0 +1 @@
import{cache as r}from"react";import{createTranslator as e}from"use-intl/core";var t=r((function(r,t){return e({...r,namespace:t})}));export{t as default};
@@ -0,0 +1 @@
import{cache as t}from"react";import n from"./getConfig.js";const o=t((async function(t){return(await n(t)).timeZone}));async function r(t){return o(t?.locale)}export{r as default};
@@ -0,0 +1 @@
import{cache as r}from"react";import t from"./getConfig.js";import e from"./getServerTranslator.js";var o=r((async function(r){let o,a;"string"==typeof r?o=r:r&&(a=r.locale,o=r.namespace);const n=await t(a);return e(n,o)}));export{o as default};
@@ -0,0 +1,2 @@
"use client";
import{IntlProvider as r}from"use-intl/react";import{jsx as o}from"react/jsx-runtime";function t({locale:t,...e}){if(!t)throw new Error(void 0);return o(r,{locale:t,...e})}export{t as default};
+1
View File
@@ -0,0 +1 @@
const L="X-NEXT-INTL-LOCALE";export{L as HEADER_LOCALE_NAME};
+1
View File
@@ -0,0 +1 @@
import*as r from"react";var a=r["use".trim()];export{a as default};
+1
View File
@@ -0,0 +1 @@
function n(n){return function(n){return"object"==typeof n?null==n.host&&null==n.hostname:!/^[a-z]+:/i.test(n)}(n)&&!function(n){const t="object"==typeof n?n.pathname:n;return null!=t&&!t.startsWith("/")}(n)}function t(n,t){return n.replace(new RegExp(`^${t}`),"")||"/"}function e(n,t){let e=n;return/^\/(\?.*)?$/.test(t)&&(t=t.slice(1)),e+=t,e}function r(n,t){return t===n||t.startsWith(`${n}/`)}function u(n,t,e){return"string"==typeof n?n:n[t]||e}function i(n){const t=function(){try{return"true"===process.env._next_intl_trailing_slash}catch{return!1}}(),[e,...r]=n.split("#"),u=r.join("#");let i=e;if("/"!==i){const n=i.endsWith("/");t&&!n?i+="/":!t&&n&&(i=i.slice(0,-1))}return u&&(i+="#"+u),i}function c(n,t){const e=i(n),r=i(t);return s(e).test(r)}function o(n,t){return"never"!==t.mode&&t.prefixes?.[n]||f(n)}function f(n){return"/"+n}function s(n){const t=n.replace(/\/\[\[(\.\.\.[^\]]+)\]\]/g,"(?:/(.*))?").replace(/\[\[(\.\.\.[^\]]+)\]\]/g,"(?:/(.*))?").replace(/\[(\.\.\.[^\]]+)\]/g,"(.+)").replace(/\[([^\]]+)\]/g,"([^/]+)");return new RegExp(`^${t}$`)}function l(n){return n.includes("[[...")}function p(n){return n.includes("[...")}function a(n){return n.includes("[")}function h(n,t){const e=n.split("/"),r=t.split("/"),u=Math.max(e.length,r.length);for(let n=0;n<u;n++){const t=e[n],u=r[n];if(!t&&u)return-1;if(t&&!u)return 1;if(t||u){if(!a(t)&&a(u))return-1;if(a(t)&&!a(u))return 1;if(!p(t)&&p(u))return-1;if(p(t)&&!p(u))return 1;if(!l(t)&&l(u))return-1;if(l(t)&&!l(u))return 1}}return 0}function g(n){return n.sort(h)}function x(n){return"function"==typeof n.then}export{f as getLocaleAsPrefix,o as getLocalePrefix,u as getLocalizedTemplate,g as getSortedPathnames,r as hasPathnamePrefixed,n as isLocalizableHref,x as isPromise,c as matchesPathname,i as normalizeTrailingSlash,e as prefixPathname,s as templateToRegex,t as unprefixPathname};