main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
import React from "react";
export const AmpStateContext = React.createContext({});
if (process.env.NODE_ENV !== "production") {
AmpStateContext.displayName = "AmpStateContext";
}
//# sourceMappingURL=amp-context.shared-runtime.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/amp-context.shared-runtime.ts"],"names":["React","AmpStateContext","createContext","process","env","NODE_ENV","displayName"],"mappings":"AAAA,OAAOA,WAAW,QAAO;AAEzB,OAAO,MAAMC,kBAAsCD,MAAME,aAAa,CAAC,CAAC,GAAE;AAE1E,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzCJ,gBAAgBK,WAAW,GAAG;AAChC"}

6
node_modules/next/dist/esm/shared/lib/amp-mode.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export function isInAmpMode(param) {
let { ampFirst = false, hybrid = false, hasQuery = false } = param === void 0 ? {} : param;
return ampFirst || hybrid && hasQuery;
}
//# sourceMappingURL=amp-mode.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/amp-mode.ts"],"names":["isInAmpMode","ampFirst","hybrid","hasQuery"],"mappings":"AAAA,OAAO,SAASA,YAAY;IAAA,IAAA,EAC1BC,WAAW,KAAK,EAChBC,SAAS,KAAK,EACdC,WAAW,KAAK,EACjB,GAJ2B,mBAIxB,CAAC,IAJuB;IAK1B,OAAOF,YAAaC,UAAUC;AAChC"}

9
node_modules/next/dist/esm/shared/lib/amp.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import React from "react";
import { AmpStateContext } from "./amp-context.shared-runtime";
import { isInAmpMode } from "./amp-mode";
export function useAmp() {
// Don't assign the context value to a variable to save bytes
return isInAmpMode(React.useContext(AmpStateContext));
}
//# sourceMappingURL=amp.js.map

1
node_modules/next/dist/esm/shared/lib/amp.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/amp.ts"],"names":["React","AmpStateContext","isInAmpMode","useAmp","useContext"],"mappings":"AAAA,OAAOA,WAAW,QAAO;AACzB,SAASC,eAAe,QAAQ,+BAA8B;AAC9D,SAASC,WAAW,QAAQ,aAAY;AAExC,OAAO,SAASC;IACd,6DAA6D;IAC7D,OAAOD,YAAYF,MAAMI,UAAU,CAACH;AACtC"}

41
node_modules/next/dist/esm/shared/lib/app-dynamic.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
import React from "react";
import Loadable from "./lazy-dynamic/loadable";
// Normalize loader to return the module as form { default: Component } for `React.lazy`.
// Also for backward compatible since next/dynamic allows to resolve a component directly with loader
// Client component reference proxy need to be converted to a module.
function convertModule(mod) {
return {
default: (mod == null ? void 0 : mod.default) || mod
};
}
export default function dynamic(dynamicOptions, options) {
const loadableFn = Loadable;
const loadableOptions = {
// A loading component is not required, so we default it
loading: (param)=>{
let { error, isLoading, pastDelay } = param;
if (!pastDelay) return null;
if (process.env.NODE_ENV !== "production") {
if (isLoading) {
return null;
}
if (error) {
return /*#__PURE__*/ React.createElement("p", null, error.message, /*#__PURE__*/ React.createElement("br", null), error.stack);
}
}
return null;
}
};
if (typeof dynamicOptions === "function") {
loadableOptions.loader = dynamicOptions;
}
Object.assign(loadableOptions, options);
const loaderFn = loadableOptions.loader;
const loader = ()=>loaderFn != null ? loaderFn().then(convertModule) : Promise.resolve(convertModule(()=>null));
return loadableFn({
...loadableOptions,
loader: loader
});
}
//# sourceMappingURL=app-dynamic.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/app-dynamic.tsx"],"names":["React","Loadable","convertModule","mod","default","dynamic","dynamicOptions","options","loadableFn","loadableOptions","loading","error","isLoading","pastDelay","process","env","NODE_ENV","p","message","br","stack","loader","Object","assign","loaderFn","then","Promise","resolve"],"mappings":"AAAA,OAAOA,WAAW,QAAO;AACzB,OAAOC,cAAc,0BAAyB;AAyB9C,yFAAyF;AACzF,qGAAqG;AACrG,qEAAqE;AACrE,SAASC,cAAiBC,GAAgD;IACxE,OAAO;QAAEC,SAAS,CAACD,uBAAD,AAACA,IAA4BC,OAAO,KAAID;IAAI;AAChE;AAiBA,eAAe,SAASE,QACtBC,cAA6C,EAC7CC,OAA2B;IAE3B,MAAMC,aAA4BP;IAElC,MAAMQ,kBAAsC;QAC1C,wDAAwD;QACxDC,SAAS;gBAAC,EAAEC,KAAK,EAAEC,SAAS,EAAEC,SAAS,EAAE;YACvC,IAAI,CAACA,WAAW,OAAO;YACvB,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACzC,IAAIJ,WAAW;oBACb,OAAO;gBACT;gBACA,IAAID,OAAO;oBACT,qBACE,oBAACM,WACEN,MAAMO,OAAO,gBACd,oBAACC,aACAR,MAAMS,KAAK;gBAGlB;YACF;YACA,OAAO;QACT;IACF;IAEA,IAAI,OAAOd,mBAAmB,YAAY;QACxCG,gBAAgBY,MAAM,GAAGf;IAC3B;IAEAgB,OAAOC,MAAM,CAACd,iBAAiBF;IAE/B,MAAMiB,WAAWf,gBAAgBY,MAAM;IACvC,MAAMA,SAAS,IACbG,YAAY,OACRA,WAAWC,IAAI,CAACvB,iBAChBwB,QAAQC,OAAO,CAACzB,cAAc,IAAM;IAE1C,OAAOM,WAAW;QAAE,GAAGC,eAAe;QAAEY,QAAQA;IAAoB;AACtE"}

View File

@@ -0,0 +1,21 @@
"use client";
import React from "react";
export var CacheStates;
(function(CacheStates) {
CacheStates["LAZY_INITIALIZED"] = "LAZYINITIALIZED";
CacheStates["DATA_FETCH"] = "DATAFETCH";
CacheStates["READY"] = "READY";
})(CacheStates || (CacheStates = {}));
export const AppRouterContext = React.createContext(null);
export const LayoutRouterContext = React.createContext(null);
export const GlobalLayoutRouterContext = React.createContext(null);
export const TemplateContext = React.createContext(null);
if (process.env.NODE_ENV !== "production") {
AppRouterContext.displayName = "AppRouterContext";
LayoutRouterContext.displayName = "LayoutRouterContext";
GlobalLayoutRouterContext.displayName = "GlobalLayoutRouterContext";
TemplateContext.displayName = "TemplateContext";
}
//# sourceMappingURL=app-router-context.shared-runtime.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/app-router-context.shared-runtime.ts"],"names":["React","CacheStates","LAZY_INITIALIZED","DATA_FETCH","READY","AppRouterContext","createContext","LayoutRouterContext","GlobalLayoutRouterContext","TemplateContext","process","env","NODE_ENV","displayName"],"mappings":"AAAA;AAWA,OAAOA,WAAW,QAAO;WAKlB;UAAKC,WAAW;IAAXA,YACVC,sBAAmB;IADTD,YAEVE,gBAAa;IAFHF,YAGVG,WAAAA;GAHUH,gBAAAA;AA4FZ,OAAO,MAAMI,mBAAmBL,MAAMM,aAAa,CACjD,MACD;AACD,OAAO,MAAMC,sBAAsBP,MAAMM,aAAa,CAInD,MAAY;AACf,OAAO,MAAME,4BAA4BR,MAAMM,aAAa,CAUzD,MAAY;AAEf,OAAO,MAAMG,kBAAkBT,MAAMM,aAAa,CAAkB,MAAY;AAEhF,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzCP,iBAAiBQ,WAAW,GAAG;IAC/BN,oBAAoBM,WAAW,GAAG;IAClCL,0BAA0BK,WAAW,GAAG;IACxCJ,gBAAgBI,WAAW,GAAG;AAChC"}

View File

@@ -0,0 +1,44 @@
// original source: https://github.com/niklasvh/base64-arraybuffer/blob/master/src/index.ts
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
// Use a lookup table to find the index.
const lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
for(let i = 0; i < chars.length; i++){
lookup[chars.charCodeAt(i)] = i;
}
export const encode = (arraybuffer)=>{
let bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";
for(i = 0; i < len; i += 3){
base64 += chars[bytes[i] >> 2];
base64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];
base64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];
base64 += chars[bytes[i + 2] & 63];
}
if (len % 3 === 2) {
base64 = base64.substring(0, base64.length - 1) + "=";
} else if (len % 3 === 1) {
base64 = base64.substring(0, base64.length - 2) + "==";
}
return base64;
};
export const decode = (base64)=>{
let bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;
if (base64[base64.length - 1] === "=") {
bufferLength--;
if (base64[base64.length - 2] === "=") {
bufferLength--;
}
}
const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);
for(i = 0; i < len; i += 4){
encoded1 = lookup[base64.charCodeAt(i)];
encoded2 = lookup[base64.charCodeAt(i + 1)];
encoded3 = lookup[base64.charCodeAt(i + 2)];
encoded4 = lookup[base64.charCodeAt(i + 3)];
bytes[p++] = encoded1 << 2 | encoded2 >> 4;
bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
}
return arraybuffer;
};
//# sourceMappingURL=base64-arraybuffer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/base64-arraybuffer.ts"],"names":["chars","lookup","Uint8Array","i","length","charCodeAt","encode","arraybuffer","bytes","len","base64","substring","decode","bufferLength","p","encoded1","encoded2","encoded3","encoded4","ArrayBuffer"],"mappings":"AAAA,2FAA2F;AAE3F,MAAMA,QAAQ;AAEd,wCAAwC;AACxC,MAAMC,SAAS,OAAOC,eAAe,cAAc,EAAE,GAAG,IAAIA,WAAW;AACvE,IAAK,IAAIC,IAAI,GAAGA,IAAIH,MAAMI,MAAM,EAAED,IAAK;IACrCF,MAAM,CAACD,MAAMK,UAAU,CAACF,GAAG,GAAGA;AAChC;AAEA,OAAO,MAAMG,SAAS,CAACC;IACrB,IAAIC,QAAQ,IAAIN,WAAWK,cACzBJ,GACAM,MAAMD,MAAMJ,MAAM,EAClB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I,GAAG;QAC3Ce,WAAWjB,MAAM,CAACS,OAAOL,UAAU,CAACF,IAAI,GAAG;QAE3CK,KAAK,CAACM,IAAI,GAAG,AAACC,YAAY,IAAMC,YAAY;QAC5CR,KAAK,CAACM,IAAI,GAAG,AAAEE,CAAAA,WAAW,EAAC,KAAM,IAAMC,YAAY;QACnDT,KAAK,CAACM,IAAI,GAAG,AAAEG,CAAAA,WAAW,CAAA,KAAM,IAAMC,WAAW;IACnD;IAEA,OAAOX;AACT,EAAC"}

74
node_modules/next/dist/esm/shared/lib/bloom-filter.js generated vendored Normal file
View File

@@ -0,0 +1,74 @@
// minimal implementation MurmurHash2 hash function
function murmurhash2(str) {
let h = 0;
for(let i = 0; i < str.length; i++){
const c = str.charCodeAt(i);
h = Math.imul(h ^ c, 0x5bd1e995);
h ^= h >>> 13;
h = Math.imul(h, 0x5bd1e995);
}
return h >>> 0;
}
export class BloomFilter {
static from(items, errorRate) {
if (errorRate === void 0) errorRate = 0.01;
const filter = new BloomFilter(items.length, errorRate);
for (const item of items){
filter.add(item);
}
return filter;
}
export() {
const data = {
numItems: this.numItems,
errorRate: this.errorRate,
numBits: this.numBits,
numHashes: this.numHashes,
bitArray: this.bitArray
};
if (typeof window === "undefined" && process.env.NEXT_RUNTIME !== "edge") {
if (this.errorRate < 0.01) {
const filterData = JSON.stringify(data);
const gzipSize = require("next/dist/compiled/gzip-size").sync(filterData);
if (gzipSize > 1024) {
console.warn("Creating filter with error rate less than 1% (0.01) can increase the size dramatically proceed with caution. Received error rate " + this.errorRate + " resulted in size " + filterData.length + " bytes, " + gzipSize + " bytes (gzip)");
}
}
}
return data;
}
import(data) {
this.numItems = data.numItems;
this.errorRate = data.errorRate;
this.numBits = data.numBits;
this.numHashes = data.numHashes;
this.bitArray = data.bitArray;
}
add(item) {
const hashValues = this.getHashValues(item);
hashValues.forEach((hash)=>{
this.bitArray[hash] = 1;
});
}
contains(item) {
const hashValues = this.getHashValues(item);
return hashValues.every((hash)=>this.bitArray[hash]);
}
getHashValues(item) {
const hashValues = [];
for(let i = 1; i <= this.numHashes; i++){
const hash = murmurhash2("" + item + i) % this.numBits;
hashValues.push(hash);
}
return hashValues;
}
constructor(numItems, errorRate){
this.numItems = numItems;
this.errorRate = errorRate;
this.numBits = Math.ceil(-(numItems * Math.log(errorRate)) / (Math.log(2) * Math.log(2)));
this.numHashes = Math.ceil(this.numBits / numItems * Math.log(2));
this.bitArray = new Array(this.numBits).fill(0);
}
}
//# sourceMappingURL=bloom-filter.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/bloom-filter.ts"],"names":["murmurhash2","str","h","i","length","c","charCodeAt","Math","imul","BloomFilter","from","items","errorRate","filter","item","add","export","data","numItems","numBits","numHashes","bitArray","window","process","env","NEXT_RUNTIME","filterData","JSON","stringify","gzipSize","require","sync","console","warn","import","hashValues","getHashValues","forEach","hash","contains","every","push","constructor","ceil","log","Array","fill"],"mappings":"AAAA,mDAAmD;AACnD,SAASA,YAAYC,GAAW;IAC9B,IAAIC,IAAI;IACR,IAAK,IAAIC,IAAI,GAAGA,IAAIF,IAAIG,MAAM,EAAED,IAAK;QACnC,MAAME,IAAIJ,IAAIK,UAAU,CAACH;QACzBD,IAAIK,KAAKC,IAAI,CAACN,IAAIG,GAAG;QACrBH,KAAKA,MAAM;QACXA,IAAIK,KAAKC,IAAI,CAACN,GAAG;IACnB;IACA,OAAOA,MAAM;AACf;AAEA,OAAO,MAAMO;IAiBX,OAAOC,KAAKC,KAAe,EAAEC,SAAgB,EAAE;QAAlBA,IAAAA,sBAAAA,YAAY;QACvC,MAAMC,SAAS,IAAIJ,YAAYE,MAAMP,MAAM,EAAEQ;QAE7C,KAAK,MAAME,QAAQH,MAAO;YACxBE,OAAOE,GAAG,CAACD;QACb;QACA,OAAOD;IACT;IAEAG,SAAS;QACP,MAAMC,OAAO;YACXC,UAAU,IAAI,CAACA,QAAQ;YACvBN,WAAW,IAAI,CAACA,SAAS;YACzBO,SAAS,IAAI,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O,IAAI,CAACgB,OAAO;YACtDgB,WAAWM,IAAI,CAACH;QAClB;QACA,OAAOH;IACT;IAzEAO,YAAYxB,QAAgB,EAAEN,SAAiB,CAAE;QAC/C,IAAI,CAACM,QAAQ,GAAGA;QAChB,IAAI,CAACN,SAAS,GAAGA;QACjB,IAAI,CAACO,OAAO,GAAGZ,KAAKoC,IAAI,CACtB,CAAEzB,CAAAA,WAAWX,KAAKqC,GAAG,CAAChC,UAAS,IAAML,CAAAA,KAAKqC,GAAG,CAAC,KAAKrC,KAAKqC,GAAG,CAAC,EAAC;QAE/D,IAAI,CAACxB,SAAS,GAAGb,KAAKoC,IAAI,CAAC,AAAC,IAAI,CAACxB,OAAO,GAAGD,WAAYX,KAAKqC,GAAG,CAAC;QAChE,IAAI,CAACvB,QAAQ,GAAG,IAAIwB,MAAM,IAAI,CAAC1B,OAAO,EAAE2B,IAAI,CAAC;IAC/C;AAkEF"}

150
node_modules/next/dist/esm/shared/lib/constants.js generated vendored Normal file
View File

