@lssm/lib.design-system 1.41.0 → 1.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -7
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_default.js +0 -14
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_wildcard.js +0 -35
- package/dist/node_modules/next/dist/client/add-base-path.js +0 -30
- package/dist/node_modules/next/dist/client/add-locale.js +0 -29
- package/dist/node_modules/next/dist/client/detect-domain-locale.js +0 -26
- package/dist/node_modules/next/dist/client/get-domain-locale.js +0 -41
- package/dist/node_modules/next/dist/client/has-base-path.js +0 -28
- package/dist/node_modules/next/dist/client/link.js +0 -311
- package/dist/node_modules/next/dist/client/normalize-locale-path.js +0 -30
- package/dist/node_modules/next/dist/client/normalize-trailing-slash.js +0 -34
- package/dist/node_modules/next/dist/client/request-idle-callback.js +0 -44
- package/dist/node_modules/next/dist/client/resolve-href.js +0 -86
- package/dist/node_modules/next/dist/client/use-intersection.js +0 -104
- package/dist/node_modules/next/dist/client/use-merged-ref.js +0 -56
- package/dist/node_modules/next/dist/compiled/path-to-regexp/index.js +0 -372
- package/dist/node_modules/next/dist/lib/constants.js +0 -316
- package/dist/node_modules/next/dist/lib/route-pattern-normalizer.js +0 -69
- package/dist/node_modules/next/dist/shared/lib/escape-regexp.js +0 -23
- package/dist/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js +0 -22
- package/dist/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js +0 -42
- package/dist/node_modules/next/dist/shared/lib/invariant-error.js +0 -23
- package/dist/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js +0 -23
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-locale.js +0 -30
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js +0 -24
- package/dist/node_modules/next/dist/shared/lib/router/utils/app-paths.js +0 -41
- package/dist/node_modules/next/dist/shared/lib/router/utils/format-url.js +0 -78
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js +0 -151
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-segment-param.js +0 -77
- package/dist/node_modules/next/dist/shared/lib/router/utils/index.js +0 -32
- package/dist/node_modules/next/dist/shared/lib/router/utils/interception-routes.js +0 -92
- package/dist/node_modules/next/dist/shared/lib/router/utils/interpolate-as.js +0 -41
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-dynamic.js +0 -26
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-local-url.js +0 -31
- package/dist/node_modules/next/dist/shared/lib/router/utils/omit.js +0 -24
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-path.js +0 -36
- package/dist/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js +0 -24
- package/dist/node_modules/next/dist/shared/lib/router/utils/querystring.js +0 -56
- package/dist/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js +0 -26
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-match-utils.js +0 -94
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-matcher.js +0 -46
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-regex.js +0 -203
- package/dist/node_modules/next/dist/shared/lib/router/utils/sorted-routes.js +0 -167
- package/dist/node_modules/next/dist/shared/lib/router-context.shared-runtime.js +0 -20
- package/dist/node_modules/next/dist/shared/lib/segment.js +0 -80
- package/dist/node_modules/next/dist/shared/lib/utils/error-once.js +0 -25
- package/dist/node_modules/next/dist/shared/lib/utils.js +0 -172
- package/dist/node_modules/next/link.js +0 -12
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
-
|
|
3
|
-
//#region ../../../node_modules/next/dist/shared/lib/router/utils/querystring.js
|
|
4
|
-
var require_querystring = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
function _export(target, all) {
|
|
7
|
-
for (var name in all) Object.defineProperty(target, name, {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: all[name]
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
_export(exports, {
|
|
13
|
-
assign: function() {
|
|
14
|
-
return assign;
|
|
15
|
-
},
|
|
16
|
-
searchParamsToUrlQuery: function() {
|
|
17
|
-
return searchParamsToUrlQuery;
|
|
18
|
-
},
|
|
19
|
-
urlQueryToSearchParams: function() {
|
|
20
|
-
return urlQueryToSearchParams;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
function searchParamsToUrlQuery(searchParams) {
|
|
24
|
-
const query = {};
|
|
25
|
-
for (const [key, value] of searchParams.entries()) {
|
|
26
|
-
const existing = query[key];
|
|
27
|
-
if (typeof existing === "undefined") query[key] = value;
|
|
28
|
-
else if (Array.isArray(existing)) existing.push(value);
|
|
29
|
-
else query[key] = [existing, value];
|
|
30
|
-
}
|
|
31
|
-
return query;
|
|
32
|
-
}
|
|
33
|
-
function stringifyUrlQueryParam(param) {
|
|
34
|
-
if (typeof param === "string") return param;
|
|
35
|
-
if (typeof param === "number" && !isNaN(param) || typeof param === "boolean") return String(param);
|
|
36
|
-
else return "";
|
|
37
|
-
}
|
|
38
|
-
function urlQueryToSearchParams(query) {
|
|
39
|
-
const searchParams = new URLSearchParams();
|
|
40
|
-
for (const [key, value] of Object.entries(query)) if (Array.isArray(value)) for (const item of value) searchParams.append(key, stringifyUrlQueryParam(item));
|
|
41
|
-
else searchParams.set(key, stringifyUrlQueryParam(value));
|
|
42
|
-
return searchParams;
|
|
43
|
-
}
|
|
44
|
-
function assign(target, ...searchParamsList) {
|
|
45
|
-
for (const searchParams of searchParamsList) {
|
|
46
|
-
for (const key of searchParams.keys()) target.delete(key);
|
|
47
|
-
for (const [key, value] of searchParams.entries()) target.append(key, value);
|
|
48
|
-
}
|
|
49
|
-
return target;
|
|
50
|
-
}
|
|
51
|
-
}));
|
|
52
|
-
|
|
53
|
-
//#endregion
|
|
54
|
-
export default require_querystring();
|
|
55
|
-
|
|
56
|
-
export { require_querystring };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
-
|
|
3
|
-
//#region ../../../node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js
|
|
4
|
-
/**
|
|
5
|
-
* Removes the trailing slash for a given route or page path. Preserves the
|
|
6
|
-
* root page. Examples:
|
|
7
|
-
* - `/foo/bar/` -> `/foo/bar`
|
|
8
|
-
* - `/foo/bar` -> `/foo/bar`
|
|
9
|
-
* - `/` -> `/`
|
|
10
|
-
*/ var require_remove_trailing_slash = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
Object.defineProperty(exports, "removeTrailingSlash", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function() {
|
|
15
|
-
return removeTrailingSlash;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
function removeTrailingSlash(route) {
|
|
19
|
-
return route.replace(/\/$/, "") || "/";
|
|
20
|
-
}
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
export default require_remove_trailing_slash();
|
|
25
|
-
|
|
26
|
-
export { require_remove_trailing_slash };
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
-
import { require_path_to_regexp } from "../../../../compiled/path-to-regexp/index.js";
|
|
3
|
-
import { require_route_pattern_normalizer } from "../../../../lib/route-pattern-normalizer.js";
|
|
4
|
-
|
|
5
|
-
//#region ../../../node_modules/next/dist/shared/lib/router/utils/route-match-utils.js
|
|
6
|
-
/**
|
|
7
|
-
* Client-safe utilities for route matching that don't import server-side
|
|
8
|
-
* utilities to avoid bundling issues with Turbopack
|
|
9
|
-
*/ var require_route_match_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
function _export(target, all) {
|
|
12
|
-
for (var name in all) Object.defineProperty(target, name, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: all[name]
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
_export(exports, {
|
|
18
|
-
safeCompile: function() {
|
|
19
|
-
return safeCompile;
|
|
20
|
-
},
|
|
21
|
-
safePathToRegexp: function() {
|
|
22
|
-
return safePathToRegexp;
|
|
23
|
-
},
|
|
24
|
-
safeRegexpToFunction: function() {
|
|
25
|
-
return safeRegexpToFunction;
|
|
26
|
-
},
|
|
27
|
-
safeRouteMatcher: function() {
|
|
28
|
-
return safeRouteMatcher;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _pathtoregexp = require_path_to_regexp();
|
|
32
|
-
const _routepatternnormalizer = require_route_pattern_normalizer();
|
|
33
|
-
function safePathToRegexp(route, keys, options) {
|
|
34
|
-
if (typeof route !== "string") return (0, _pathtoregexp.pathToRegexp)(route, keys, options);
|
|
35
|
-
const needsNormalization = (0, _routepatternnormalizer.hasAdjacentParameterIssues)(route);
|
|
36
|
-
const routeToUse = needsNormalization ? (0, _routepatternnormalizer.normalizeAdjacentParameters)(route) : route;
|
|
37
|
-
try {
|
|
38
|
-
return (0, _pathtoregexp.pathToRegexp)(routeToUse, keys, options);
|
|
39
|
-
} catch (error) {
|
|
40
|
-
if (!needsNormalization) try {
|
|
41
|
-
const normalizedRoute = (0, _routepatternnormalizer.normalizeAdjacentParameters)(route);
|
|
42
|
-
return (0, _pathtoregexp.pathToRegexp)(normalizedRoute, keys, options);
|
|
43
|
-
} catch (retryError) {
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
throw error;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function safeCompile(route, options) {
|
|
50
|
-
const needsNormalization = (0, _routepatternnormalizer.hasAdjacentParameterIssues)(route);
|
|
51
|
-
const routeToUse = needsNormalization ? (0, _routepatternnormalizer.normalizeAdjacentParameters)(route) : route;
|
|
52
|
-
try {
|
|
53
|
-
const compiler = (0, _pathtoregexp.compile)(routeToUse, options);
|
|
54
|
-
if (needsNormalization) return (params) => {
|
|
55
|
-
return (0, _routepatternnormalizer.stripNormalizedSeparators)(compiler(params));
|
|
56
|
-
};
|
|
57
|
-
return compiler;
|
|
58
|
-
} catch (error) {
|
|
59
|
-
if (!needsNormalization) try {
|
|
60
|
-
const normalizedRoute = (0, _routepatternnormalizer.normalizeAdjacentParameters)(route);
|
|
61
|
-
const compiler = (0, _pathtoregexp.compile)(normalizedRoute, options);
|
|
62
|
-
return (params) => {
|
|
63
|
-
return (0, _routepatternnormalizer.stripNormalizedSeparators)(compiler(params));
|
|
64
|
-
};
|
|
65
|
-
} catch (retryError) {
|
|
66
|
-
throw error;
|
|
67
|
-
}
|
|
68
|
-
throw error;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function safeRegexpToFunction(regexp, keys) {
|
|
72
|
-
const originalMatcher = (0, _pathtoregexp.regexpToFunction)(regexp, keys || []);
|
|
73
|
-
return (pathname) => {
|
|
74
|
-
const result = originalMatcher(pathname);
|
|
75
|
-
if (!result) return false;
|
|
76
|
-
return {
|
|
77
|
-
...result,
|
|
78
|
-
params: (0, _routepatternnormalizer.stripParameterSeparators)(result.params)
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
function safeRouteMatcher(matcherFn) {
|
|
83
|
-
return (pathname) => {
|
|
84
|
-
const result = matcherFn(pathname);
|
|
85
|
-
if (!result) return false;
|
|
86
|
-
return (0, _routepatternnormalizer.stripParameterSeparators)(result);
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
}));
|
|
90
|
-
|
|
91
|
-
//#endregion
|
|
92
|
-
export default require_route_match_utils();
|
|
93
|
-
|
|
94
|
-
export { require_route_match_utils };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
-
import { require_utils } from "../../utils.js";
|
|
3
|
-
import { require_route_match_utils } from "./route-match-utils.js";
|
|
4
|
-
|
|
5
|
-
//#region ../../../node_modules/next/dist/shared/lib/router/utils/route-matcher.js
|
|
6
|
-
var require_route_matcher = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
Object.defineProperty(exports, "getRouteMatcher", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function() {
|
|
11
|
-
return getRouteMatcher;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
const _utils = require_utils();
|
|
15
|
-
const _routematchutils = require_route_match_utils();
|
|
16
|
-
function getRouteMatcher({ re, groups }) {
|
|
17
|
-
const rawMatcher = (pathname) => {
|
|
18
|
-
const routeMatch = re.exec(pathname);
|
|
19
|
-
if (!routeMatch) return false;
|
|
20
|
-
const decode = (param) => {
|
|
21
|
-
try {
|
|
22
|
-
return decodeURIComponent(param);
|
|
23
|
-
} catch {
|
|
24
|
-
throw Object.defineProperty(new _utils.DecodeError("failed to decode param"), "__NEXT_ERROR_CODE", {
|
|
25
|
-
value: "E528",
|
|
26
|
-
enumerable: false,
|
|
27
|
-
configurable: true
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
const params = {};
|
|
32
|
-
for (const [key, group] of Object.entries(groups)) {
|
|
33
|
-
const match = routeMatch[group.pos];
|
|
34
|
-
if (match !== void 0) if (group.repeat) params[key] = match.split("/").map((entry) => decode(entry));
|
|
35
|
-
else params[key] = decode(match);
|
|
36
|
-
}
|
|
37
|
-
return params;
|
|
38
|
-
};
|
|
39
|
-
return (0, _routematchutils.safeRouteMatcher)(rawMatcher);
|
|
40
|
-
}
|
|
41
|
-
}));
|
|
42
|
-
|
|
43
|
-
//#endregion
|
|
44
|
-
export default require_route_matcher();
|
|
45
|
-
|
|
46
|
-
export { require_route_matcher };
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
-
import { require_remove_trailing_slash } from "./remove-trailing-slash.js";
|
|
3
|
-
import { require_interception_routes } from "./interception-routes.js";
|
|
4
|
-
import { require_constants } from "../../../../lib/constants.js";
|
|
5
|
-
import { require_escape_regexp } from "../../escape-regexp.js";
|
|
6
|
-
import { require_get_dynamic_param } from "./get-dynamic-param.js";
|
|
7
|
-
|
|
8
|
-
//#region ../../../node_modules/next/dist/shared/lib/router/utils/route-regex.js
|
|
9
|
-
var require_route_regex = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
function _export(target, all) {
|
|
12
|
-
for (var name in all) Object.defineProperty(target, name, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: all[name]
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
_export(exports, {
|
|
18
|
-
getNamedMiddlewareRegex: function() {
|
|
19
|
-
return getNamedMiddlewareRegex;
|
|
20
|
-
},
|
|
21
|
-
getNamedRouteRegex: function() {
|
|
22
|
-
return getNamedRouteRegex;
|
|
23
|
-
},
|
|
24
|
-
getRouteRegex: function() {
|
|
25
|
-
return getRouteRegex;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
const _constants = require_constants();
|
|
29
|
-
const _interceptionroutes = require_interception_routes();
|
|
30
|
-
const _escaperegexp = require_escape_regexp();
|
|
31
|
-
const _removetrailingslash = require_remove_trailing_slash();
|
|
32
|
-
const _getdynamicparam = require_get_dynamic_param();
|
|
33
|
-
function getParametrizedRoute(route, includeSuffix, includePrefix) {
|
|
34
|
-
const groups = {};
|
|
35
|
-
let groupIndex = 1;
|
|
36
|
-
const segments = [];
|
|
37
|
-
for (const segment of (0, _removetrailingslash.removeTrailingSlash)(route).slice(1).split("/")) {
|
|
38
|
-
const markerMatch = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.find((m) => segment.startsWith(m));
|
|
39
|
-
const paramMatches = segment.match(_getdynamicparam.PARAMETER_PATTERN);
|
|
40
|
-
if (markerMatch && paramMatches && paramMatches[2]) {
|
|
41
|
-
const { key, optional, repeat } = (0, _getdynamicparam.parseMatchedParameter)(paramMatches[2]);
|
|
42
|
-
groups[key] = {
|
|
43
|
-
pos: groupIndex++,
|
|
44
|
-
repeat,
|
|
45
|
-
optional
|
|
46
|
-
};
|
|
47
|
-
segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(markerMatch)}([^/]+?)`);
|
|
48
|
-
} else if (paramMatches && paramMatches[2]) {
|
|
49
|
-
const { key, repeat, optional } = (0, _getdynamicparam.parseMatchedParameter)(paramMatches[2]);
|
|
50
|
-
groups[key] = {
|
|
51
|
-
pos: groupIndex++,
|
|
52
|
-
repeat,
|
|
53
|
-
optional
|
|
54
|
-
};
|
|
55
|
-
if (includePrefix && paramMatches[1]) segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(paramMatches[1])}`);
|
|
56
|
-
let s = repeat ? optional ? "(?:/(.+?))?" : "/(.+?)" : "/([^/]+?)";
|
|
57
|
-
if (includePrefix && paramMatches[1]) s = s.substring(1);
|
|
58
|
-
segments.push(s);
|
|
59
|
-
} else segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(segment)}`);
|
|
60
|
-
if (includeSuffix && paramMatches && paramMatches[3]) segments.push((0, _escaperegexp.escapeStringRegexp)(paramMatches[3]));
|
|
61
|
-
}
|
|
62
|
-
return {
|
|
63
|
-
parameterizedRoute: segments.join(""),
|
|
64
|
-
groups
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function getRouteRegex(normalizedRoute, { includeSuffix = false, includePrefix = false, excludeOptionalTrailingSlash = false } = {}) {
|
|
68
|
-
const { parameterizedRoute, groups } = getParametrizedRoute(normalizedRoute, includeSuffix, includePrefix);
|
|
69
|
-
let re = parameterizedRoute;
|
|
70
|
-
if (!excludeOptionalTrailingSlash) re += "(?:/)?";
|
|
71
|
-
return {
|
|
72
|
-
re: /* @__PURE__ */ new RegExp(`^${re}$`),
|
|
73
|
-
groups
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Builds a function to generate a minimal routeKey using only a-z and minimal
|
|
78
|
-
* number of characters.
|
|
79
|
-
*/ function buildGetSafeRouteKey() {
|
|
80
|
-
let i = 0;
|
|
81
|
-
return () => {
|
|
82
|
-
let routeKey = "";
|
|
83
|
-
let j = ++i;
|
|
84
|
-
while (j > 0) {
|
|
85
|
-
routeKey += String.fromCharCode(97 + (j - 1) % 26);
|
|
86
|
-
j = Math.floor((j - 1) / 26);
|
|
87
|
-
}
|
|
88
|
-
return routeKey;
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
function getSafeKeyFromSegment({ interceptionMarker, getSafeRouteKey, segment, routeKeys, keyPrefix, backreferenceDuplicateKeys }) {
|
|
92
|
-
const { key, optional, repeat } = (0, _getdynamicparam.parseMatchedParameter)(segment);
|
|
93
|
-
let cleanedKey = key.replace(/\W/g, "");
|
|
94
|
-
if (keyPrefix) cleanedKey = `${keyPrefix}${cleanedKey}`;
|
|
95
|
-
let invalidKey = false;
|
|
96
|
-
if (cleanedKey.length === 0 || cleanedKey.length > 30) invalidKey = true;
|
|
97
|
-
if (!isNaN(parseInt(cleanedKey.slice(0, 1)))) invalidKey = true;
|
|
98
|
-
if (invalidKey) cleanedKey = getSafeRouteKey();
|
|
99
|
-
const duplicateKey = cleanedKey in routeKeys;
|
|
100
|
-
if (keyPrefix) routeKeys[cleanedKey] = `${keyPrefix}${key}`;
|
|
101
|
-
else routeKeys[cleanedKey] = key;
|
|
102
|
-
const interceptionPrefix = interceptionMarker ? (0, _escaperegexp.escapeStringRegexp)(interceptionMarker) : "";
|
|
103
|
-
let pattern;
|
|
104
|
-
if (duplicateKey && backreferenceDuplicateKeys) pattern = `\\k<${cleanedKey}>`;
|
|
105
|
-
else if (repeat) pattern = `(?<${cleanedKey}>.+?)`;
|
|
106
|
-
else pattern = `(?<${cleanedKey}>[^/]+?)`;
|
|
107
|
-
return {
|
|
108
|
-
key,
|
|
109
|
-
pattern: optional ? `(?:/${interceptionPrefix}${pattern})?` : `/${interceptionPrefix}${pattern}`,
|
|
110
|
-
cleanedKey,
|
|
111
|
-
optional,
|
|
112
|
-
repeat
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
function getNamedParametrizedRoute(route, prefixRouteKeys, includeSuffix, includePrefix, backreferenceDuplicateKeys, reference = {
|
|
116
|
-
names: {},
|
|
117
|
-
intercepted: {}
|
|
118
|
-
}) {
|
|
119
|
-
const getSafeRouteKey = buildGetSafeRouteKey();
|
|
120
|
-
const routeKeys = {};
|
|
121
|
-
const segments = [];
|
|
122
|
-
const inverseParts = [];
|
|
123
|
-
reference = structuredClone(reference);
|
|
124
|
-
for (const segment of (0, _removetrailingslash.removeTrailingSlash)(route).slice(1).split("/")) {
|
|
125
|
-
const hasInterceptionMarker = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.some((m) => segment.startsWith(m));
|
|
126
|
-
const paramMatches = segment.match(_getdynamicparam.PARAMETER_PATTERN);
|
|
127
|
-
const interceptionMarker = hasInterceptionMarker ? paramMatches?.[1] : void 0;
|
|
128
|
-
let keyPrefix;
|
|
129
|
-
if (interceptionMarker && paramMatches?.[2]) {
|
|
130
|
-
keyPrefix = prefixRouteKeys ? _constants.NEXT_INTERCEPTION_MARKER_PREFIX : void 0;
|
|
131
|
-
reference.intercepted[paramMatches[2]] = interceptionMarker;
|
|
132
|
-
} else if (paramMatches?.[2] && reference.intercepted[paramMatches[2]]) keyPrefix = prefixRouteKeys ? _constants.NEXT_INTERCEPTION_MARKER_PREFIX : void 0;
|
|
133
|
-
else keyPrefix = prefixRouteKeys ? _constants.NEXT_QUERY_PARAM_PREFIX : void 0;
|
|
134
|
-
if (interceptionMarker && paramMatches && paramMatches[2]) {
|
|
135
|
-
const { key, pattern, cleanedKey, repeat, optional } = getSafeKeyFromSegment({
|
|
136
|
-
getSafeRouteKey,
|
|
137
|
-
interceptionMarker,
|
|
138
|
-
segment: paramMatches[2],
|
|
139
|
-
routeKeys,
|
|
140
|
-
keyPrefix,
|
|
141
|
-
backreferenceDuplicateKeys
|
|
142
|
-
});
|
|
143
|
-
segments.push(pattern);
|
|
144
|
-
inverseParts.push(`/${paramMatches[1]}:${reference.names[key] ?? cleanedKey}${repeat ? optional ? "*" : "+" : ""}`);
|
|
145
|
-
reference.names[key] ??= cleanedKey;
|
|
146
|
-
} else if (paramMatches && paramMatches[2]) {
|
|
147
|
-
if (includePrefix && paramMatches[1]) {
|
|
148
|
-
segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(paramMatches[1])}`);
|
|
149
|
-
inverseParts.push(`/${paramMatches[1]}`);
|
|
150
|
-
}
|
|
151
|
-
const { key, pattern, cleanedKey, repeat, optional } = getSafeKeyFromSegment({
|
|
152
|
-
getSafeRouteKey,
|
|
153
|
-
segment: paramMatches[2],
|
|
154
|
-
routeKeys,
|
|
155
|
-
keyPrefix,
|
|
156
|
-
backreferenceDuplicateKeys
|
|
157
|
-
});
|
|
158
|
-
let s = pattern;
|
|
159
|
-
if (includePrefix && paramMatches[1]) s = s.substring(1);
|
|
160
|
-
segments.push(s);
|
|
161
|
-
inverseParts.push(`/:${reference.names[key] ?? cleanedKey}${repeat ? optional ? "*" : "+" : ""}`);
|
|
162
|
-
reference.names[key] ??= cleanedKey;
|
|
163
|
-
} else {
|
|
164
|
-
segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(segment)}`);
|
|
165
|
-
inverseParts.push(`/${segment}`);
|
|
166
|
-
}
|
|
167
|
-
if (includeSuffix && paramMatches && paramMatches[3]) {
|
|
168
|
-
segments.push((0, _escaperegexp.escapeStringRegexp)(paramMatches[3]));
|
|
169
|
-
inverseParts.push(paramMatches[3]);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
return {
|
|
173
|
-
namedParameterizedRoute: segments.join(""),
|
|
174
|
-
routeKeys,
|
|
175
|
-
pathToRegexpPattern: inverseParts.join(""),
|
|
176
|
-
reference
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
function getNamedRouteRegex(normalizedRoute, options) {
|
|
180
|
-
const result = getNamedParametrizedRoute(normalizedRoute, options.prefixRouteKeys, options.includeSuffix ?? false, options.includePrefix ?? false, options.backreferenceDuplicateKeys ?? false, options.reference);
|
|
181
|
-
let namedRegex = result.namedParameterizedRoute;
|
|
182
|
-
if (!options.excludeOptionalTrailingSlash) namedRegex += "(?:/)?";
|
|
183
|
-
return {
|
|
184
|
-
...getRouteRegex(normalizedRoute, options),
|
|
185
|
-
namedRegex: `^${namedRegex}$`,
|
|
186
|
-
routeKeys: result.routeKeys,
|
|
187
|
-
pathToRegexpPattern: result.pathToRegexpPattern,
|
|
188
|
-
reference: result.reference
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
function getNamedMiddlewareRegex(normalizedRoute, options) {
|
|
192
|
-
const { parameterizedRoute } = getParametrizedRoute(normalizedRoute, false, false);
|
|
193
|
-
const { catchAll = true } = options;
|
|
194
|
-
if (parameterizedRoute === "/") return { namedRegex: `^/${catchAll ? ".*" : ""}$` };
|
|
195
|
-
const { namedParameterizedRoute } = getNamedParametrizedRoute(normalizedRoute, false, false, false, false, void 0);
|
|
196
|
-
return { namedRegex: `^${namedParameterizedRoute}${catchAll ? "(?:(/.*)?)" : ""}$` };
|
|
197
|
-
}
|
|
198
|
-
}));
|
|
199
|
-
|
|
200
|
-
//#endregion
|
|
201
|
-
export default require_route_regex();
|
|
202
|
-
|
|
203
|
-
export { require_route_regex };
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
-
|
|
3
|
-
//#region ../../../node_modules/next/dist/shared/lib/router/utils/sorted-routes.js
|
|
4
|
-
var require_sorted_routes = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
function _export(target, all) {
|
|
7
|
-
for (var name in all) Object.defineProperty(target, name, {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: all[name]
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
_export(exports, {
|
|
13
|
-
getSortedRouteObjects: function() {
|
|
14
|
-
return getSortedRouteObjects;
|
|
15
|
-
},
|
|
16
|
-
getSortedRoutes: function() {
|
|
17
|
-
return getSortedRoutes;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
var UrlNode = class UrlNode {
|
|
21
|
-
insert(urlPath) {
|
|
22
|
-
this._insert(urlPath.split("/").filter(Boolean), [], false);
|
|
23
|
-
}
|
|
24
|
-
smoosh() {
|
|
25
|
-
return this._smoosh();
|
|
26
|
-
}
|
|
27
|
-
_smoosh(prefix = "/") {
|
|
28
|
-
const childrenPaths = [...this.children.keys()].sort();
|
|
29
|
-
if (this.slugName !== null) childrenPaths.splice(childrenPaths.indexOf("[]"), 1);
|
|
30
|
-
if (this.restSlugName !== null) childrenPaths.splice(childrenPaths.indexOf("[...]"), 1);
|
|
31
|
-
if (this.optionalRestSlugName !== null) childrenPaths.splice(childrenPaths.indexOf("[[...]]"), 1);
|
|
32
|
-
const routes = childrenPaths.map((c) => this.children.get(c)._smoosh(`${prefix}${c}/`)).reduce((prev, curr) => [...prev, ...curr], []);
|
|
33
|
-
if (this.slugName !== null) routes.push(...this.children.get("[]")._smoosh(`${prefix}[${this.slugName}]/`));
|
|
34
|
-
if (!this.placeholder) {
|
|
35
|
-
const r = prefix === "/" ? "/" : prefix.slice(0, -1);
|
|
36
|
-
if (this.optionalRestSlugName != null) throw Object.defineProperty(/* @__PURE__ */ new Error(`You cannot define a route with the same specificity as a optional catch-all route ("${r}" and "${r}[[...${this.optionalRestSlugName}]]").`), "__NEXT_ERROR_CODE", {
|
|
37
|
-
value: "E458",
|
|
38
|
-
enumerable: false,
|
|
39
|
-
configurable: true
|
|
40
|
-
});
|
|
41
|
-
routes.unshift(r);
|
|
42
|
-
}
|
|
43
|
-
if (this.restSlugName !== null) routes.push(...this.children.get("[...]")._smoosh(`${prefix}[...${this.restSlugName}]/`));
|
|
44
|
-
if (this.optionalRestSlugName !== null) routes.push(...this.children.get("[[...]]")._smoosh(`${prefix}[[...${this.optionalRestSlugName}]]/`));
|
|
45
|
-
return routes;
|
|
46
|
-
}
|
|
47
|
-
_insert(urlPaths, slugNames, isCatchAll) {
|
|
48
|
-
if (urlPaths.length === 0) {
|
|
49
|
-
this.placeholder = false;
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
if (isCatchAll) throw Object.defineProperty(/* @__PURE__ */ new Error(`Catch-all must be the last part of the URL.`), "__NEXT_ERROR_CODE", {
|
|
53
|
-
value: "E392",
|
|
54
|
-
enumerable: false,
|
|
55
|
-
configurable: true
|
|
56
|
-
});
|
|
57
|
-
let nextSegment = urlPaths[0];
|
|
58
|
-
if (nextSegment.startsWith("[") && nextSegment.endsWith("]")) {
|
|
59
|
-
let segmentName = nextSegment.slice(1, -1);
|
|
60
|
-
let isOptional = false;
|
|
61
|
-
if (segmentName.startsWith("[") && segmentName.endsWith("]")) {
|
|
62
|
-
segmentName = segmentName.slice(1, -1);
|
|
63
|
-
isOptional = true;
|
|
64
|
-
}
|
|
65
|
-
if (segmentName.startsWith("…")) throw Object.defineProperty(/* @__PURE__ */ new Error(`Detected a three-dot character ('…') at ('${segmentName}'). Did you mean ('...')?`), "__NEXT_ERROR_CODE", {
|
|
66
|
-
value: "E147",
|
|
67
|
-
enumerable: false,
|
|
68
|
-
configurable: true
|
|
69
|
-
});
|
|
70
|
-
if (segmentName.startsWith("...")) {
|
|
71
|
-
segmentName = segmentName.substring(3);
|
|
72
|
-
isCatchAll = true;
|
|
73
|
-
}
|
|
74
|
-
if (segmentName.startsWith("[") || segmentName.endsWith("]")) throw Object.defineProperty(/* @__PURE__ */ new Error(`Segment names may not start or end with extra brackets ('${segmentName}').`), "__NEXT_ERROR_CODE", {
|
|
75
|
-
value: "E421",
|
|
76
|
-
enumerable: false,
|
|
77
|
-
configurable: true
|
|
78
|
-
});
|
|
79
|
-
if (segmentName.startsWith(".")) throw Object.defineProperty(/* @__PURE__ */ new Error(`Segment names may not start with erroneous periods ('${segmentName}').`), "__NEXT_ERROR_CODE", {
|
|
80
|
-
value: "E288",
|
|
81
|
-
enumerable: false,
|
|
82
|
-
configurable: true
|
|
83
|
-
});
|
|
84
|
-
function handleSlug(previousSlug, nextSlug) {
|
|
85
|
-
if (previousSlug !== null) {
|
|
86
|
-
if (previousSlug !== nextSlug) throw Object.defineProperty(/* @__PURE__ */ new Error(`You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').`), "__NEXT_ERROR_CODE", {
|
|
87
|
-
value: "E337",
|
|
88
|
-
enumerable: false,
|
|
89
|
-
configurable: true
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
slugNames.forEach((slug) => {
|
|
93
|
-
if (slug === nextSlug) throw Object.defineProperty(/* @__PURE__ */ new Error(`You cannot have the same slug name "${nextSlug}" repeat within a single dynamic path`), "__NEXT_ERROR_CODE", {
|
|
94
|
-
value: "E247",
|
|
95
|
-
enumerable: false,
|
|
96
|
-
configurable: true
|
|
97
|
-
});
|
|
98
|
-
if (slug.replace(/\W/g, "") === nextSegment.replace(/\W/g, "")) throw Object.defineProperty(/* @__PURE__ */ new Error(`You cannot have the slug names "${slug}" and "${nextSlug}" differ only by non-word symbols within a single dynamic path`), "__NEXT_ERROR_CODE", {
|
|
99
|
-
value: "E499",
|
|
100
|
-
enumerable: false,
|
|
101
|
-
configurable: true
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
slugNames.push(nextSlug);
|
|
105
|
-
}
|
|
106
|
-
if (isCatchAll) if (isOptional) {
|
|
107
|
-
if (this.restSlugName != null) throw Object.defineProperty(/* @__PURE__ */ new Error(`You cannot use both an required and optional catch-all route at the same level ("[...${this.restSlugName}]" and "${urlPaths[0]}" ).`), "__NEXT_ERROR_CODE", {
|
|
108
|
-
value: "E299",
|
|
109
|
-
enumerable: false,
|
|
110
|
-
configurable: true
|
|
111
|
-
});
|
|
112
|
-
handleSlug(this.optionalRestSlugName, segmentName);
|
|
113
|
-
this.optionalRestSlugName = segmentName;
|
|
114
|
-
nextSegment = "[[...]]";
|
|
115
|
-
} else {
|
|
116
|
-
if (this.optionalRestSlugName != null) throw Object.defineProperty(/* @__PURE__ */ new Error(`You cannot use both an optional and required catch-all route at the same level ("[[...${this.optionalRestSlugName}]]" and "${urlPaths[0]}").`), "__NEXT_ERROR_CODE", {
|
|
117
|
-
value: "E300",
|
|
118
|
-
enumerable: false,
|
|
119
|
-
configurable: true
|
|
120
|
-
});
|
|
121
|
-
handleSlug(this.restSlugName, segmentName);
|
|
122
|
-
this.restSlugName = segmentName;
|
|
123
|
-
nextSegment = "[...]";
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
if (isOptional) throw Object.defineProperty(/* @__PURE__ */ new Error(`Optional route parameters are not yet supported ("${urlPaths[0]}").`), "__NEXT_ERROR_CODE", {
|
|
127
|
-
value: "E435",
|
|
128
|
-
enumerable: false,
|
|
129
|
-
configurable: true
|
|
130
|
-
});
|
|
131
|
-
handleSlug(this.slugName, segmentName);
|
|
132
|
-
this.slugName = segmentName;
|
|
133
|
-
nextSegment = "[]";
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (!this.children.has(nextSegment)) this.children.set(nextSegment, new UrlNode());
|
|
137
|
-
this.children.get(nextSegment)._insert(urlPaths.slice(1), slugNames, isCatchAll);
|
|
138
|
-
}
|
|
139
|
-
constructor() {
|
|
140
|
-
this.placeholder = true;
|
|
141
|
-
this.children = /* @__PURE__ */ new Map();
|
|
142
|
-
this.slugName = null;
|
|
143
|
-
this.restSlugName = null;
|
|
144
|
-
this.optionalRestSlugName = null;
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
function getSortedRoutes(normalizedPages) {
|
|
148
|
-
const root = new UrlNode();
|
|
149
|
-
normalizedPages.forEach((pagePath) => root.insert(pagePath));
|
|
150
|
-
return root.smoosh();
|
|
151
|
-
}
|
|
152
|
-
function getSortedRouteObjects(objects, getter) {
|
|
153
|
-
const indexes = {};
|
|
154
|
-
const pathnames = [];
|
|
155
|
-
for (let i = 0; i < objects.length; i++) {
|
|
156
|
-
const pathname = getter(objects[i]);
|
|
157
|
-
indexes[pathname] = i;
|
|
158
|
-
pathnames[i] = pathname;
|
|
159
|
-
}
|
|
160
|
-
return getSortedRoutes(pathnames).map((pathname) => objects[indexes[pathname]]);
|
|
161
|
-
}
|
|
162
|
-
}));
|
|
163
|
-
|
|
164
|
-
//#endregion
|
|
165
|
-
export default require_sorted_routes();
|
|
166
|
-
|
|
167
|
-
export { require_sorted_routes };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin, __require } from "../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
-
import { require__interop_require_default } from "../../../../@swc/helpers/cjs/_interop_require_default.js";
|
|
3
|
-
|
|
4
|
-
//#region ../../../node_modules/next/dist/shared/lib/router-context.shared-runtime.js
|
|
5
|
-
var require_router_context_shared_runtime = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
Object.defineProperty(exports, "RouterContext", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function() {
|
|
10
|
-
return RouterContext;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
const RouterContext = (/* @__PURE__ */ require__interop_require_default()._(__require("react"))).default.createContext(null);
|
|
14
|
-
RouterContext.displayName = "RouterContext";
|
|
15
|
-
}));
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
export default require_router_context_shared_runtime();
|
|
19
|
-
|
|
20
|
-
export { require_router_context_shared_runtime };
|