@@ -0,0 +1,150 @@
import MODERN_BROWSERSLIST_TARGET from "./modern-browserslist-target";
export { MODERN_BROWSERSLIST_TARGET };
export const COMPILER_NAMES = {
client: "client",
server: "server",
edgeServer: "edge-server"
};
export const INTERNAL_HEADERS = [
"x-invoke-path",
"x-invoke-status",
"x-invoke-error",
"x-invoke-query",
"x-middleware-invoke"
];
export const COMPILER_INDEXES = {
[COMPILER_NAMES.client]: 0,
[COMPILER_NAMES.server]: 1,
[COMPILER_NAMES.edgeServer]: 2
};
export const PHASE_EXPORT = "phase-export";
export const PHASE_PRODUCTION_BUILD = "phase-production-build";
export const PHASE_PRODUCTION_SERVER = "phase-production-server";
export const PHASE_DEVELOPMENT_SERVER = "phase-development-server";
export const PHASE_TEST = "phase-test";
export const PHASE_INFO = "phase-info";
export const PAGES_MANIFEST = "pages-manifest.json";
export const APP_PATHS_MANIFEST = "app-paths-manifest.json";
export const APP_PATH_ROUTES_MANIFEST = "app-path-routes-manifest.json";
export const BUILD_MANIFEST = "build-manifest.json";
export const APP_BUILD_MANIFEST = "app-build-manifest.json";
export const FUNCTIONS_CONFIG_MANIFEST = "functions-config-manifest.json";
export const SUBRESOURCE_INTEGRITY_MANIFEST = "subresource-integrity-manifest";
export const NEXT_FONT_MANIFEST = "next-font-manifest";
export const EXPORT_MARKER = "export-marker.json";
export const EXPORT_DETAIL = "export-detail.json";
export const PRERENDER_MANIFEST = "prerender-manifest.json";
export const ROUTES_MANIFEST = "routes-manifest.json";
export const IMAGES_MANIFEST = "images-manifest.json";
export const SERVER_FILES_MANIFEST = "required-server-files.json";
export const DEV_CLIENT_PAGES_MANIFEST = "_devPagesManifest.json";
export const MIDDLEWARE_MANIFEST = "middleware-manifest.json";
export const DEV_MIDDLEWARE_MANIFEST = "_devMiddlewareManifest.json";
export const REACT_LOADABLE_MANIFEST = "react-loadable-manifest.json";
export const FONT_MANIFEST = "font-manifest.json";
export const SERVER_DIRECTORY = "server";
export const CONFIG_FILES = [
"next.config.js",
"next.config.mjs"
];
export const BUILD_ID_FILE = "BUILD_ID";
export const BLOCKED_PAGES = [
"/_document",
"/_app",
"/_error"
];
export const CLIENT_PUBLIC_FILES_PATH = "public";
export const CLIENT_STATIC_FILES_PATH = "static";
export const STRING_LITERAL_DROP_BUNDLE = "__NEXT_DROP_CLIENT_FILE__";
export const NEXT_BUILTIN_DOCUMENT = "__NEXT_BUILTIN_DOCUMENT__";
// server/[entry]/page_client-reference-manifest.js
export const CLIENT_REFERENCE_MANIFEST = "client-reference-manifest";
// server/server-reference-manifest
export const SERVER_REFERENCE_MANIFEST = "server-reference-manifest";
// server/middleware-build-manifest.js
export const MIDDLEWARE_BUILD_MANIFEST = "middleware-build-manifest";
// server/middleware-react-loadable-manifest.js
export const MIDDLEWARE_REACT_LOADABLE_MANIFEST = "middleware-react-loadable-manifest";
// static/runtime/main.js
export const CLIENT_STATIC_FILES_RUNTIME_MAIN = "main";
export const CLIENT_STATIC_FILES_RUNTIME_MAIN_APP = "" + CLIENT_STATIC_FILES_RUNTIME_MAIN + "-app";
// next internal client components chunk for layouts
export const APP_CLIENT_INTERNALS = "app-pages-internals";
// static/runtime/react-refresh.js
export const CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH = "react-refresh";
// static/runtime/amp.js
export const CLIENT_STATIC_FILES_RUNTIME_AMP = "amp";
// static/runtime/webpack.js
export const CLIENT_STATIC_FILES_RUNTIME_WEBPACK = "webpack";
// static/runtime/polyfills.js
export const CLIENT_STATIC_FILES_RUNTIME_POLYFILLS = "polyfills";
export const CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL = Symbol(CLIENT_STATIC_FILES_RUNTIME_POLYFILLS);
export const EDGE_RUNTIME_WEBPACK = "edge-runtime-webpack";
export const TEMPORARY_REDIRECT_STATUS = 307;
export const PERMANENT_REDIRECT_STATUS = 308;
export const STATIC_PROPS_ID = "__N_SSG";
export const SERVER_PROPS_ID = "__N_SSP";
export const PAGE_SEGMENT_KEY = "__PAGE__";
export const GOOGLE_FONT_PROVIDER = "https://fonts.googleapis.com/";
export const OPTIMIZED_FONT_PROVIDERS = [
{
url: GOOGLE_FONT_PROVIDER,
preconnect: "https://fonts.gstatic.com"
},
{
url: "https://use.typekit.net",
preconnect: "https://use.typekit.net"
}
];
export const DEFAULT_SERIF_FONT = {
name: "Times New Roman",
xAvgCharWidth: 821,
azAvgWidth: 854.3953488372093,
unitsPerEm: 2048
};
export const DEFAULT_SANS_SERIF_FONT = {
name: "Arial",
xAvgCharWidth: 904,
azAvgWidth: 934.5116279069767,
unitsPerEm: 2048
};
export const STATIC_STATUS_PAGES = [
"/500"
];
export const TRACE_OUTPUT_VERSION = 1;
// in `MB`
export const TURBO_TRACE_DEFAULT_MEMORY_LIMIT = 6000;
export const RSC_MODULE_TYPES = {
client: "client",
server: "server"
};
// comparing
// https://nextjs.org/docs/api-reference/edge-runtime
// with
// https://nodejs.org/docs/latest/api/globals.html
export const EDGE_UNSUPPORTED_NODE_APIS = [
"clearImmediate",
"setImmediate",
"BroadcastChannel",
"ByteLengthQueuingStrategy",
"CompressionStream",
"CountQueuingStrategy",
"DecompressionStream",
"DomException",
"MessageChannel",
"MessageEvent",
"MessagePort",
"ReadableByteStreamController",
"ReadableStreamBYOBRequest",
"ReadableStreamDefaultController",
"TransformStreamDefaultController",
"WritableStreamDefaultController"
];
export const SYSTEM_ENTRYPOINTS = new Set([
CLIENT_STATIC_FILES_RUNTIME_MAIN,
CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH,
CLIENT_STATIC_FILES_RUNTIME_AMP,
CLIENT_STATIC_FILES_RUNTIME_MAIN_APP
]);
//# sourceMappingURL=constants.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/constants.ts"],"names":["MODERN_BROWSERSLIST_TARGET","COMPILER_NAMES","client","server","edgeServer","INTERNAL_HEADERS","COMPILER_INDEXES","PHASE_EXPORT","PHASE_PRODUCTION_BUILD","PHASE_PRODUCTION_SERVER","PHASE_DEVELOPMENT_SERVER","PHASE_TEST","PHASE_INFO","PAGES_MANIFEST","APP_PATHS_MANIFEST","APP_PATH_ROUTES_MANIFEST","BUILD_MANIFEST","APP_BUILD_MANIFEST","FUNCTIONS_CONFIG_MANIFEST","SUBRESOURCE_INTEGRITY_MANIFEST","NEXT_FONT_MANIFEST","EXPORT_MARKER","EXPORT_DETAIL","PRERENDER_MANIFEST","ROUTES_MANIFEST","IMAGES_MANIFEST","SERVER_FILES_MANIFEST","DEV_CLIENT_PAGES_MANIFEST","MIDDLEWARE_MANIFEST","DEV_MIDDLEWARE_MANIFEST","REACT_LOADABLE_MANIFEST","FONT_MANIFEST","SERVER_DIRECTORY","CONFIG_FILES","BUILD_ID_FILE","BLOCKED_PAGES","CLIENT_PUBLIC_FILES_PATH","CLIENT_STATIC_FILES_PATH","STRING_LITERAL_DROP_BUNDLE","NEXT_BUILTIN_DOCUMENT","CLIENT_REFERENCE_MANIFEST","SERVER_REFERENCE_MANIFEST","MIDDLEWARE_BUILD_MANIFEST","MIDDLEWARE_REACT_LOADABLE_MANIFEST","CLIENT_STATIC_FILES_RUNTIME_MAIN","CLIENT_STATIC_FILES_RUNTIME_MAIN_APP","APP_CLIENT_INTERNALS","CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH","CLIENT_STATIC_FILES_RUNTIME_AMP","CLIENT_STATIC_FILES_RUNTIME_WEBPACK","CLIENT_STATIC_FILES_RUNTIME_POLYFILLS","CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL","Symbol","EDGE_RUNTIME_WEBPACK","TEMPORARY_REDIRECT_STATUS","PERMANENT_REDIRECT_STATUS","STATIC_PROPS_ID","SERVER_PROPS_ID","PAGE_SEGMENT_KEY","GOOGLE_FONT_PROVIDER","OPTIMIZED_FONT_PROVIDERS","url","preconnect","DEFAULT_SERIF_FONT","name","xAvgCharWidth","azAvgWidth","unitsPerEm","DEFAULT_SANS_SERIF_FONT","STATIC_STATUS_PAGES","TRACE_OUTPUT_VERSION","TURBO_TRACE_DEFAULT_MEMORY_LIMIT","RSC_MODULE_TYPES","EDGE_UNSUPPORTED_NODE_APIS","SYSTEM_ENTRYPOINTS","Set"],"mappings":"AAAA,OAAOA,gCAAgC,+BAA8B;AAErE,SAASA,0BAA0B,GAAE;AAIrC,OAAO,MAAMC,iBAAiB;IAC5BC,QAAQ;IACRC,QAAQ;IACRC,YAAY;AACd,EAAU;AAEV,OAAO,MAAMC,mBAAmB;IAC9B;IACA;IACA;IACA;IACA;CACD,CAAS;AAIV,OAAO,MAAMC,mBAET;IACF,CAACL,eAAeC,MAAM,CAAC,EAAE;IACzB,CAACD,eAAeE,MAAM,CAAC,EAAE;IACzB,CAACF,eAAeG,UAAU,CAAC,EAAE;AAC/B,EAAU;AAEV,OAAO,MAAMG,eAAe,eAAc;AAC1C,OAAO,MAAMC,yBAAyB,yBAAwB;AAC9D,OAAO,MAAMC,0BAA0B,0BAAyB;AAChE,OAAO,MAAMC,2BAA2B,2BAA0B;AAClE,OAAO,MA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6BAA6B;IACxC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA;AAED,OAAO,MAAMC,qBAAqB,IAAIC,IAAY;IAChD/B;IACAG;IACAC;IACAH;CACD,EAAC"}

90
node_modules/next/dist/esm/shared/lib/dynamic.js generated vendored Normal file
View File

@@ -0,0 +1,90 @@
import React from "react";
import Loadable from "./loadable.shared-runtime";
const isServerSide = typeof window === "undefined";
// Normalize loader to return the module as form { default: Component } for `React.lazy`.
// Also for backward compatible since next/dynamic allows to resolve a component directly with loader
// Client component reference proxy need to be converted to a module.
function convertModule(mod) {
return {
default: (mod == null ? void 0 : mod.default) || mod
};
}
export function noSSR(LoadableInitializer, loadableOptions) {
// Removing webpack and modules means react-loadable won't try preloading
delete loadableOptions.webpack;
delete loadableOptions.modules;
// This check is necessary to prevent react-loadable from initializing on the server
if (!isServerSide) {
return LoadableInitializer(loadableOptions);
}
const Loading = loadableOptions.loading;
// This will only be rendered on the server side
return ()=>/*#__PURE__*/ React.createElement(Loading, {
error: null,
isLoading: true,
pastDelay: false,
timedOut: false
});
}
export default function dynamic(dynamicOptions, options) {
let loadableFn = Loadable;
let loadableOptions = {
// A loading component is not required, so we default it
loading: (param)=>{
let { error, isLoading, pastDelay } = param;
if (!pastDelay) return null;
if (process.env.NODE_ENV !== "production") {
if (isLoading) {
return null;
}
if (error) {
return /*#__PURE__*/ React.createElement("p", null, error.message, /*#__PURE__*/ React.createElement("br", null), error.stack);
}
}
return null;
}
};
// Support for direct import(), eg: dynamic(import('../hello-world'))
// Note that this is only kept for the edge case where someone is passing in a promise as first argument
// The react-loadable babel plugin will turn dynamic(import('../hello-world')) into dynamic(() => import('../hello-world'))
// To make sure we don't execute the import without rendering first
if (dynamicOptions instanceof Promise) {
loadableOptions.loader = ()=>dynamicOptions;
// Support for having import as a function, eg: dynamic(() => import('../hello-world'))
} else if (typeof dynamicOptions === "function") {
loadableOptions.loader = dynamicOptions;
// Support for having first argument being options, eg: dynamic({loader: import('../hello-world')})
} else if (typeof dynamicOptions === "object") {
loadableOptions = {
...loadableOptions,
...dynamicOptions
};
}
// Support for passing options, eg: dynamic(import('../hello-world'), {loading: () => <p>Loading something</p>})
loadableOptions = {
...loadableOptions,
...options
};
const loaderFn = loadableOptions.loader;
const loader = ()=>loaderFn != null ? loaderFn().then(convertModule) : Promise.resolve(convertModule(()=>null));
// coming from build/babel/plugins/react-loadable-plugin.js
if (loadableOptions.loadableGenerated) {
loadableOptions = {
...loadableOptions,
...loadableOptions.loadableGenerated
};
delete loadableOptions.loadableGenerated;
}
// support for disabling server side rendering, eg: dynamic(() => import('../hello-world'), {ssr: false}).
if (typeof loadableOptions.ssr === "boolean" && !loadableOptions.ssr) {
delete loadableOptions.webpack;
delete loadableOptions.modules;
return noSSR(loadableFn, loadableOptions);
}
return loadableFn({
...loadableOptions,
loader: loader
});
}
//# sourceMappingURL=dynamic.js.map

1
node_modules/next/dist/esm/shared/lib/dynamic.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/dynamic.tsx"],"names":["React","Loadable","isServerSide","window","convertModule","mod","default","noSSR","LoadableInitializer","loadableOptions","webpack","modules","Loading","loading","error","isLoading","pastDelay","timedOut","dynamic","dynamicOptions","options","loadableFn","process","env","NODE_ENV","p","message","br","stack","Promise","loader","loaderFn","then","resolve","loadableGenerated","ssr"],"mappings":"AAAA,OAAOA,WAAW,QAAO;AACzB,OAAOC,cAAc,4BAA2B;AAEhD,MAAMC,eAAe,OAAOC,WAAW;AA2BvC,yFAAyF;AACzF,qGAAqG;AACrG,qEAAqE;AACrE,SAASC,cAAiBC,GAAgD;IACxE,OAAO;QAAEC,SAAS,CAACD,uBAAD,AAACA,IAA4BC,OAAO,KAAID;IAAI;AAChE;AAqBA,OAAO,SAASE,MACdC,mBAAkC,EAClCC,eAAkC;IAElC,yEAAyE;IACzE,OAAOA,gBAAgBC,OAAO;IAC9B,OAAOD,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,iBAAiB,EAAE;QACrCzB,kBAAkB;YAChB,GAAGA,eAAe;YAClB,GAAGA,gBAAgByB,iBAAiB;QACtC;QACA,OAAOzB,gBAAgByB,iBAAiB;IAC1C;IAEA,0GAA0G;IAC1G,IAAI,OAAOzB,gBAAgB0B,GAAG,KAAK,aAAa,CAAC1B,gBAAgB0B,GAAG,EAAE;QACpE,OAAO1B,gBAAgBC,OAAO;QAC9B,OAAOD,gBAAgBE,OAAO;QAE9B,OAAOJ,MAAMc,YAAYZ;IAC3B;IAEA,OAAOY,WAAW;QAAE,GAAGZ,eAAe;QAAEqB,QAAQA;IAAoB;AACtE"}

12
node_modules/next/dist/esm/shared/lib/escape-regexp.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
// regexp is based on https://github.com/sindresorhus/escape-string-regexp
const reHasRegExp = /[|\\{}()[\]^$+*?.-]/;
const reReplaceRegExp = /[|\\{}()[\]^$+*?.-]/g;
export function escapeStringRegexp(str) {
// see also: https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/escapeRegExp.js#L23
if (reHasRegExp.test(str)) {
return str.replace(reReplaceRegExp, "\\$&");
}
return str;
}
//# sourceMappingURL=escape-regexp.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/escape-regexp.ts"],"names":["reHasRegExp","reReplaceRegExp","escapeStringRegexp","str","test","replace"],"mappings":"AAAA,0EAA0E;AAC1E,MAAMA,cAAc;AACpB,MAAMC,kBAAkB;AAExB,OAAO,SAASC,mBAAmBC,GAAW;IAC5C,+GAA+G;IAC/G,IAAIH,YAAYI,IAAI,CAACD,MAAM;QACzB,OAAOA,IAAIE,OAAO,CAACJ,iBAAiB;IACtC;IACA,OAAOE;AACT"}

43
node_modules/next/dist/esm/shared/lib/fnv1a.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
// source: https://github.com/sindresorhus/fnv1a
// FNV_PRIMES and FNV_OFFSETS from
// http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param
/* eslint-disable @typescript-eslint/no-loss-of-precision */ const FNV_PRIMES = {
32: BigInt(16777619),
64: BigInt(1099511628211),
128: BigInt(309485009821345068724781371),
256: BigInt(374144419156711147060143317175368453031918731002211),
512: BigInt(35835915874844867368919076489095108449946327955754392558399825615420669938882575126094039892345713852759),
1024: BigInt(5016456510113118655434598811035278955030765345404790744303017523831112055108147451509157692220295382716162651878526895249385292291816524375083746691371804094271873160484737966720260389217684476157468082573)
};
const FNV_OFFSETS = {
32: BigInt(2166136261),
64: BigInt(14695981039346656037),
128: BigInt(144066263297769815596495629667062367629),
256: BigInt(100029257958052580907070968620625704837092796014241193945225284501741471925557),
512: BigInt(9659303129496669498009435400716310466090418745672637896108374329434462657994582932197716438449813051892206539805784495328239340083876191928701583869517785),
1024: BigInt(14197795064947621068722070641403218320880622795441933960878474914617582723252296732303717722150864096521202355549365628174669108571814760471015076148029755969804077320157692458563003215304957150157403644460363550505412711285966361610267868082893823963790439336411086884584107735010676915)
};
export default function fnv1a(inputString, param) {
let { size = 32, seed = 0 } = param === void 0 ? {} : param;
if (!FNV_PRIMES[size]) {
throw new Error("The `size` option must be one of 32, 64, 128, 256, 512, or 1024");
}
let hash = FNV_OFFSETS[size] ^ BigInt(seed);
const fnvPrime = FNV_PRIMES[size];
// Handle Unicode code points > 0x7f
let isUnicoded = false;
for(let index = 0; index < inputString.length; index++){
let characterCode = inputString.charCodeAt(index);
// Non-ASCII characters trigger the Unicode escape logic
if (characterCode > 0x7f && !isUnicoded) {
inputString = unescape(encodeURIComponent(inputString));
characterCode = inputString.charCodeAt(index);
isUnicoded = true;
}
hash ^= BigInt(characterCode);
hash = BigInt.asUintN(size, hash * fnvPrime);
}
return hash;
}
//# sourceMappingURL=fnv1a.js.map

1
node_modules/next/dist/esm/shared/lib/fnv1a.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/fnv1a.ts"],"names":["FNV_PRIMES","BigInt","FNV_OFFSETS","fnv1a","inputString","size","seed","Error","hash","fnvPrime","isUnicoded","index","length","characterCode","charCodeAt","unescape","encodeURIComponent","asUintN"],"mappings":"AAAA,gDAAgD;AAChD,kCAAkC;AAClC,iEAAiE;AACjE,0DAA0D,GAE1D,MAAMA,aAAa;IACjB,IAAIC,OAAO;IACX,IAAIA,OAAO;IACX,KAAKA,OAAO;IACZ,KAAKA,OACH;IAEF,KAAKA,OACH;IAEF,MAAMA,OACJ;AAEJ;AAEA,MAAMC,cAAc;IAClB,IAAID,OAAO;IACX,IAAIA,OAAO;IACX,KAAKA,OAAO;IACZ,KAAKA,OACH;IAEF,KAAKA,OACH;IAEF,MAAMA,OACJ;AAEJ;AAEA,eAAe,SAASE,MACtBC,WAAmB,EACnB;IAAA,IAAA,EACEC,OAAO,EAAE,EACTC,OAAO,CAAC,EAIT,GAND,mBAMI,CAAC,IANL;IAQA,IAAI,CAACN,UAAU,CAACK,KAAK,EAAE;QACrB,MAAM,IAAIE,MACR;IAEJ;IAEA,IAAIC,OAAeN,WAAW,CAACG,KAAK,GAAGJ,OAAOK;IAC9C,MAAMG,WAAWT,UAAU,CAACK,KAAK;IAEjC,oCAAoC;IACpC,IAAIK,aAAa;IAEjB,IAAK,IAAIC,QAAQ,GAAGA,QAAQP,YAAYQ,MAAM,EAAED,QAAS;QACvD,IAAIE,gBAAgBT,YAAYU,UAAU,CAACH;QAE3C,wDAAwD;QACxD,IAAIE,gBAAgB,QAAQ,CAACH,YAAY;YACvCN,cAAcW,SAASC,mBAAmBZ;YAC1CS,gBAAgBT,YAAYU,UAAU,CAACH;YACvCD,aAAa;QACf;QAEAF,QAAQP,OAAOY;QACfL,OAAOP,OAAOgB,OAAO,CAACZ,MAAMG,OAAOC;IACrC;IAEA,OAAOD;AACT"}

18
node_modules/next/dist/esm/shared/lib/get-hostname.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
/**
* Takes an object with a hostname property (like a parsed URL) and some
* headers that may contain Host and returns the preferred hostname.
* @param parsed An object containing a hostname property.
* @param headers A dictionary with headers containing a `host`.
*/ export function getHostname(parsed, headers) {
// Get the hostname from the headers if it exists, otherwise use the parsed
// hostname.
let hostname;
if ((headers == null ? void 0 : headers.host) && !Array.isArray(headers.host)) {
hostname = headers.host.toString().split(":")[0];
} else if (parsed.hostname) {
hostname = parsed.hostname;
} else return;
return hostname.toLowerCase();
}
//# sourceMappingURL=get-hostname.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/get-hostname.ts"],"names":["getHostname","parsed","headers","hostname","host","Array","isArray","toString","split","toLowerCase"],"mappings":"AAEA;;;;;CAKC,GACD,OAAO,SAASA,YACdC,MAAoC,EACpCC,OAA6B;IAE7B,2EAA2E;IAC3E,YAAY;IACZ,IAAIC;IACJ,IAAID,CAAAA,2BAAAA,QAASE,IAAI,KAAI,CAACC,MAAMC,OAAO,CAACJ,QAAQE,IAAI,GAAG;QACjDD,WAAWD,QAAQE,IAAI,CAACG,QAAQ,GAAGC,KAAK,CAAC,IAAI,CAAC,EAAE;IAClD,OAAO,IAAIP,OAAOE,QAAQ,EAAE;QAC1BA,WAAWF,OAAOE,QAAQ;IAC5B,OAAO;IAEP,OAAOA,SAASM,WAAW;AAC7B"}

View File

@@ -0,0 +1,94 @@
import { getHostname } from "./get-hostname";
describe("getHostname", ()=>{
describe("from URL", ()=>{
it.each([
{
url: "http://example.com",
hostname: "example.com"
},
{
url: "http://example.com/",
hostname: "example.com"
},
{
url: "http://example.com:3000",
hostname: "example.com"
},
{
url: "https://example.com",
hostname: "example.com"
},
{
url: "https://example.com/",
hostname: "example.com"
},
{
url: "https://example.com:3000",
hostname: "example.com"
},
{
url: "http://localhost",
hostname: "localhost"
},
{
url: "http://localhost/",
hostname: "localhost"
},
{
url: "http://localhost:3000",
hostname: "localhost"
},
{
url: "http://127.0.0.1",
hostname: "127.0.0.1"
},
{
url: "http://127.0.0.1/",
hostname: "127.0.0.1"
},
{
url: "http://127.0.0.1:3000",
hostname: "127.0.0.1"
},
{
url: "http://8.8.8.8",
hostname: "8.8.8.8"
},
{
url: "http://8.8.8.8/",
hostname: "8.8.8.8"
},
{
url: "http://8.8.8.8:3000",
hostname: "8.8.8.8"
}
])("should return $hostname for $url", (param)=>{
let { url, hostname } = param;
const parsed = new URL(url);
// Base case.
expect(getHostname(parsed)).toBe(hostname);
// With headers.
expect(getHostname(parsed, {
host: parsed.host
})).toBe(hostname);
// With an empty headers array.
expect(getHostname(parsed, {
host: []
})).toBe(hostname);
// With a headers array.
expect(getHostname({}, {
host: [
parsed.host
]
})).toBe(undefined);
});
});
it("should return undefined for empty input", ()=>{
expect(getHostname({})).toBe(undefined);
expect(getHostname({}, {
host: []
})).toBe(undefined);
});
});
//# sourceMappingURL=get-hostname.test.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/get-hostname.test.ts"],"names":["getHostname","describe","it","each","url","hostname","parsed","URL","expect","toBe","host","undefined"],"mappings":"AAAA,SAASA,WAAW,QAAQ,iBAAgB;AAE5CC,SAAS,eAAe;IACtBA,SAAS,YAAY;QACnBC,GAAGC,IAAI,CAAC;YACN;gBAAEC,KAAK;gBAAsBC,UAAU;YAAc;YACrD;gBAAED,KAAK;gBAAuBC,UAAU;YAAc;YACtD;gBAAED,KAAK;gBAA2BC,UAAU;YAAc;YAC1D;gBAAED,KAAK;gBAAuBC,UAAU;YAAc;YACtD;gBAAED,KAAK;gBAAwBC,UAAU;YAAc;YACvD;gBAAED,KAAK;gBAA4BC,UAAU;YAAc;YAC3D;gBAAED,KAAK;gBAAoBC,UAAU;YAAY;YACjD;gBAAED,KAAK;gBAAqBC,UAAU;YAAY;YAClD;gBAAED,KAAK;gBAAyBC,UAAU;YAAY;YACtD;gBAAED,KAAK;gBAAoBC,UAAU;YAAY;YACjD;gBAAED,KAAK;gBAAqBC,UAAU;YAAY;YAClD;gBAAED,KAAK;gBAAyBC,UAAU;YAAY;YACtD;gBAAED,KAAK;gBAAkBC,UAAU;YAAU;YAC7C;gBAAED,KAAK;gBAAmBC,UAAU;YAAU;YAC9C;gBAAED,KAAK;gBAAuBC,UAAU;YAAU;SACnD,EAAE,oCAAoC;gBAAC,EAAED,GAAG,EAAEC,QAAQ,EAAE;YACvD,MAAMC,SAAS,IAAIC,IAAIH;YAEvB,aAAa;YACbI,OAAOR,YAAYM,SAASG,IAAI,CAACJ;YACjC,gBAAgB;YAChBG,OAAOR,YAAYM,QAAQ;gBAAEI,MAAMJ,OAAOI,IAAI;YAAC,IAAID,IAAI,CAACJ;YACxD,+BAA+B;YAC/BG,OAAOR,YAAYM,QAAQ;gBAAEI,MAAM,EAAE;YAAC,IAAID,IAAI,CAACJ;YAC/C,wBAAwB;YACxBG,OAAOR,YAAY,CAAC,GAAG;gBAAEU,MAAM;oBAACJ,OAAOI,IAAI;iBAAC;YAAC,IAAID,IAAI,CAACE;QACxD;IACF;IAEAT,GAAG,2CAA2C;QAC5CM,OAAOR,YAAY,CAAC,IAAIS,IAAI,CAACE;QAC7BH,OAAOR,YAAY,CAAC,GAAG;YAAEU,MAAM,EAAE;QAAC,IAAID,IAAI,CAACE;IAC7C;AACF"}

436
node_modules/next/dist/esm/shared/lib/get-img-props.js generated vendored Normal file
View File

@@ -0,0 +1,436 @@
import { warnOnce } from "./utils/warn-once";
import { getImageBlurSvg } from "./image-blur-svg";
import { imageConfigDefault } from "./image-config";
const VALID_LOADING_VALUES = [
"lazy",
"eager",
undefined
];
function isStaticRequire(src) {
return src.default !== undefined;
}
function isStaticImageData(src) {
return src.src !== undefined;
}
function isStaticImport(src) {
return typeof src === "object" && (isStaticRequire(src) || isStaticImageData(src));
}
const allImgs = new Map();
let perfObserver;
function getInt(x) {
if (typeof x === "undefined") {
return x;
}
if (typeof x === "number") {
return Number.isFinite(x) ? x : NaN;
}
if (typeof x === "string" && /^[0-9]+$/.test(x)) {
return parseInt(x, 10);
}
return NaN;
}
function getWidths(param, width, sizes) {
let { deviceSizes, allSizes } = param;
if (sizes) {
// Find all the "vw" percent sizes used in the sizes prop
const viewportWidthRe = /(^|\s)(1?\d?\d)vw/g;
const percentSizes = [];
for(let match; match = viewportWidthRe.exec(sizes); match){
percentSizes.push(parseInt(match[2]));
}
if (percentSizes.length) {
const smallestRatio = Math.min(...percentSizes) * 0.01;
return {
widths: allSizes.filter((s)=>s >= deviceSizes[0] * smallestRatio),
kind: "w"
};
}
return {
widths: allSizes,
kind: "w"
};
}
if (typeof width !== "number") {
return {
widths: deviceSizes,
kind: "w"
};
}
const widths = [
...new Set(// > This means that most OLED screens that say they are 3x resolution,
// > are actually 3x in the green color, but only 1.5x in the red and
// > blue colors. Showing a 3x resolution image in the app vs a 2x
// > resolution image will be visually the same, though the 3x image
// > takes significantly more data. Even true 3x resolution screens are
// > wasteful as the human eye cannot see that level of detail without
// > something like a magnifying glass.
// https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/capping-image-fidelity-on-ultra-high-resolution-devices.html
[
width,
width * 2 /*, width * 3*/
].map((w)=>allSizes.find((p)=>p >= w) || allSizes[allSizes.length - 1]))
];
return {
widths,
kind: "x"
};
}
function generateImgAttrs(param) {
let { config, src, unoptimized, width, quality, sizes, loader } = param;
if (unoptimized) {
return {
src,
srcSet: undefined,
sizes: undefined
};
}
const { widths, kind } = getWidths(config, width, sizes);
const last = widths.length - 1;
return {
sizes: !sizes && kind === "w" ? "100vw" : sizes,
srcSet: widths.map((w, i)=>loader({
config,
src,
quality,
width: w
}) + " " + (kind === "w" ? w : i + 1) + kind).join(", "),
// It's intended to keep `src` the last attribute because React updates
// attributes in order. If we keep `src` the first one, Safari will
// immediately start to fetch `src`, before `sizes` and `srcSet` are even
// updated by React. That causes multiple unnecessary requests if `srcSet`
// and `sizes` are defined.
// This bug cannot be reproduced in Chrome or Firefox.
src: loader({
config,
src,
quality,
width: widths[last]
})
};
}
/**
* A shared function, used on both client and server, to generate the props for <img>.
*/ export function getImgProps(param, _state) {
let { src, sizes, unoptimized = false, priority = false, loading, className, quality, width, height, fill = false, style, onLoad, onLoadingComplete, placeholder = "empty", blurDataURL, fetchPriority, layout, objectFit, objectPosition, lazyBoundary, lazyRoot, ...rest } = param;
const { imgConf, showAltText, blurComplete, defaultLoader } = _state;
let config;
let c = imgConf || imageConfigDefault;
if ("allSizes" in c) {
config = c;
} else {
const allSizes = [
...c.deviceSizes,
...c.imageSizes
].sort((a, b)=>a - b);
const deviceSizes = c.deviceSizes.sort((a, b)=>a - b);
config = {
...c,
allSizes,
deviceSizes
};
}
let loader = rest.loader || defaultLoader;
// Remove property so it's not spread on <img> element
delete rest.loader;
delete rest.srcSet;
// This special value indicates that the user
// didn't define a "loader" prop or "loader" config.
const isDefaultLoader = "__next_img_default" in loader;
if (isDefaultLoader) {
if (config.loader === "custom") {
throw new Error('Image with src "' + src + '" is missing "loader" prop.' + "\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader");
}
} else {
// The user defined a "loader" prop or config.
// Since the config object is internal only, we
// must not pass it to the user-defined "loader".
const customImageLoader = loader;
loader = (obj)=>{
const { config: _, ...opts } = obj;
return customImageLoader(opts);
};
}
if (layout) {
if (layout === "fill") {
fill = true;
}
const layoutToStyle = {
intrinsic: {
maxWidth: "100%",
height: "auto"
},
responsive: {
width: "100%",
height: "auto"
}
};
const layoutToSizes = {
responsive: "100vw",
fill: "100vw"
};
const layoutStyle = layoutToStyle[layout];
if (layoutStyle) {
style = {
...style,
...layoutStyle
};
}
const layoutSizes = layoutToSizes[layout];
if (layoutSizes && !sizes) {
sizes = layoutSizes;
}
}
let staticSrc = "";
let widthInt = getInt(width);
let heightInt = getInt(height);
let blurWidth;
let blurHeight;
if (isStaticImport(src)) {
const staticImageData = isStaticRequire(src) ? src.default : src;
if (!staticImageData.src) {
throw new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received " + JSON.stringify(staticImageData));
}
if (!staticImageData.height || !staticImageData.width) {
throw new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received " + JSON.stringify(staticImageData));
}
blurWidth = staticImageData.blurWidth;
blurHeight = staticImageData.blurHeight;
blurDataURL = blurDataURL || staticImageData.blurDataURL;
staticSrc = staticImageData.src;
if (!fill) {
if (!widthInt && !heightInt) {
widthInt = staticImageData.width;
heightInt = staticImageData.height;
} else if (widthInt && !heightInt) {
const ratio = widthInt / staticImageData.width;
heightInt = Math.round(staticImageData.height * ratio);
} else if (!widthInt && heightInt) {
const ratio = heightInt / staticImageData.height;
widthInt = Math.round(staticImageData.width * ratio);
}
}
}
src = typeof src === "string" ? src : staticSrc;
let isLazy = !priority && (loading === "lazy" || typeof loading === "undefined");
if (!src || src.startsWith("data:") || src.startsWith("blob:")) {
// https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
unoptimized = true;
isLazy = false;
}
if (config.unoptimized) {
unoptimized = true;
}
if (isDefaultLoader && src.endsWith(".svg") && !config.dangerouslyAllowSVG) {
// Special case to make svg serve as-is to avoid proxying
// through the built-in Image Optimization API.
unoptimized = true;
}
if (priority) {
fetchPriority = "high";
}
const qualityInt = getInt(quality);
if (process.env.NODE_ENV !== "production") {
if (config.output === "export" && isDefaultLoader && !unoptimized) {
throw new Error("Image Optimization using the default loader is not compatible with `{ output: 'export' }`.\n Possible solutions:\n - Remove `{ output: 'export' }` and run \"next start\" to run server mode including the Image Optimization API.\n - Configure `{ images: { unoptimized: true } }` in `next.config.js` to disable the Image Optimization API.\n Read more: https://nextjs.org/docs/messages/export-image-api");
}
if (!src) {
// React doesn't show the stack trace and there's
// no `src` to help identify which image, so we
// instead console.error(ref) during mount.
unoptimized = true;
} else {
if (fill) {
if (width) {
throw new Error('Image with src "' + src + '" has both "width" and "fill" properties. Only one should be used.');
}
if (height) {
throw new Error('Image with src "' + src + '" has both "height" and "fill" properties. Only one should be used.');
}
if ((style == null ? void 0 : style.position) && style.position !== "absolute") {
throw new Error('Image with src "' + src + '" has both "fill" and "style.position" properties. Images with "fill" always use position absolute - it cannot be modified.');
}
if ((style == null ? void 0 : style.width) && style.width !== "100%") {
throw new Error('Image with src "' + src + '" has both "fill" and "style.width" properties. Images with "fill" always use width 100% - it cannot be modified.');
}
if ((style == null ? void 0 : style.height) && style.height !== "100%") {
throw new Error('Image with src "' + src + '" has both "fill" and "style.height" properties. Images with "fill" always use height 100% - it cannot be modified.');
}
} else {
if (typeof widthInt === "undefined") {
throw new Error('Image with src "' + src + '" is missing required "width" property.');
} else if (isNaN(widthInt)) {
throw new Error('Image with src "' + src + '" has invalid "width" property. Expected a numeric value in pixels but received "' + width + '".');
}
if (typeof heightInt === "undefined") {
throw new Error('Image with src "' + src + '" is missing required "height" property.');
} else if (isNaN(heightInt)) {
throw new Error('Image with src "' + src + '" has invalid "height" property. Expected a numeric value in pixels but received "' + height + '".');
}
}
}
if (!VALID_LOADING_VALUES.includes(loading)) {
throw new Error('Image with src "' + src + '" has invalid "loading" property. Provided "' + loading + '" should be one of ' + VALID_LOADING_VALUES.map(String).join(",") + ".");
}
if (priority && loading === "lazy") {
throw new Error('Image with src "' + src + '" has both "priority" and "loading=\'lazy\'" properties. Only one should be used.');
}
if (placeholder !== "empty" && placeholder !== "blur" && !placeholder.startsWith("data:image/")) {
throw new Error('Image with src "' + src + '" has invalid "placeholder" property "' + placeholder + '".');
}
if (placeholder !== "empty") {
if (widthInt && heightInt && widthInt * heightInt < 1600) {
warnOnce('Image with src "' + src + '" is smaller than 40x40. Consider removing the "placeholder" property to improve performance.');
}
}
if (placeholder === "blur" && !blurDataURL) {
const VALID_BLUR_EXT = [
"jpeg",
"png",
"webp",
"avif"
] // should match next-image-loader
;
throw new Error('Image with src "' + src + '" has "placeholder=\'blur\'" property but is missing the "blurDataURL" property.\n Possible solutions:\n - Add a "blurDataURL" property, the contents should be a small Data URL to represent the image\n - Change the "src" property to a static import with one of the supported file types: ' + VALID_BLUR_EXT.join(",") + ' (animated images not supported)\n - Remove the "placeholder" property, effectively no blur effect\n Read more: https://nextjs.org/docs/messages/placeholder-blur-data-url');
}
if ("ref" in rest) {
warnOnce('Image with src "' + src + '" is using unsupported "ref" property. Consider using the "onLoadingComplete" property instead.');
}
if (!unoptimized && !isDefaultLoader) {
const urlStr = loader({
config,
src,
width: widthInt || 400,
quality: qualityInt || 75
});
let url;
try {
url = new URL(urlStr);
} catch (err) {}
if (urlStr === src || url && url.pathname === src && !url.search) {
warnOnce('Image with src "' + src + '" has a "loader" property that does not implement width. Please implement it or use the "unoptimized" property instead.' + "\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader-width");
}
}
for (const [legacyKey, legacyValue] of Object.entries({
layout,
objectFit,
objectPosition,
lazyBoundary,
lazyRoot
})){
if (legacyValue) {
warnOnce('Image with src "' + src + '" has legacy prop "' + legacyKey + '". Did you forget to run the codemod?' + "\nRead more: https://nextjs.org/docs/messages/next-image-upgrade-to-13");
}
}
if (typeof window !== "undefined" && !perfObserver && window.PerformanceObserver) {
perfObserver = new PerformanceObserver((entryList)=>{
for (const entry of entryList.getEntries()){
var _entry_element;
// @ts-ignore - missing "LargestContentfulPaint" class with "element" prop
const imgSrc = (entry == null ? void 0 : (_entry_element = entry.element) == null ? void 0 : _entry_element.src) || "";
const lcpImage = allImgs.get(imgSrc);
if (lcpImage && !lcpImage.priority && lcpImage.placeholder === "empty" && !lcpImage.src.startsWith("data:") && !lcpImage.src.startsWith("blob:")) {
// https://web.dev/lcp/#measure-lcp-in-javascript
warnOnce('Image with src "' + lcpImage.src + '" was detected as the Largest Contentful Paint (LCP). Please add the "priority" property if this image is above the fold.' + "\nRead more: https://nextjs.org/docs/api-reference/next/image#priority");
}
}
});
try {
perfObserver.observe({
type: "largest-contentful-paint",
buffered: true
});
} catch (err) {
// Log error but don't crash the app
console.error(err);
}
}
}
const imgStyle = Object.assign(fill ? {
position: "absolute",
height: "100%",
width: "100%",
left: 0,
top: 0,
right: 0,
bottom: 0,
objectFit,
objectPosition
} : {}, showAltText ? {} : {
color: "transparent"
}, style);
const backgroundImage = !blurComplete && placeholder !== "empty" ? placeholder === "blur" ? 'url("data:image/svg+xml;charset=utf-8,' + getImageBlurSvg({
widthInt,
heightInt,
blurWidth,
blurHeight,
blurDataURL: blurDataURL || "",
objectFit: imgStyle.objectFit
}) + '")' : 'url("' + placeholder + '")' // assume `data:image/`
: null;
let placeholderStyle = backgroundImage ? {
backgroundSize: imgStyle.objectFit || "cover",
backgroundPosition: imgStyle.objectPosition || "50% 50%",
backgroundRepeat: "no-repeat",
backgroundImage
} : {};
if (process.env.NODE_ENV === "development") {
if (placeholderStyle.backgroundImage && placeholder === "blur" && (blurDataURL == null ? void 0 : blurDataURL.startsWith("/"))) {
// During `next dev`, we don't want to generate blur placeholders with webpack
// because it can delay starting the dev server. Instead, `next-image-loader.js`
// will inline a special url to lazily generate the blur placeholder at request time.
placeholderStyle.backgroundImage = 'url("' + blurDataURL + '")';
}
}
const imgAttributes = generateImgAttrs({
config,
src,
unoptimized,
width: widthInt,
quality: qualityInt,
sizes,
loader
});
if (process.env.NODE_ENV !== "production") {
if (typeof window !== "undefined") {
let fullUrl;
try {
fullUrl = new URL(imgAttributes.src);
} catch (e) {
fullUrl = new URL(imgAttributes.src, window.location.href);
}
allImgs.set(fullUrl.href, {
src,
priority,
placeholder
});
}
}
const props = {
...rest,
loading: isLazy ? "lazy" : loading,
fetchPriority,
width: widthInt,
height: heightInt,
decoding: "async",
className,
style: {
...imgStyle,
...placeholderStyle
},
sizes: imgAttributes.sizes,
srcSet: imgAttributes.srcSet,
src: imgAttributes.src
};
const meta = {
unoptimized,
priority,
placeholder,
fill
};
return {
props,
meta
};
}
//# sourceMappingURL=get-img-props.js.map

File diff suppressed because one or more lines are too long

14
node_modules/next/dist/esm/shared/lib/hash.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
// http://www.cse.yorku.ca/~oz/hash.html
export function djb2Hash(str) {
let hash = 5381;
for(let i = 0; i < str.length; i++){
const char = str.charCodeAt(i);
hash = (hash << 5) + hash + char;
}
return Math.abs(hash);
}
export function hexHash(str) {
return djb2Hash(str).toString(36).slice(0, 5);
}
//# sourceMappingURL=hash.js.map

1
node_modules/next/dist/esm/shared/lib/hash.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/hash.ts"],"names":["djb2Hash","str","hash","i","length","char","charCodeAt","Math","abs","hexHash","toString","slice"],"mappings":"AAAA,wCAAwC;AACxC,OAAO,SAASA,SAASC,GAAW;IAClC,IAAIC,OAAO;IACX,IAAK,IAAIC,IAAI,GAAGA,IAAIF,IAAIG,MAAM,EAAED,IAAK;QACnC,MAAME,OAAOJ,IAAIK,UAAU,CAACH;QAC5BD,OAAO,AAACA,CAAAA,QAAQ,CAAA,IAAKA,OAAOG;IAC9B;IACA,OAAOE,KAAKC,GAAG,CAACN;AAClB;AAEA,OAAO,SAASO,QAAQR,GAAW;IACjC,OAAOD,SAASC,KAAKS,QAAQ,CAAC,IAAIC,KAAK,CAAC,GAAG;AAC7C"}

View File

@@ -0,0 +1,7 @@
import React from "react";
export const HeadManagerContext = React.createContext({});
if (process.env.NODE_ENV !== "production") {
HeadManagerContext.displayName = "HeadManagerContext";
}
//# sourceMappingURL=head-manager-context.shared-runtime.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/head-manager-context.shared-runtime.ts"],"names":["React","HeadManagerContext","createContext","process","env","NODE_ENV","displayName"],"mappings":"AAAA,OAAOA,WAAW,QAAO;AAEzB,OAAO,MAAMC,qBAURD,MAAME,aAAa,CAAC,CAAC,GAAE;AAE5B,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzCJ,mBAAmBK,WAAW,GAAG;AACnC"}

157
node_modules/next/dist/esm/shared/lib/head.js generated vendored Normal file
View File

@@ -0,0 +1,157 @@
"use client";
import React, { useContext } from "react";
import Effect from "./side-effect";
import { AmpStateContext } from "./amp-context.shared-runtime";
import { HeadManagerContext } from "./head-manager-context.shared-runtime";
import { isInAmpMode } from "./amp-mode";
import { warnOnce } from "./utils/warn-once";
export function defaultHead(inAmpMode) {
if (inAmpMode === void 0) inAmpMode = false;
const head = [
/*#__PURE__*/ React.createElement("meta", {
charSet: "utf-8"
})
];
if (!inAmpMode) {
head.push(/*#__PURE__*/ React.createElement("meta", {
name: "viewport",
content: "width=device-width"
}));
}
return head;
}
function onlyReactElement(list, child) {
// React children can be "string" or "number" in this case we ignore them for backwards compat
if (typeof child === "string" || typeof child === "number") {
return list;
}
// Adds support for React.Fragment
if (child.type === React.Fragment) {
return list.concat(// @ts-expect-error @types/react does not remove fragments but this could also return ReactPortal[]
React.Children.toArray(child.props.children).reduce(// @ts-expect-error @types/react does not remove fragments but this could also return ReactPortal[]
(fragmentList, fragmentChild)=>{
if (typeof fragmentChild === "string" || typeof fragmentChild === "number") {
return fragmentList;
}
return fragmentList.concat(fragmentChild);
}, []));
}
return list.concat(child);
}
const METATYPES = [
"name",
"httpEquiv",
"charSet",
"itemProp"
];
/*
returns a function for filtering head child elements
which shouldn't be duplicated, like <title/>
Also adds support for deduplicated `key` properties
*/ function unique() {
const keys = new Set();
const tags = new Set();
const metaTypes = new Set();
const metaCategories = {};
return (h)=>{
let isUnique = true;
let hasKey = false;
if (h.key && typeof h.key !== "number" && h.key.indexOf("$") > 0) {
hasKey = true;
const key = h.key.slice(h.key.indexOf("$") + 1);
if (keys.has(key)) {
isUnique = false;
} else {
keys.add(key);
}
}
// eslint-disable-next-line default-case
switch(h.type){
case "title":
case "base":
if (tags.has(h.type)) {
isUnique = false;
} else {
tags.add(h.type);
}
break;
case "meta":
for(let i = 0, len = METATYPES.length; i < len; i++){
const metatype = METATYPES[i];
if (!h.props.hasOwnProperty(metatype)) continue;
if (metatype === "charSet") {
if (metaTypes.has(metatype)) {
isUnique = false;
} else {
metaTypes.add(metatype);
}
} else {
const category = h.props[metatype];
const categories = metaCategories[metatype] || new Set();
if ((metatype !== "name" || !hasKey) && categories.has(category)) {
isUnique = false;
} else {
categories.add(category);
metaCategories[metatype] = categories;
}
}
}
break;
}
return isUnique;
};
}
/**
*
* @param headChildrenElements List of children of <Head>
*/ function reduceComponents(headChildrenElements, props) {
const { inAmpMode } = props;
return headChildrenElements.reduce(onlyReactElement, []).reverse().concat(defaultHead(inAmpMode).reverse()).filter(unique()).reverse().map((c, i)=>{
const key = c.key || i;
if (process.env.NODE_ENV !== "development" && process.env.__NEXT_OPTIMIZE_FONTS && !inAmpMode) {
if (c.type === "link" && c.props["href"] && // TODO(prateekbh@): Replace this with const from `constants` when the tree shaking works.
[
"https://fonts.googleapis.com/css",
"https://use.typekit.net/"
].some((url)=>c.props["href"].startsWith(url))) {
const newProps = {
...c.props || {}
};
newProps["data-href"] = newProps["href"];
newProps["href"] = undefined;
// Add this attribute to make it easy to identify optimized tags
newProps["data-optimized-fonts"] = true;
return /*#__PURE__*/ React.cloneElement(c, newProps);
}
}
if (process.env.NODE_ENV === "development") {
// omit JSON-LD structured data snippets from the warning
if (c.type === "script" && c.props["type"] !== "application/ld+json") {
const srcMessage = c.props["src"] ? '<script> tag with src="' + c.props["src"] + '"' : "inline <script>";
warnOnce("Do not add <script> tags using next/head (see " + srcMessage + "). Use next/script instead. \nSee more info here: https://nextjs.org/docs/messages/no-script-tags-in-head-component");
} else if (c.type === "link" && c.props["rel"] === "stylesheet") {
warnOnce('Do not add stylesheets using next/head (see <link rel="stylesheet"> tag with href="' + c.props["href"] + '"). Use Document instead. \nSee more info here: https://nextjs.org/docs/messages/no-stylesheets-in-head-component');
}
}
return /*#__PURE__*/ React.cloneElement(c, {
key
});
});
}
/**
* This component injects elements to `<head>` of your page.
* To avoid duplicated `tags` in `<head>` you can use the `key` property, which will make sure every tag is only rendered once.
*/ function Head(param) {
let { children } = param;
const ampState = useContext(AmpStateContext);
const headManager = useContext(HeadManagerContext);
return /*#__PURE__*/ React.createElement(Effect, {
reduceComponentsToState: reduceComponents,
headManager: headManager,
inAmpMode: isInAmpMode(ampState)
}, children);
}
export default Head;
//# sourceMappingURL=head.js.map

1
node_modules/next/dist/esm/shared/lib/head.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/head.tsx"],"names":["React","useContext","Effect","AmpStateContext","HeadManagerContext","isInAmpMode","warnOnce","defaultHead","inAmpMode","head","meta","charSet","push","name","content","onlyReactElement","list","child","type","Fragment","concat","Children","toArray","props","children","reduce","fragmentList","fragmentChild","METATYPES","unique","keys","Set","tags","metaTypes","metaCategories","h","isUnique","hasKey","key","indexOf","slice","has","add","i","len","length","metatype","hasOwnProperty","category","categories","reduceComponents","headChildrenElements","reverse","filter","map","c","process","env","NODE_ENV","__NEXT_OPTIMIZE_FONTS","some","url","startsWith","newProps","undefined","cloneElement","srcMessage","Head","ampState","headManager","reduceComponentsToState"],"mappings":"AAAA;AAEA,OAAOA,SAASC,UAAU,QAAQ,QAAO;AACzC,OAAOC,YAAY,gBAAe;AAClC,SAASC,eAAe,QAAQ,+BAA8B;AAC9D,SAASC,kBAAkB,QAAQ,wCAAuC;AAC1E,SAASC,WAAW,QAAQ,aAAY;AACxC,SAASC,QAAQ,QAAQ,oBAAmB;AAM5C,OAAO,SAASC,YAAYC,SAAiB;IAAjBA,IAAAA,sBAAAA,YAAY;IACtC,MAAMC,OAAO;sBAAC,oBAACC;YAAKC,SAAQ;;KAAW;IACvC,IAAI,CAACH,WAAW;QACdC,KAAKG,IAAI,eAAC,oBAACF;YAAKG,MAAK;YAAWC,SAAQ;;IAC1C;IACA,OAAOL;AACT;AAEA,SAASM,iBACPC,IAAoC,EACpCC,KAAuB;IAEvB,8FAA8F;IAC9F,IAAI,OAAOA,UAAU,YAAY,OAAOA,UAAU,UAAU;QAC1D,OAAOD;IACT;IACA,kCAAkC;IAClC,IAAIC,MAAMC,IAAI,KAAKlB,MAAMmB,QAAQ,EAAE;QACjC,OAAOH,KAAKI,MAAM,CAChB,mGAAmG;QACnGpB,MAAMqB,QAAQ,CAACC,OAAO,CAACL,MAAMM,KAAK,CAACC,QAAQ,EAAEC,MAAM,CACjD,mGAAmG;QACnG,CACEC,cACAC;YAEA,IACE,OAAOA,kBAAkB,YACzB,O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K,eAAe;YAC1C,yDAAyD;YACzD,IAAIH,EAAErC,IAAI,KAAK,YAAYqC,EAAEhC,KAAK,CAAC,OAAO,KAAK,uBAAuB;gBACpE,MAAM2C,aAAaX,EAAEhC,KAAK,CAAC,MAAM,GAC7B,AAAC,4BAAyBgC,EAAEhC,KAAK,CAAC,MAAM,GAAC,MACxC;gBACLjB,SACE,AAAC,mDAAgD4D,aAAW;YAEhE,OAAO,IAAIX,EAAErC,IAAI,KAAK,UAAUqC,EAAEhC,KAAK,CAAC,MAAM,KAAK,cAAc;gBAC/DjB,SACE,AAAC,wFAAqFiD,EAAEhC,KAAK,CAAC,OAAO,GAAC;YAE1G;QACF;QACA,qBAAOvB,MAAMiE,YAAY,CAACV,GAAG;YAAEjB;QAAI;IACrC;AACJ;AAEA;;;CAGC,GACD,SAAS6B,KAAK,KAA2C;IAA3C,IAAA,EAAE3C,QAAQ,EAAiC,GAA3C;IACZ,MAAM4C,WAAWnE,WAAWE;IAC5B,MAAMkE,cAAcpE,WAAWG;IAC/B,qBACE,oBAACF;QACCoE,yBAAyBpB;QACzBmB,aAAaA;QACb7D,WAAWH,YAAY+D;OAEtB5C;AAGP;AAEA,eAAe2C,KAAI"}

View File

@@ -0,0 +1,13 @@
"use client";
import { createContext } from "react";
export const SearchParamsContext = createContext(null);
export const PathnameContext = createContext(null);
export const PathParamsContext = createContext(null);
if (process.env.NODE_ENV !== "production") {
SearchParamsContext.displayName = "SearchParamsContext";
PathnameContext.displayName = "PathnameContext";
PathParamsContext.displayName = "PathParamsContext";
}
//# sourceMappingURL=hooks-client-context.shared-runtime.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/hooks-client-context.shared-runtime.ts"],"names":["createContext","SearchParamsContext","PathnameContext","PathParamsContext","process","env","NODE_ENV","displayName"],"mappings":"AAAA;AAEA,SAASA,aAAa,QAAQ,QAAO;AAGrC,OAAO,MAAMC,sBAAsBD,cAAsC,MAAK;AAC9E,OAAO,MAAME,kBAAkBF,cAA6B,MAAK;AACjE,OAAO,MAAMG,oBAAoBH,cAA6B,MAAK;AAEnE,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzCL,oBAAoBM,WAAW,GAAG;IAClCL,gBAAgBK,WAAW,GAAG;IAC9BJ,kBAAkBI,WAAW,GAAG;AAClC"}

View File

@@ -0,0 +1,14 @@
import { createContext, useContext } from "react";
export const HtmlContext = createContext(undefined);
if (process.env.NODE_ENV !== "production") {
HtmlContext.displayName = "HtmlContext";
}
export function useHtmlContext() {
const context = useContext(HtmlContext);
if (!context) {
throw new Error("<Html> should not be imported outside of pages/_document.\n" + "Read more: https://nextjs.org/docs/messages/no-document-import-in-page");
}
return context;
}
//# sourceMappingURL=html-context.shared-runtime.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/html-context.shared-runtime.ts"],"names":["createContext","useContext","HtmlContext","undefined","process","env","NODE_ENV","displayName","useHtmlContext","context","Error"],"mappings":"AAMA,SAASA,aAAa,EAAEC,UAAU,QAAQ,QAAO;AA4CjD,OAAO,MAAMC,cAAcF,cAAqCG,WAAU;AAC1E,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzCJ,YAAYK,WAAW,GAAG;AAC5B;AAEA,OAAO,SAASC;IACd,MAAMC,UAAUR,WAAWC;IAE3B,IAAI,CAACO,SAAS;QACZ,MAAM,IAAIC,MACR,AAAC,gEACC;IAEN;IAEA,OAAOD;AACT"}

View File

@@ -0,0 +1,16 @@
export function detectDomainLocale(domainItems, hostname, detectedLocale) {
if (!domainItems) return;
if (detectedLocale) {
detectedLocale = detectedLocale.toLowerCase();
}
for (const item of domainItems){
var _item_domain, _item_locales;
// remove port if present
const domainHostname = (_item_domain = item.domain) == null ? void 0 : _item_domain.split(":")[0].toLowerCase();
if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || ((_item_locales = item.locales) == null ? void 0 : _item_locales.some((locale)=>locale.toLowerCase() === detectedLocale))) {
return item;
}
}
}
//# sourceMappingURL=detect-domain-locale.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/i18n/detect-domain-locale.ts"],"names":["detectDomainLocale","domainItems","hostname","detectedLocale","toLowerCase","item","domainHostname","domain","split","defaultLocale","locales","some","locale"],"mappings":"AAEA,OAAO,SAASA,mBACdC,WAA4B,EAC5BC,QAAiB,EACjBC,cAAuB;IAEvB,IAAI,CAACF,aAAa;IAElB,IAAIE,gBAAgB;QAClBA,iBAAiBA,eAAeC,WAAW;IAC7C;IAEA,KAAK,MAAMC,QAAQJ,YAAa;YAEPI,cAIrBA;QALF,yBAAyB;QACzB,MAAMC,kBAAiBD,eAAAA,KAAKE,MAAM,qBAAXF,aAAaG,KAAK,CAAC,IAAI,CAAC,EAAE,CAACJ,WAAW;QAC7D,IACEF,aAAaI,kBACbH,mBAAmBE,KAAKI,aAAa,CAACL,WAAW,QACjDC,gBAAAA,KAAKK,OAAO,qBAAZL,cAAcM,IAAI,CAAC,CAACC,SAAWA,OAAOR,WAAW,OAAOD,kBACxD;YACA,OAAOE;QACT;IACF;AACF"}

View File

@@ -0,0 +1,53 @@
import { acceptLanguage } from "../../../server/accept-header";
import { denormalizePagePath } from "../page-path/denormalize-page-path";
import { detectDomainLocale } from "./detect-domain-locale";
import { formatUrl } from "../router/utils/format-url";
import { getCookieParser } from "../../../server/api-utils/get-cookie-parser";
function getLocaleFromCookie(i18n, headers) {
if (headers === void 0) headers = {};
var _getCookieParser_NEXT_LOCALE, _getCookieParser;
const nextLocale = (_getCookieParser = getCookieParser(headers || {})()) == null ? void 0 : (_getCookieParser_NEXT_LOCALE = _getCookieParser.NEXT_LOCALE) == null ? void 0 : _getCookieParser_NEXT_LOCALE.toLowerCase();
return nextLocale ? i18n.locales.find((locale)=>nextLocale === locale.toLowerCase()) : undefined;
}
function detectLocale(param) {
let { i18n, headers, domainLocale, preferredLocale, pathLocale } = param;
return pathLocale || (domainLocale == null ? void 0 : domainLocale.defaultLocale) || getLocaleFromCookie(i18n, headers) || preferredLocale || i18n.defaultLocale;
}
function getAcceptPreferredLocale(i18n, headers) {
if ((headers == null ? void 0 : headers["accept-language"]) && !Array.isArray(headers["accept-language"])) {
try {
return acceptLanguage(headers["accept-language"], i18n.locales);
} catch (err) {}
}
}
export function getLocaleRedirect(param) {
let { defaultLocale, domainLocale, pathLocale, headers, nextConfig, urlParsed } = param;
if (nextConfig.i18n && nextConfig.i18n.localeDetection !== false && denormalizePagePath(urlParsed.pathname) === "/") {
const preferredLocale = getAcceptPreferredLocale(nextConfig.i18n, headers);
const detectedLocale = detectLocale({
i18n: nextConfig.i18n,
preferredLocale,
headers,
pathLocale,
domainLocale
});
const preferredDomain = detectDomainLocale(nextConfig.i18n.domains, undefined, preferredLocale);
if (domainLocale && preferredDomain) {
const isPDomain = preferredDomain.domain === domainLocale.domain;
const isPLocale = preferredDomain.defaultLocale === preferredLocale;
if (!isPDomain || !isPLocale) {
const scheme = "http" + (preferredDomain.http ? "" : "s");
const rlocale = isPLocale ? "" : preferredLocale;
return scheme + "://" + preferredDomain.domain + "/" + rlocale;
}
}
if (detectedLocale.toLowerCase() !== defaultLocale.toLowerCase()) {
return formatUrl({
...urlParsed,
pathname: (nextConfig.basePath || "") + "/" + detectedLocale + (nextConfig.trailingSlash ? "/" : "")
});
}
}
}
//# sourceMappingURL=get-locale-redirect.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/i18n/get-locale-redirect.ts"],"names":["acceptLanguage","denormalizePagePath","detectDomainLocale","formatUrl","getCookieParser","getLocaleFromCookie","i18n","headers","nextLocale","NEXT_LOCALE","toLowerCase","locales","find","locale","undefined","detectLocale","domainLocale","preferredLocale","pathLocale","defaultLocale","getAcceptPreferredLocale","Array","isArray","err","getLocaleRedirect","nextConfig","urlParsed","localeDetection","pathname","detectedLocale","preferredDomain","domains","isPDomain","domain","isPLocale","scheme","http","rlocale","basePath","trailingSlash"],"mappings":"AAEA,S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AAI,EAAEC;QAClE,MAAMsB,iBAAiBd,aAAa;YAClCT,MAAMmB,WAAWnB,IAAI;YACrBW;YACAV;YACAW;YACAF;QACF;QAEA,MAAMc,kBAAkB5B,mBACtBuB,WAAWnB,IAAI,CAACyB,OAAO,EACvBjB,WACAG;QAGF,IAAID,gBAAgBc,iBAAiB;YACnC,MAAME,YAAYF,gBAAgBG,MAAM,KAAKjB,aAAaiB,MAAM;YAChE,MAAMC,YAAYJ,gBAAgBX,aAAa,KAAKF;YACpD,IAAI,CAACe,aAAa,CAACE,WAAW;gBAC5B,MAAMC,SAAS,AAAC,SAAML,CAAAA,gBAAgBM,IAAI,GAAG,KAAK,GAAE;gBACpD,MAAMC,UAAUH,YAAY,KAAKjB;gBACjC,OAAO,AAAGkB,SAAO,QAAKL,gBAAgBG,MAAM,GAAC,MAAGI;YAClD;QACF;QAEA,IAAIR,eAAenB,WAAW,OAAOS,cAAcT,WAAW,IAAI;YAChE,OAAOP,UAAU;gBACf,GAAGuB,SAAS;gBACZE,UAAU,AAAGH,CAAAA,WAAWa,QAAQ,IAAI,EAAC,IAAE,MAAGT,iBACxCJ,CAAAA,WAAWc,aAAa,GAAG,MAAM,EAAC;YAEtC;QACF;IACF;AACF"}

View File

@@ -0,0 +1,28 @@
/**
* For a pathname that may include a locale from a list of locales, it
* removes the locale from the pathname returning it alongside with the
* detected locale.
*
* @param pathname A pathname that may include a locale.
* @param locales A list of locales.
* @returns The detected locale and pathname without locale
*/ export function normalizeLocalePath(pathname, locales) {
let detectedLocale;
// first item will be empty string from splitting at first char
const pathnameParts = pathname.split("/");
(locales || []).some((locale)=>{
if (pathnameParts[1] && pathnameParts[1].toLowerCase() === locale.toLowerCase()) {
detectedLocale = locale;
pathnameParts.splice(1, 1);
pathname = pathnameParts.join("/") || "/";
return true;
}
return false;
});
return {
pathname,
detectedLocale
};
}
//# sourceMappingURL=normalize-locale-path.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/i18n/normalize-locale-path.ts"],"names":["normalizeLocalePath","pathname","locales","detectedLocale","pathnameParts","split","some","locale","toLowerCase","splice","join"],"mappings":"AAKA;;;;;;;;CAQC,GACD,OAAO,SAASA,oBACdC,QAAgB,EAChBC,OAAkB;IAElB,IAAIC;IACJ,+DAA+D;IAC/D,MAAMC,gBAAgBH,SAASI,KAAK,CAAC;IAEnCH,CAAAA,WAAW,EAAE,AAAD,EAAGI,IAAI,CAAC,CAACC;QACrB,IACEH,aAAa,CAAC,EAAE,IAChBA,aAAa,CAAC,EAAE,CAACI,WAAW,OAAOD,OAAOC,WAAW,IACrD;YACAL,iBAAiBI;YACjBH,cAAcK,MAAM,CAAC,GAAG;YACxBR,WAAWG,cAAcM,IAAI,CAAC,QAAQ;YACtC,OAAO;QACT;QACA,OAAO;IACT;IAEA,OAAO;QACLT;QACAE;IACF;AACF"}

View File

@@ -0,0 +1,13 @@
/**
* A shared function, used on both client and server, to generate a SVG blur placeholder.
*/ export function getImageBlurSvg(param) {
let { widthInt, heightInt, blurWidth, blurHeight, blurDataURL, objectFit } = param;
const std = 20;
const svgWidth = blurWidth ? blurWidth * 40 : widthInt;
const svgHeight = blurHeight ? blurHeight * 40 : heightInt;
const viewBox = svgWidth && svgHeight ? "viewBox='0 0 " + svgWidth + " " + svgHeight + "'" : "";
const preserveAspectRatio = viewBox ? "none" : objectFit === "contain" ? "xMidYMid" : objectFit === "cover" ? "xMidYMid slice" : "none";
return "%3Csvg xmlns='http://www.w3.org/2000/svg' " + viewBox + "%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='" + std + "'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='" + std + "'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='" + preserveAspectRatio + "' style='filter: url(%23b);' href='" + blurDataURL + "'/%3E%3C/svg%3E";
}
//# sourceMappingURL=image-blur-svg.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/image-blur-svg.ts"],"names":["getImageBlurSvg","widthInt","heightInt","blurWidth","blurHeight","blurDataURL","objectFit","std","svgWidth","svgHeight","viewBox","preserveAspectRatio"],"mappings":"AAAA;;CAEC,GACD,OAAO,SAASA,gBAAgB,KAc/B;IAd+B,IAAA,EAC9BC,QAAQ,EACRC,SAAS,EACTC,SAAS,EACTC,UAAU,EACVC,WAAW,EACXC,SAAS,EAQV,GAd+B;IAe9B,MAAMC,MAAM;IACZ,MAAMC,WAAWL,YAAYA,YAAY,KAAKF;IAC9C,MAAMQ,YAAYL,aAAaA,aAAa,KAAKF;IAEjD,MAAMQ,UACJF,YAAYC,YAAY,AAAC,kBAAeD,WAAS,MAAGC,YAAU,MAAK;IACrE,MAAME,sBAAsBD,UACxB,SACAJ,cAAc,YACd,aACAA,cAAc,UACd,mBACA;IAEJ,OAAO,AAAC,+CAA4CI,UAAQ,8FAA2FH,MAAI,oQAAiQA,MAAI,gGAA6FI,sBAAoB,wCAAqCN,cAAY;AACpkB"}

View File

@@ -0,0 +1,8 @@
import React from "react";
import { imageConfigDefault } from "./image-config";
export const ImageConfigContext = React.createContext(imageConfigDefault);
if (process.env.NODE_ENV !== "production") {
ImageConfigContext.displayName = "ImageConfigContext";
}
//# sourceMappingURL=image-config-context.shared-runtime.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/image-config-context.shared-runtime.ts"],"names":["React","imageConfigDefault","ImageConfigContext","createContext","process","env","NODE_ENV","displayName"],"mappings":"AAAA,OAAOA,WAAW,QAAO;AACzB,SAA8BC,kBAAkB,QAAQ,iBAAgB;AAExE,OAAO,MAAMC,qBACXF,MAAMG,aAAa,CAAsBF,oBAAmB;AAE9D,IAAIG,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzCJ,mBAAmBK,WAAW,GAAG;AACnC"}

45
node_modules/next/dist/esm/shared/lib/image-config.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
export const VALID_LOADERS = [
"default",
"imgix",
"cloudinary",
"akamai",
"custom"
];
export const imageConfigDefault = {
deviceSizes: [
640,
750,
828,
1080,
1200,
1920,
2048,
3840
],
imageSizes: [
16,
32,
48,
64,
96,
128,
256,
384
],
path: "/_next/image",
loader: "default",
loaderFile: "",
domains: [],
disableStaticImages: false,
minimumCacheTTL: 60,
formats: [
"image/webp"
],
dangerouslyAllowSVG: false,
contentSecurityPolicy: "script-src 'none'; frame-src 'none'; sandbox;",
contentDispositionType: "inline",
remotePatterns: [],
unoptimized: false
};
//# sourceMappingURL=image-config.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/image-config.ts"],"names":["VALID_LOADERS","imageConfigDefault","deviceSizes","imageSizes","path","loader","loaderFile","domains","disableStaticImages","minimumCacheTTL","formats","dangerouslyAllowSVG","contentSecurityPolicy","contentDispositionType","remotePatterns","unoptimized"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB;IAC3B;IACA;IACA;IACA;IACA;CACD,CAAS;AAgGV,OAAO,MAAMC,qBAA0C;IACrDC,aAAa;QAAC;QAAK;QAAK;QAAK;QAAM;QAAM;QAAM;QAAM;KAAK;IAC1DC,YAAY;QAAC;QAAI;QAAI;QAAI;QAAI;QAAI;QAAK;QAAK;KAAI;IAC/CC,MAAM;IACNC,QAAQ;IACRC,YAAY;IACZC,SAAS,EAAE;IACXC,qBAAqB;IACrBC,iBAAiB;IACjBC,SAAS;QAAC;KAAa;IACvBC,qBAAqB;IACrBC,uBAAwB;IACxBC,wBAAwB;IACxBC,gBAAgB,EAAE;IAClBC,aAAa;AACf,EAAC"}

View File

@@ -0,0 +1,25 @@
import { getImgProps } from "./get-img-props";
import { warnOnce } from "./utils/warn-once";
import { Image } from "../../client/image-component";
// @ts-ignore - This is replaced by webpack alias
import defaultLoader from "next/dist/shared/lib/image-loader";
const unstable_getImgProps = (imgProps)=>{
warnOnce("Warning: unstable_getImgProps() is experimental and may change or be removed at any time. Use at your own risk.");
const { props } = getImgProps(imgProps, {
defaultLoader,
// This is replaced by webpack define plugin
imgConf: process.env.__NEXT_IMAGE_OPTS
});
for (const [key, value] of Object.entries(props)){
if (value === undefined) {
delete props[key];
}
}
return {
props
};
};
export default Image;
export { unstable_getImgProps, };
//# sourceMappingURL=image-external.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/image-external.tsx"],"names":["getImgProps","warnOnce","Image","defaultLoader","unstable_getImgProps","imgProps","props","imgConf","process","env","__NEXT_IMAGE_OPTS","key","value","Object","entries","undefined"],"mappings":"AAGA,SAASA,WAAW,QAAQ,kBAAiB;AAC7C,SAASC,QAAQ,QAAQ,oBAAmB;AAC5C,SAASC,KAAK,QAAQ,+BAA8B;AAEpD,iDAAiD;AACjD,OAAOC,mBAAmB,oCAAmC;AAE7D,MAAMC,uBAAuB,CAACC;IAC5BJ,SACE;IAEF,MAAM,EAAEK,KAAK,EAAE,GAAGN,YAAYK,UAAU;QACtCF;QACA,4CAA4C;QAC5CI,SAASC,QAAQC,GAAG,CAACC,iBAAiB;IACxC;IACA,KAAK,MAAM,CAACC,KAAKC,MAAM,IAAIC,OAAOC,OAAO,CAACR,OAAQ;QAChD,IAAIM,UAAUG,WAAW;YACvB,OAAOT,KAAK,CAACK,IAA0B;QACzC;IACF;IACA,OAAO;QAAEL;IAAM;AACjB;AAEA,eAAeJ,MAAK;AAEpB,SAKEE,oBAAoB,KACrB"}

43
node_modules/next/dist/esm/shared/lib/image-loader.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
function defaultLoader(param) {
let { config, src, width, quality } = param;
if (process.env.NODE_ENV !== "production") {
const missingValues = [];
// these should always be provided but make sure they are
if (!src) missingValues.push("src");
if (!width) missingValues.push("width");
if (missingValues.length > 0) {
throw new Error("Next Image Optimization requires " + missingValues.join(", ") + " to be provided. Make sure you pass them as props to the `next/image` component. Received: " + JSON.stringify({
src,
width,
quality
}));
}
if (src.startsWith("//")) {
throw new Error('Failed to parse src "' + src + '" on `next/image`, protocol-relative URL (//) must be changed to an absolute URL (http:// or https://)');
}
if (!src.startsWith("/") && (config.domains || config.remotePatterns)) {
let parsedSrc;
try {
parsedSrc = new URL(src);
} catch (err) {
console.error(err);
throw new Error('Failed to parse src "' + src + '" on `next/image`, if using relative image it must start with a leading slash "/" or be an absolute URL (http:// or https://)');
}
if (process.env.NODE_ENV !== "test" && // micromatch isn't compatible with edge runtime
process.env.NEXT_RUNTIME !== "edge") {
// We use dynamic require because this should only error in development
const { hasMatch } = require("./match-remote-pattern");
if (!hasMatch(config.domains, config.remotePatterns, parsedSrc)) {
throw new Error("Invalid src prop (" + src + ') on `next/image`, hostname "' + parsedSrc.hostname + '" is not configured under images in your `next.config.js`\n' + "See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host");
}
}
}
}
return config.path + "?url=" + encodeURIComponent(src) + "&w=" + width + "&q=" + (quality || 75) + (process.env.NEXT_DEPLOYMENT_ID ? "&dpl=" + process.env.NEXT_DEPLOYMENT_ID : "");
}
// We use this to determine if the import is the default loader
// or a custom loader defined by the user in next.config.js
defaultLoader.__next_img_default = true;
export default defaultLoader;
//# sourceMappingURL=image-loader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/image-loader.ts"],"names":["defaultLoader","config","src","width","quality","process","env","NODE_ENV","missingValues","push","length","Error","join","JSON","stringify","startsWith","domains","remotePatterns","parsedSrc","URL","err","console","error","NEXT_RUNTIME","hasMatch","require","hostname","path","encodeURIComponent","NEXT_DEPLOYMENT_ID","__next_img_default"],"mappings":"AAEA,SAASA,cAAc,KAKM;IALN,IAAA,EACrBC,MAAM,EACNC,GAAG,EACHC,KAAK,EACLC,OAAO,EACoB,GALN;IAMrB,IAAIC,QAAQC,GAAG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AAkB,GACtC,EAAC;AAET;AAEA,+DAA+D;AAC/D,2DAA2D;AAC3D7B,cAAc8B,kBAAkB,GAAG;AAEnC,eAAe9B,cAAa"}

View File

@@ -0,0 +1,20 @@
export function getObjectClassLabel(value) {
return Object.prototype.toString.call(value);
}
export function isPlainObject(value) {
if (getObjectClassLabel(value) !== "[object Object]") {
return false;
}
const prototype = Object.getPrototypeOf(value);
/**
* this used to be previously:
*
* `return prototype === null || prototype === Object.prototype`
*
* but Edge Runtime expose Object from vm, being that kind of type-checking wrongly fail.
*
* It was changed to the current implementation since it's resilient to serialization.
*/ return prototype === null || prototype.hasOwnProperty("isPrototypeOf");
}
//# sourceMappingURL=is-plain-object.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/is-plain-object.ts"],"names":["getObjectClassLabel","value","Object","prototype","toString","call","isPlainObject","getPrototypeOf","hasOwnProperty"],"mappings":"AAAA,OAAO,SAASA,oBAAoBC,KAAU;IAC5C,OAAOC,OAAOC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACJ;AACxC;AAEA,OAAO,SAASK,cAAcL,KAAU;IACtC,IAAID,oBAAoBC,WAAW,mBAAmB;QACpD,OAAO;IACT;IAEA,MAAME,YAAYD,OAAOK,cAAc,CAACN;IAExC;;;;;;;;GAQC,GACD,OAAOE,cAAc,QAAQA,UAAUK,cAAc,CAAC;AACxD"}

View File

@@ -0,0 +1 @@
export { default } from 'path'

View File

@@ -0,0 +1,13 @@
/**
* This module is for next.js server internal usage of path module.
* It will use native path module for nodejs runtime.
* It will use path-browserify polyfill for edge runtime.
*/ let path;
if (process.env.NEXT_RUNTIME === "edge") {
path = require("next/dist/compiled/path-browserify");
} else {
path = require("path");
}
module.exports = path;
//# sourceMappingURL=path.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/isomorphic/path.js"],"names":["path","process","env","NEXT_RUNTIME","require","module","exports"],"mappings":"AAAA;;;;CAIC,GACD,IAAIA;AAEJ,IAAIC,QAAQC,GAAG,CAACC,YAAY,KAAK,QAAQ;IACvCH,OAAOI,QAAQ;AACjB,OAAO;IACLJ,OAAOI,QAAQ;AACjB;AAEAC,OAAOC,OAAO,GAAGN"}

View File

@@ -0,0 +1,18 @@
"use client";
import React from "react";
import { NEXT_DYNAMIC_NO_SSR_CODE } from "./no-ssr-error";
export function suspense() {
const error = new Error(NEXT_DYNAMIC_NO_SSR_CODE);
error.digest = NEXT_DYNAMIC_NO_SSR_CODE;
throw error;
}
export function NoSSR(param) {
let { children } = param;
if (typeof window === "undefined") {
suspense();
}
return children;
}
//# sourceMappingURL=dynamic-no-ssr.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/lazy-dynamic/dynamic-no-ssr.tsx"],"names":["React","NEXT_DYNAMIC_NO_SSR_CODE","suspense","error","Error","digest","NoSSR","children","window"],"mappings":"AAAA;AAEA,OAAOA,WAAW,QAAO;AACzB,SAASC,wBAAwB,QAAQ,iBAAgB;AAEzD,OAAO,SAASC;IACd,MAAMC,QAAQ,IAAIC,MAAMH;IACtBE,MAAcE,MAAM,GAAGJ;IACzB,MAAME;AACR;AAIA,OAAO,SAASG,MAAM,KAAiC;IAAjC,IAAA,EAAEC,QAAQ,EAAuB,GAAjC;IACpB,IAAI,OAAOC,WAAW,aAAa;QACjCN;IACF;IAEA,OAAOK;AACT"}

View File

@@ -0,0 +1,28 @@
import React from "react";
import { NoSSR } from "./dynamic-no-ssr";
function Loadable(options) {
const opts = Object.assign({
loader: null,
loading: null,
ssr: true
}, options);
opts.lazy = /*#__PURE__*/ React.lazy(opts.loader);
function LoadableComponent(props) {
const Loading = opts.loading;
const fallbackElement = /*#__PURE__*/ React.createElement(Loading, {
isLoading: true,
pastDelay: true,
error: null
});
const Wrap = opts.ssr ? React.Fragment : NoSSR;
const Lazy = opts.lazy;
return /*#__PURE__*/ React.createElement(React.Suspense, {
fallback: fallbackElement
}, /*#__PURE__*/ React.createElement(Wrap, null, /*#__PURE__*/ React.createElement(Lazy, props)));
}
LoadableComponent.displayName = "LoadableComponent";
return LoadableComponent;
}
export default Loadable;
//# sourceMappingURL=loadable.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/lazy-dynamic/loadable.tsx"],"names":["React","NoSSR","Loadable","options","opts","Object","assign","loader","loading","ssr","lazy","LoadableComponent","props","Loading","fallbackElement","isLoading","pastDelay","error","Wrap","Fragment","Lazy","Suspense","fallback","displayName"],"mappings":"AAAA,OAAOA,WAAW,QAAO;AACzB,SAASC,KAAK,QAAQ,mBAAkB;AAExC,SAASC,SAASC,OAAY;IAC5B,MAAMC,OAAOC,OAAOC,MAAM,CACxB;QACEC,QAAQ;QACRC,SAAS;QACTC,KAAK;IACP,GACAN;IAGFC,KAAKM,IAAI,iBAAGV,MAAMU,IAAI,CAACN,KAAKG,MAAM;IAElC,SAASI,kBAAkBC,KAAU;QACnC,MAAMC,UAAUT,KAAKI,OAAO;QAC5B,MAAMM,gCACJ,oBAACD;YAAQE,WAAW;YAAMC,WAAW;YAAMC,OAAO;;QAGpD,MAAMC,OAAOd,KAAKK,GAAG,GAAGT,MAAMmB,QAAQ,GAAGlB;QACzC,MAAMmB,OAAOhB,KAAKM,IAAI;QAEtB,qBACE,oBAACV,MAAMqB,QAAQ;YAACC,UAAUR;yBACxB,oBAACI,0BACC,oBAACE,MAASR;IAIlB;IAEAD,kBAAkBY,WAAW,GAAG;IAEhC,OAAOZ;AACT;AAEA,eAAeT,SAAQ"}

View File

@@ -0,0 +1,4 @@
// This has to be a shared module which is shared between client component error boundary and dynamic component
export const NEXT_DYNAMIC_NO_SSR_CODE = "NEXT_DYNAMIC_NO_SSR_CODE";
//# sourceMappingURL=no-ssr-error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/lazy-dynamic/no-ssr-error.ts"],"names":["NEXT_DYNAMIC_NO_SSR_CODE"],"mappings":"AAAA,+GAA+G;AAE/G,OAAO,MAAMA,2BAA2B,2BAA0B"}

View File

@@ -0,0 +1,9 @@
"use client";
import React from "react";
export const LoadableContext = React.createContext(null);
if (process.env.NODE_ENV !== "production") {
LoadableContext.displayName = "LoadableContext";
}
//# sourceMappingURL=loadable-context.shared-runtime.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/loadable-context.shared-runtime.ts"],"names":["React","LoadableContext","createContext","process","env","NODE_ENV","displayName"],"mappings":"AAAA;AAEA,OAAOA,WAAW,QAAO;AAIzB,OAAO,MAAMC,kBAAkBD,MAAME,aAAa,CAAmB,MAAK;AAE1E,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzCJ,gBAAgBK,WAAW,GAAG;AAChC"}

View File

@@ -0,0 +1,237 @@
// TODO: Remove use of `any` type.
/**
@copyright (c) 2017-present James Kyle <me@thejameskyle.com>
MIT License
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
*/ // https://github.com/jamiebuilds/react-loadable/blob/v5.5.0/src/index.js
// Modified to be compatible with webpack 4 / Next.js
import React from "react";
import { LoadableContext } from "./loadable-context.shared-runtime";
function resolve(obj) {
return obj && obj.default ? obj.default : obj;
}
const ALL_INITIALIZERS = [];
const READY_INITIALIZERS = [];
let initialized = false;
function load(loader) {
let promise = loader();
let state = {
loading: true,
loaded: null,
error: null
};
state.promise = promise.then((loaded)=>{
state.loading = false;
state.loaded = loaded;
return loaded;
}).catch((err)=>{
state.loading = false;
state.error = err;
throw err;
});
return state;
}
function createLoadableComponent(loadFn, options) {
let opts = Object.assign({
loader: null,
loading: null,
delay: 200,
timeout: null,
webpack: null,
modules: null
}, options);
/** @type LoadableSubscription */ let subscription = null;
function init() {
if (!subscription) {
// eslint-disable-next-line @typescript-eslint/no-use-before-define
const sub = new LoadableSubscription(loadFn, opts);
subscription = {
getCurrentValue: sub.getCurrentValue.bind(sub),
subscribe: sub.subscribe.bind(sub),
retry: sub.retry.bind(sub),
promise: sub.promise.bind(sub)
};
}
return subscription.promise();
}
// Server only
if (typeof window === "undefined") {
ALL_INITIALIZERS.push(init);
}
// Client only
if (!initialized && typeof window !== "undefined") {
// require.resolveWeak check is needed for environments that don't have it available like Jest
const moduleIds = opts.webpack && typeof require.resolveWeak === "function" ? opts.webpack() : opts.modules;
if (moduleIds) {
READY_INITIALIZERS.push((ids)=>{
for (const moduleId of moduleIds){
if (ids.includes(moduleId)) {
return init();
}
}
});
}
}
function useLoadableModule() {
init();
const context = React.useContext(LoadableContext);
if (context && Array.isArray(opts.modules)) {
opts.modules.forEach((moduleName)=>{
context(moduleName);
});
}
}
function LoadableComponent(props, ref) {
useLoadableModule();
const state = React.useSyncExternalStore(subscription.subscribe, subscription.getCurrentValue, subscription.getCurrentValue);
React.useImperativeHandle(ref, ()=>({
retry: subscription.retry
}), []);
return React.useMemo(()=>{
if (state.loading || state.error) {
return /*#__PURE__*/ React.createElement(opts.loading, {
isLoading: state.loading,
pastDelay: state.pastDelay,
timedOut: state.timedOut,
error: state.error,
retry: subscription.retry
});
} else if (state.loaded) {
return /*#__PURE__*/ React.createElement(resolve(state.loaded), props);
} else {
return null;
}
}, [
props,
state
]);
}
LoadableComponent.preload = ()=>init();
LoadableComponent.displayName = "LoadableComponent";
return /*#__PURE__*/ React.forwardRef(LoadableComponent);
}
class LoadableSubscription {
promise() {
return this._res.promise;
}
retry() {
this._clearTimeouts();
this._res = this._loadFn(this._opts.loader);
this._state = {
pastDelay: false,
timedOut: false
};
const { _res: res, _opts: opts } = this;
if (res.loading) {
if (typeof opts.delay === "number") {
if (opts.delay === 0) {
this._state.pastDelay = true;
} else {
this._delay = setTimeout(()=>{
this._update({
pastDelay: true
});
}, opts.delay);
}
}
if (typeof opts.timeout === "number") {
this._timeout = setTimeout(()=>{
this._update({
timedOut: true
});
}, opts.timeout);
}
}
this._res.promise.then(()=>{
this._update({});
this._clearTimeouts();
}).catch((_err)=>{
this._update({});
this._clearTimeouts();
});
this._update({});
}
_update(partial) {
this._state = {
...this._state,
error: this._res.error,
loaded: this._res.loaded,
loading: this._res.loading,
...partial
};
this._callbacks.forEach((callback)=>callback());
}
_clearTimeouts() {
clearTimeout(this._delay);
clearTimeout(this._timeout);
}
getCurrentValue() {
return this._state;
}
subscribe(callback) {
this._callbacks.add(callback);
return ()=>{
this._callbacks.delete(callback);
};
}
constructor(loadFn, opts){
this._loadFn = loadFn;
this._opts = opts;
this._callbacks = new Set();
this._delay = null;
this._timeout = null;
this.retry();
}
}
function Loadable(opts) {
return createLoadableComponent(load, opts);
}
function flushInitializers(initializers, ids) {
let promises = [];
while(initializers.length){
let init = initializers.pop();
promises.push(init(ids));
}
return Promise.all(promises).then(()=>{
if (initializers.length) {
return flushInitializers(initializers, ids);
}
});
}
Loadable.preloadAll = ()=>{
return new Promise((resolveInitializers, reject)=>{
flushInitializers(ALL_INITIALIZERS).then(resolveInitializers, reject);
});
};
Loadable.preloadReady = (ids)=>{
if (ids === void 0) ids = [];
return new Promise((resolvePreload)=>{
const res = ()=>{
initialized = true;
return resolvePreload();
};
// We always will resolve, errors should be handled within loading UIs.
flushInitializers(READY_INITIALIZERS, ids).then(res, res);
});
};
if (typeof window !== "undefined") {
window.__NEXT_PRELOADREADY = Loadable.preloadReady;
}
export default Loadable;
//# sourceMappingURL=loadable.shared-runtime.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,31 @@
import { makeRe } from "next/dist/compiled/micromatch";
export function matchRemotePattern(pattern, url) {
if (pattern.protocol !== undefined) {
const actualProto = url.protocol.slice(0, -1);
if (pattern.protocol !== actualProto) {
return false;
}
}
if (pattern.port !== undefined) {
if (pattern.port !== url.port) {
return false;
}
}
if (pattern.hostname === undefined) {
throw new Error("Pattern should define hostname but found\n" + JSON.stringify(pattern));
} else {
if (!makeRe(pattern.hostname).test(url.hostname)) {
return false;
}
}
var _pattern_pathname;
if (!makeRe((_pattern_pathname = pattern.pathname) != null ? _pattern_pathname : "**").test(url.pathname)) {
return false;
}
return true;
}
export function hasMatch(domains, remotePatterns, url) {
return domains.some((domain)=>url.hostname === domain) || remotePatterns.some((p)=>matchRemotePattern(p, url));
}
//# sourceMappingURL=match-remote-pattern.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/match-remote-pattern.ts"],"names":["makeRe","matchRemotePattern","pattern","url","protocol","undefined","actualProto","slice","port","hostname","Error","JSON","stringify","test","pathname","hasMatch","domains","remotePatterns","some","domain","p"],"mappings":"AACA,SAASA,MAAM,QAAQ,gCAA+B;AAEtD,OAAO,SAASC,mBAAmBC,OAAsB,EAAEC,GAAQ;IACjE,IAAID,QAAQE,QAAQ,KAAKC,WAAW;QAClC,MAAMC,cAAcH,IAAIC,QAAQ,CAACG,KAAK,CAAC,GAAG,CAAC;QAC3C,IAAIL,QAAQE,QAAQ,KAAKE,aAAa;YACpC,OAAO;QACT;IACF;IACA,IAAIJ,QAAQM,IAAI,KAAKH,WAAW;QAC9B,IAAIH,QAAQM,IAAI,KAAKL,IAAIK,IAAI,EAAE;YAC7B,OAAO;QACT;IACF;IAEA,IAAIN,QAAQO,QAAQ,KAAKJ,WAAW;QAClC,MAAM,IAAIK,MACR,AAAC,+CAA4CC,KAAKC,SAAS,CAACV;IAEhE,OAAO;QACL,IAAI,CAACF,OAAOE,QAAQO,QAAQ,EAAEI,IAAI,CAACV,IAAIM,QAAQ,GAAG;YAChD,OAAO;QACT;IACF;QAEYP;IAAZ,IAAI,CAACF,OAAOE,CAAAA,oBAAAA,QAAQY,QAAQ,YAAhBZ,oBAAoB,MAAMW,IAAI,CAACV,IAAIW,QAAQ,GAAG;QACxD,OAAO;IACT;IAEA,OAAO;AACT;AAEA,OAAO,SAASC,SACdC,OAAiB,EACjBC,cAA+B,EAC/Bd,GAAQ;IAER,OACEa,QAAQE,IAAI,CAAC,CAACC,SAAWhB,IAAIM,QAAQ,KAAKU,WAC1CF,eAAeC,IAAI,CAAC,CAACE,IAAMnB,mBAAmBmB,GAAGjB;AAErD"}

36
node_modules/next/dist/esm/shared/lib/mitt.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
/*
MIT License
Copyright (c) Jason Miller (https://jasonformat.com/)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ // This file is based on https://github.com/developit/mitt/blob/v1.1.3/src/index.js
// It's been edited for the needs of this script
// See the LICENSE at the top of the file
export default function mitt() {
const all = Object.create(null);
return {
on (type, handler) {
(all[type] || (all[type] = [])).push(handler);
},
off (type, handler) {
if (all[type]) {
all[type].splice(all[type].indexOf(handler) >>> 0, 1);
}
},
emit (type) {
for(var _len = arguments.length, evts = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
evts[_key - 1] = arguments[_key];
}
(all[type] || []).slice().map((handler)=>{
handler(...evts);
});
}
};
}
//# sourceMappingURL=mitt.js.map

1
node_modules/next/dist/esm/shared/lib/mitt.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/mitt.ts"],"names":["mitt","all","Object","create","on","type","handler","push","off","splice","indexOf","emit","evts","slice","map"],"mappings":"AAAA;;;;;;;;;;AAUA,GAEA,mFAAmF;AACnF,gDAAgD;AAChD,yCAAyC;AAUzC,eAAe,SAASA;IACtB,MAAMC,MAAkCC,OAAOC,MAAM,CAAC;IAEtD,OAAO;QACLC,IAAGC,IAAY,EAAEC,OAAgB;YAC7BL,CAAAA,GAAG,CAACI,KAAK,IAAKJ,CAAAA,GAAG,CAACI,KAAK,GAAG,EAAE,AAAD,CAAC,EAAGE,IAAI,CAACD;QACxC;QAEAE,KAAIH,IAAY,EAAEC,OAAgB;YAChC,IAAIL,GAAG,CAACI,KAAK,EAAE;gBACbJ,GAAG,CAACI,KAAK,CAACI,MAAM,CAACR,GAAG,CAACI,KAAK,CAACK,OAAO,CAACJ,aAAa,GAAG;YACrD;QACF;QAEAK,MAAKN,IAAY;YAAE,IAAA,IAAA,OAAA,UAAA,QAAA,AAAGO,OAAH,UAAA,OAAA,IAAA,OAAA,QAAA,OAAA,GAAA,OAAA,MAAA,OAAA;gBAAGA,KAAH,OAAA,KAAA,SAAA,CAAA,KAAc;YAAD;YAE5BX,CAAAA,GAAG,CAACI,KAAK,IAAI,EAAE,AAAD,EAAGQ,KAAK,GAAGC,GAAG,CAAC,CAACR;gBAC9BA,WAAWM;YACb;QACF;IACF;AACF"}

View File

@@ -0,0 +1,10 @@
// Keep in sync with the `.js` file.
declare const MODERN_BROWSERSLIST_TARGET: [
'chrome 64',
'edge 79',
'firefox 67',
'opera 51',
'safari 12'
]
export default MODERN_BROWSERSLIST_TARGET

View File

@@ -0,0 +1,17 @@
// Note: This file is JS because it's used by the taskfile-swc.js file, which is JS.
// Keep file changes in sync with the corresponding `.d.ts` files.
/**
* These are the browser versions that support all of the following:
* static import: https://caniuse.com/es6-module
* dynamic import: https://caniuse.com/es6-module-dynamic-import
* import.meta: https://caniuse.com/mdn-javascript_operators_import_meta
*/ const MODERN_BROWSERSLIST_TARGET = [
"chrome 64",
"edge 79",
"firefox 67",
"opera 51",
"safari 12"
];
module.exports = MODERN_BROWSERSLIST_TARGET;
//# sourceMappingURL=modern-browserslist-target.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/modern-browserslist-target.js"],"names":["MODERN_BROWSERSLIST_TARGET","module","exports"],"mappings":"AAAA,oFAAoF;AACpF,kEAAkE;AAClE;;;;;CAKC,GACD,MAAMA,6BAA6B;IACjC;IACA;IACA;IACA;IACA;CACD;AAEDC,OAAOC,OAAO,GAAGF"}

View File

@@ -0,0 +1,29 @@
import { ensureLeadingSlash } from "./ensure-leading-slash";
import { normalizePathSep } from "./normalize-path-sep";
import path from "../isomorphic/path";
import { removePagePathTail } from "./remove-page-path-tail";
import { normalizeMetadataRoute } from "../../../lib/metadata/get-metadata-route";
/**
* Given the absolute path to the pages folder, an absolute file path for a
* page and the page extensions, this function will return the page path
* relative to the pages folder. It doesn't consider index tail. Example:
* - `/Users/rick/my-project/pages/foo/bar/baz.js` -> `/foo/bar/baz`
*
* It also handles special metadata routes mapping. Example:
* - `/Users/rick/my-project/app/sitemap.js` -> `/sitemap/route`
*
* @param filepath Absolute path to the page.
* @param opts.dir Absolute path to the pages/app folder.
* @param opts.extensions Extensions allowed for the page.
* @param opts.keepIndex When true the trailing `index` kept in the path.
* @param opts.pagesType Whether the page is in the pages or app directory.
*/ export function absolutePathToPage(pagePath, options) {
const isAppDir = options.pagesType === "app";
const page = removePagePathTail(normalizePathSep(ensureLeadingSlash(path.relative(options.dir, pagePath))), {
extensions: options.extensions,
keepIndex: options.keepIndex
});
return isAppDir ? normalizeMetadataRoute(page) : page;
}
//# sourceMappingURL=absolute-path-to-page.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/page-path/absolute-path-to-page.ts"],"names":["ensureLeadingSlash","normalizePathSep","path","removePagePathTail","normalizeMetadataRoute","absolutePathToPage","pagePath","options","isAppDir","pagesType","page","relative","dir","extensions","keepIndex"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,yBAAwB;AAC3D,SAASC,gBAAgB,QAAQ,uBAAsB;AACvD,OAAOC,UAAU,qBAAoB;AACrC,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,sBAAsB,QAAQ,2CAA0C;AAEjF;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASC,mBACdC,QAAgB,EAChBC,OAKC;IAED,MAAMC,WAAWD,QAAQE,SAAS,KAAK;IACvC,MAAMC,OAAOP,mBACXF,iBAAiBD,mBAAmBE,KAAKS,QAAQ,CAACJ,QAAQK,GAAG,EAAEN,aAC/D;QACEO,YAAYN,QAAQM,UAAU;QAC9BC,WAAWP,QAAQO,SAAS;IAC9B;IAEF,OAAON,WAAWJ,uBAAuBM,QAAQA;AACnD"}

View File

@@ -0,0 +1,9 @@
export function denormalizeAppPagePath(page) {
// `/` is normalized to `/index`
if (page === "/index") {
return "/";
}
return page;
}
//# sourceMappingURL=denormalize-app-path.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/page-path/denormalize-app-path.ts"],"names":["denormalizeAppPagePath","page"],"mappings":"AAAA,OAAO,SAASA,uBAAuBC,IAAY;IACjD,gCAAgC;IAChC,IAAIA,SAAS,UAAU;QACrB,OAAO;IACT;IAEA,OAAOA;AACT"}

View File

@@ -0,0 +1,15 @@
import { isDynamicRoute } from "../router/utils";
import { normalizePathSep } from "./normalize-path-sep";
/**
* Performs the opposite transformation of `normalizePagePath`. Note that
* this function is not idempotent either in cases where there are multiple
* leading `/index` for the page. Examples:
* - `/index` -> `/`
* - `/index/foo` -> `/foo`
* - `/index/index` -> `/index`
*/ export function denormalizePagePath(page) {
let _page = normalizePathSep(page);
return _page.startsWith("/index/") && !isDynamicRoute(_page) ? _page.slice(6) : _page !== "/index" ? _page : "/";
}
//# sourceMappingURL=denormalize-page-path.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/page-path/denormalize-page-path.ts"],"names":["isDynamicRoute","normalizePathSep","denormalizePagePath","page","_page","startsWith","slice"],"mappings":"AAAA,SAASA,cAAc,QAAQ,kBAAiB;AAChD,SAASC,gBAAgB,QAAQ,uBAAsB;AAEvD;;;;;;;CAOC,GACD,OAAO,SAASC,oBAAoBC,IAAY;IAC9C,IAAIC,QAAQH,iBAAiBE;IAC7B,OAAOC,MAAMC,UAAU,CAAC,cAAc,CAACL,eAAeI,SAClDA,MAAME,KAAK,CAAC,KACZF,UAAU,WACVA,QACA;AACN"}

View File

@@ -0,0 +1,8 @@
/**
* For a given page path, this function ensures that there is a leading slash.
* If there is not a leading slash, one is added, otherwise it is noop.
*/ export function ensureLeadingSlash(path) {
return path.startsWith("/") ? path : "/" + path;
}
//# sourceMappingURL=ensure-leading-slash.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/page-path/ensure-leading-slash.ts"],"names":["ensureLeadingSlash","path","startsWith"],"mappings":"AAAA;;;CAGC,GACD,OAAO,SAASA,mBAAmBC,IAAY;IAC7C,OAAOA,KAAKC,UAAU,CAAC,OAAOD,OAAO,AAAC,MAAGA;AAC3C"}

View File

@@ -0,0 +1,40 @@
import { denormalizePagePath } from "./denormalize-page-path";
import path from "../isomorphic/path";
/**
* Calculate all possible pagePaths for a given normalized pagePath along with
* allowed extensions. This can be used to check which one of the files exists
* and to debug inspected locations.
*
* For pages, map `/route` to [`/route.[ext]`, `/route/index.[ext]`]
* For app paths, map `/route/page` to [`/route/page.[ext]`] or `/route/route`
* to [`/route/route.[ext]`]
*
* @param normalizedPagePath Normalized page path (it will denormalize).
* @param extensions Allowed extensions.
*/ export function getPagePaths(normalizedPagePath, extensions, isAppDir) {
const page = denormalizePagePath(normalizedPagePath);
let prefixes;
if (isAppDir) {
prefixes = [
page
];
} else if (normalizedPagePath.endsWith("/index")) {
prefixes = [
path.join(page, "index")
];
} else {
prefixes = [
page,
path.join(page, "index")
];
}
const paths = [];
for (const extension of extensions){
for (const prefix of prefixes){
paths.push(prefix + "." + extension);
}
}
return paths;
}
//# sourceMappingURL=get-page-paths.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/page-path/get-page-paths.ts"],"names":["denormalizePagePath","path","getPagePaths","normalizedPagePath","extensions","isAppDir","page","prefixes","endsWith","join","paths","extension","prefix","push"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,0BAAyB;AAC7D,OAAOC,UAAU,qBAAoB;AAErC;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,aACdC,kBAA0B,EAC1BC,UAAoB,EACpBC,QAAiB;IAEjB,MAAMC,OAAON,oBAAoBG;IAEjC,IAAII;IACJ,IAAIF,UAAU;QACZE,WAAW;YAACD;SAAK;IACnB,OAAO,IAAIH,mBAAmBK,QAAQ,CAAC,WAAW;QAChDD,WAAW;YAACN,KAAKQ,IAAI,CAACH,MAAM;SAAS;IACvC,OAAO;QACLC,WAAW;YAACD;YAAML,KAAKQ,IAAI,CAACH,MAAM;SAAS;IAC7C;IAEA,MAAMI,QAAkB,EAAE;IAC1B,KAAK,MAAMC,aAAaP,WAAY;QAClC,KAAK,MAAMQ,UAAUL,SAAU;YAC7BG,MAAMG,IAAI,CAAC,AAAGD,SAAO,MAAGD;QAC1B;IACF;IAEA,OAAOD;AACT"}

View File

@@ -0,0 +1,24 @@
import { ensureLeadingSlash } from "./ensure-leading-slash";
import { isDynamicRoute } from "../router/utils";
import { NormalizeError } from "../utils";
/**
* Takes a page and transforms it into its file counterpart ensuring that the
* output is normalized. Note this function is not idempotent because a page
* `/index` can be referencing `/index/index.js` and `/index/index` could be
* referencing `/index/index/index.js`. Examples:
* - `/` -> `/index`
* - `/index/foo` -> `/index/index/foo`
* - `/index` -> `/index/index`
*/ export function normalizePagePath(page) {
const normalized = /^\/index(\/|$)/.test(page) && !isDynamicRoute(page) ? "/index" + page : page === "/" ? "/index" : ensureLeadingSlash(page);
if (process.env.NEXT_RUNTIME !== "edge") {
const { posix } = require("path");
const resolvedPage = posix.normalize(normalized);
if (resolvedPage !== normalized) {
throw new NormalizeError("Requested and resolved page mismatch: " + normalized + " " + resolvedPage);
}
}
return normalized;
}
//# sourceMappingURL=normalize-page-path.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/page-path/normalize-page-path.ts"],"names":["ensureLeadingSlash","isDynamicRoute","NormalizeError","normalizePagePath","page","normalized","test","process","env","NEXT_RUNTIME","posix","require","resolvedPage","normalize"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,yBAAwB;AAC3D,SAASC,cAAc,QAAQ,kBAAiB;AAChD,SAASC,cAAc,QAAQ,WAAU;AAEzC;;;;;;;;CAQC,GACD,OAAO,SAASC,kBAAkBC,IAAY;IAC5C,MAAMC,aACJ,iBAAiBC,IAAI,CAACF,SAAS,CAACH,eAAeG,QAC3C,AAAC,WAAQA,OACTA,SAAS,MACT,WACAJ,mBAAmBI;IAEzB,IAAIG,QAAQC,GAAG,CAACC,YAAY,KAAK,QAAQ;QACvC,MAAM,EAAEC,KAAK,EAAE,GAAGC,QAAQ;QAC1B,MAAMC,eAAeF,MAAMG,SAAS,CAACR;QACrC,IAAIO,iBAAiBP,YAAY;YAC/B,MAAM,IAAIH,eACR,AAAC,2CAAwCG,aAAW,MAAGO;QAE3D;IACF;IAEA,OAAOP;AACT"}

View File

@@ -0,0 +1,9 @@
/**
* For a given page path, this function ensures that there is no backslash
* escaping slashes in the path. Example:
* - `foo\/bar\/baz` -> `foo/bar/baz`
*/ export function normalizePathSep(path) {
return path.replace(/\\/g, "/");
}
//# sourceMappingURL=normalize-path-sep.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/page-path/normalize-path-sep.ts"],"names":["normalizePathSep","path","replace"],"mappings":"AAAA;;;;CAIC,GACD,OAAO,SAASA,iBAAiBC,IAAY;IAC3C,OAAOA,KAAKC,OAAO,CAAC,OAAO;AAC7B"}

View File

@@ -0,0 +1,20 @@
import { normalizePathSep } from "./normalize-path-sep";
/**
* Removes the file extension for a page and the trailing `index` if it exists
* making sure to not return an empty string. The page head is not touched
* and returned as it is passed. Examples:
* - `/foo/bar/baz/index.js` -> `/foo/bar/baz`
* - `/foo/bar/baz.js` -> `/foo/bar/baz`
*
* @param pagePath A page to a page file (absolute or relative)
* @param options.extensions Extensions allowed for the page.
* @param options.keepIndex When true the trailing `index` is _not_ removed.
*/ export function removePagePathTail(pagePath, options) {
pagePath = normalizePathSep(pagePath).replace(new RegExp("\\.+(?:" + options.extensions.join("|") + ")$"), "");
if (options.keepIndex !== true) {
pagePath = pagePath.replace(/\/index$/, "") || "/";
}
return pagePath;
}
//# sourceMappingURL=remove-page-path-tail.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/page-path/remove-page-path-tail.ts"],"names":["normalizePathSep","removePagePathTail","pagePath","options","replace","RegExp","extensions","join","keepIndex"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,uBAAsB;AAEvD;;;;;;;;;;CAUC,GACD,OAAO,SAASC,mBACdC,QAAgB,EAChBC,OAGC;IAEDD,WAAWF,iBAAiBE,UAAUE,OAAO,CAC3C,IAAIC,OAAO,AAAC,YAASF,QAAQG,UAAU,CAACC,IAAI,CAAC,OAAK,OAClD;IAGF,IAAIJ,QAAQK,SAAS,KAAK,MAAM;QAC9BN,WAAWA,SAASE,OAAO,CAAC,YAAY,OAAO;IACjD;IAEA,OAAOF;AACT"}

View File

@@ -0,0 +1,7 @@
import React from "react";
export const RouterContext = React.createContext(null);
if (process.env.NODE_ENV !== "production") {
RouterContext.displayName = "RouterContext";
}
//# sourceMappingURL=router-context.shared-runtime.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/shared/lib/router-context.shared-runtime.ts"],"names":["React","RouterContext","createContext","process","env","NODE_ENV","displayName"],"mappings":"AAAA,OAAOA,WAAW,QAAO;AAGzB,OAAO,MAAMC,gBAAgBD,MAAME,aAAa,CAAoB,MAAK;AAEzE,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzCJ,cAAcK,WAAW,GAAG;AAC9B"}

View File

@@ -0,0 +1,115 @@
import React, { useMemo, useRef } from "react";
import { PathnameContext } from "../hooks-client-context.shared-runtime";
import { isDynamicRoute } from "./utils";
import { asPathToSearchParams } from "./utils/as-path-to-search-params";
import { getRouteRegex } from "./utils/route-regex";
/**
* adaptForAppRouterInstance implements the AppRouterInstance with a NextRouter.
*
* @param router the NextRouter to adapt
* @returns an AppRouterInstance
*/ export function adaptForAppRouterInstance(router) {
return {
back () {
router.back();
},
forward () {
router.forward();
},
refresh () {
router.reload();
},
push (href, param) {
let { scroll } = param === void 0 ? {} : param;
void router.push(href, undefined, {
scroll
});
},
replace (href, param) {
let { scroll } = param === void 0 ? {} : param;
void router.replace(href, undefined, {
scroll
});
},
prefetch (href) {
void router.prefetch(href);
}
};
}
/**
* adaptForSearchParams transforms the ParsedURLQuery into URLSearchParams.
*
* @param router the router that contains the query.
* @returns the search params in the URLSearchParams format
*/ export function adaptForSearchParams(router) {
if (!router.isReady || !router.query) {
return new URLSearchParams();
}
return asPathToSearchParams(router.asPath);
}
export function adaptForPathParams(router) {
if (!router.isReady || !router.query) {
return null;
}
const pathParams = {};
const routeRegex = getRouteRegex(router.pathname);
const keys = Object.keys(routeRegex.groups);
for (const key of keys){
pathParams[key] = router.query[key];
}
return pathParams;
}
export function PathnameContextProviderAdapter(param) {
let { children, router, ...props } = param;
const ref = useRef(props.isAutoExport);
const value = useMemo(()=>{
// isAutoExport is only ever `true` on the first render from the server,
// so reset it to `false` after we read it for the first time as `true`. If
// we don't use the value, then we don't need it.
const isAutoExport = ref.current;
if (isAutoExport) {
ref.current = false;
}
// When the route is a dynamic route, we need to do more processing to
// determine if we need to stop showing the pathname.
if (isDynamicRoute(router.pathname)) {
// When the router is rendering the fallback page, it can't possibly know
// the path, so return `null` here. Read more about fallback pages over
// at:
// https://nextjs.org/docs/api-reference/data-fetching/get-static-paths#fallback-pages
if (router.isFallback) {
return null;
}
// When `isAutoExport` is true, meaning this is a page page has been
// automatically statically optimized, and the router is not ready, then
// we can't know the pathname yet. Read more about automatic static
// optimization at:
// https://nextjs.org/docs/advanced-features/automatic-static-optimization
if (isAutoExport && !router.isReady) {
return null;
}
}
// The `router.asPath` contains the pathname seen by the browser (including
// any query strings), so it should have that stripped. Read more about the
// `asPath` option over at:
// https://nextjs.org/docs/api-reference/next/router#router-object
let url;
try {
url = new URL(router.asPath, "http://f");
} catch (_) {
// fallback to / for invalid asPath values e.g. //
return "/";
}
return url.pathname;
}, [
router.asPath,
router.isFallback,
router.isReady,
router.pathname
]);
return /*#__PURE__*/ React.createElement(PathnameContext.Provider, {
value: value
}, children);
}
//# sourceMappingURL=adapters.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/router/adapters.tsx"],"names":["React","useMemo","useRef","PathnameContext","isDynamicRoute","asPathToSearchParams","getRouteRegex","adaptForAppRouterInstance","router","back","forward","refresh","reload","push","href","scroll","undefined","replace","prefetch","adaptForSearchParams","isReady","query","URLSearchParams","asPath","adaptForPathParams","pathParams","routeRegex","pathname","keys","Object","groups","key","PathnameContextProviderAdapter","children","props","ref","isAutoExport","value","current","isFallback","url","URL","_","Provider"],"mappings":"AAAA,OAAOA,SAASC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OAAO,SAASO,+BAA+B,KAO7C;IAP6C,IAAA,EAC7CC,QAAQ,EACRzB,MAAM,EACN,GAAG0B,OAIH,GAP6C;IAQ7C,MAAMC,MAAMjC,OAAOgC,MAAME,YAAY;IACrC,MAAMC,QAAQpC,QAAQ;QACpB,wEAAwE;QACxE,2EAA2E;QAC3E,iDAAiD;QACjD,MAAMmC,eAAeD,IAAIG,OAAO;QAChC,IAAIF,cAAc;YAChBD,IAAIG,OAAO,GAAG;QAChB;QAEA,sEAAsE;QACtE,qDAAqD;QACrD,IAAIlC,eAAeI,OAAOmB,QAAQ,GAAG;YACnC,yEAAyE;YACzE,uEAAuE;YACvE,MAAM;YACN,sFAAsF;YACtF,IAAInB,OAAO+B,UAAU,EAAE;gBACrB,OAAO;YACT;YAEA,oEAAoE;YACpE,wEAAwE;YACxE,mEAAmE;YACnE,mBAAmB;YACnB,0EAA0E;YAC1E,IAAIH,gBAAgB,CAAC5B,OAAOY,OAAO,EAAE;gBACnC,OAAO;YACT;QACF;QAEA,2EAA2E;QAC3E,2EAA2E;QAC3E,2BAA2B;QAC3B,kEAAkE;QAClE,IAAIoB;QACJ,IAAI;YACFA,MAAM,IAAIC,IAAIjC,OAAOe,MAAM,EAAE;QAC/B,EAAE,OAAOmB,GAAG;YACV,kDAAkD;YAClD,OAAO;QACT;QAEA,OAAOF,IAAIb,QAAQ;IACrB,GAAG;QAACnB,OAAOe,MAAM;QAAEf,OAAO+B,UAAU;QAAE/B,OAAOY,OAAO;QAAEZ,OAAOmB,QAAQ;KAAC;IAEtE,qBACE,oBAACxB,gBAAgBwC,QAAQ;QAACN,OAAOA;OAC9BJ;AAGP"}

View File

@@ -0,0 +1,59 @@
import { adaptForAppRouterInstance } from "./adapters";
describe("adaptForAppRouterInstance", ()=>{
beforeEach(()=>jest.resetAllMocks());
const router = {
back: jest.fn(),
forward: jest.fn(),
reload: jest.fn(),
push: jest.fn(),
replace: jest.fn(),
prefetch: jest.fn()
};
const adapter = adaptForAppRouterInstance(router);
it("should forward a call to `back()`", ()=>{
adapter.back();
expect(router.back).toHaveBeenCalled();
});
it("should forward a call to `forward()`", ()=>{
adapter.forward();
expect(router.forward).toHaveBeenCalled();
});
it("should forward a call to `reload()`", ()=>{
adapter.refresh();
expect(router.reload).toHaveBeenCalled();
});
it("should forward a call to `push()`", ()=>{
adapter.push("/foo");
expect(router.push).toHaveBeenCalledWith("/foo", undefined, {
scroll: undefined
});
});
it("should forward a call to `push()` with options", ()=>{
adapter.push("/foo", {
scroll: false
});
expect(router.push).toHaveBeenCalledWith("/foo", undefined, {
scroll: false
});
});
it("should forward a call to `replace()`", ()=>{
adapter.replace("/foo");
expect(router.replace).toHaveBeenCalledWith("/foo", undefined, {
scroll: undefined
});
});
it("should forward a call to `replace()` with options", ()=>{
adapter.replace("/foo", {
scroll: false
});
expect(router.replace).toHaveBeenCalledWith("/foo", undefined, {
scroll: false
});
});
it("should forward a call to `prefetch()`", ()=>{
adapter.prefetch("/foo");
expect(router.prefetch).toHaveBeenCalledWith("/foo");
});
});
//# sourceMappingURL=adapters.test.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/router/adapters.test.tsx"],"names":["adaptForAppRouterInstance","describe","beforeEach","jest","resetAllMocks","router","back","fn","forward","reload","push","replace","prefetch","adapter","it","expect","toHaveBeenCalled","refresh","toHaveBeenCalledWith","undefined","scroll"],"mappings":"AAAA,SAASA,yBAAyB,QAAQ,aAAY;AAGtDC,SAAS,6BAA6B;IACpCC,WAAW,IAAMC,KAAKC,aAAa;IAEnC,MAAMC,SAAS;QACbC,MAAMH,KAAKI,EAAE;QACbC,SAASL,KAAKI,EAAE;QAChBE,QAAQN,KAAKI,EAAE;QACfG,MAAMP,KAAKI,EAAE;QACbI,SAASR,KAAKI,EAAE;QAChBK,UAAUT,KAAKI,EAAE;IACnB;IAEA,MAAMM,UAAUb,0BAA0BK;IAE1CS,GAAG,qCAAqC;QACtCD,QAAQP,IAAI;QACZS,OAAOV,OAAOC,IAAI,EAAEU,gBAAgB;IACtC;IAEAF,GAAG,wCAAwC;QACzCD,QAAQL,OAAO;QACfO,OAAOV,OAAOG,OAAO,EAAEQ,gBAAgB;IACzC;IAEAF,GAAG,uCAAuC;QACxCD,QAAQI,OAAO;QACfF,OAAOV,OAAOI,MAAM,EAAEO,gBAAgB;IACxC;IAEAF,GAAG,qCAAqC;QACtCD,QAAQH,IAAI,CAAC;QACbK,OAAOV,OAAOK,IAAI,EAAEQ,oBAAoB,CAAC,QAAQC,WAAW;YAC1DC,QAAQD;QACV;IACF;IAEAL,GAAG,kDAAkD;QACnDD,QAAQH,IAAI,CAAC,QAAQ;YAAEU,QAAQ;QAAM;QACrCL,OAAOV,OAAOK,IAAI,EAAEQ,oBAAoB,CAAC,QAAQC,WAAW;YAC1DC,QAAQ;QACV;IACF;IAEAN,GAAG,wCAAwC;QACzCD,QAAQF,OAAO,CAAC;QAChBI,OAAOV,OAAOM,OAAO,EAAEO,oBAAoB,CAAC,QAAQC,WAAW;YAC7DC,QAAQD;QACV;IACF;IAEAL,GAAG,qDAAqD;QACtDD,QAAQF,OAAO,CAAC,QAAQ;YAAES,QAAQ;QAAM;QACxCL,OAAOV,OAAOM,OAAO,EAAEO,oBAAoB,CAAC,QAAQC,WAAW;YAC7DC,QAAQ;QACV;IACF;IAEAN,GAAG,yCAAyC;QAC1CD,QAAQD,QAAQ,CAAC;QACjBG,OAAOV,OAAOO,QAAQ,EAAEM,oBAAoB,CAAC;IAC/C;AACF"}

1702
node_modules/next/dist/esm/shared/lib/router/router.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More