421 lines
14 KiB
JavaScript
421 lines
14 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: 5d5b47876e53e564.da1ba52a93.js
|
|
* Module id: 307476
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e, t, r) => {
|
|
(() => {
|
|
"use strict";
|
|
"u" > typeof __nccwpck_require__ &&
|
|
(__nccwpck_require__.ab =
|
|
"/ROOT/node_modules/.pnpm/next@16.1.6_@babel+core@7.29.0_@opentelemetry+api@1.9.0_@playwright+test@1.58.1_babel-p_876821d3b4564cd803d7157ee72f8b43/node_modules/next/dist/compiled/path-to-regexp/");
|
|
var e = {};
|
|
(() => {
|
|
function t(e, t) {
|
|
void 0 === t && (t = {});
|
|
for (
|
|
var r = (function (e) {
|
|
for (var t = [], r = 0; r < e.length; ) {
|
|
var n = e[r];
|
|
if ("*" === n || "+" === n || "?" === n) {
|
|
t.push({ type: "MODIFIER", index: r, value: e[r++] });
|
|
continue;
|
|
}
|
|
if ("\\" === n) {
|
|
t.push({ type: "ESCAPED_CHAR", index: r++, value: e[r++] });
|
|
continue;
|
|
}
|
|
if ("{" === n) {
|
|
t.push({ type: "OPEN", index: r, value: e[r++] });
|
|
continue;
|
|
}
|
|
if ("}" === n) {
|
|
t.push({ type: "CLOSE", index: r, value: e[r++] });
|
|
continue;
|
|
}
|
|
if (":" === n) {
|
|
for (var o = "", a = r + 1; a < e.length; ) {
|
|
var i = e.charCodeAt(a);
|
|
if (
|
|
(i >= 48 && i <= 57) ||
|
|
(i >= 65 && i <= 90) ||
|
|
(i >= 97 && i <= 122) ||
|
|
95 === i
|
|
) {
|
|
o += e[a++];
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
if (!o)
|
|
throw TypeError("Missing parameter name at ".concat(r));
|
|
t.push({ type: "NAME", index: r, value: o }), (r = a);
|
|
continue;
|
|
}
|
|
if ("(" === n) {
|
|
var l = 1,
|
|
s = "",
|
|
a = r + 1;
|
|
if ("?" === e[a])
|
|
throw TypeError(
|
|
'Pattern cannot start with "?" at '.concat(a),
|
|
);
|
|
for (; a < e.length; ) {
|
|
if ("\\" === e[a]) {
|
|
s += e[a++] + e[a++];
|
|
continue;
|
|
}
|
|
if (")" === e[a]) {
|
|
if (0 == --l) {
|
|
a++;
|
|
break;
|
|
}
|
|
} else if ("(" === e[a] && (l++, "?" !== e[a + 1]))
|
|
throw TypeError(
|
|
"Capturing groups are not allowed at ".concat(a),
|
|
);
|
|
s += e[a++];
|
|
}
|
|
if (l) throw TypeError("Unbalanced pattern at ".concat(r));
|
|
if (!s) throw TypeError("Missing pattern at ".concat(r));
|
|
t.push({ type: "PATTERN", index: r, value: s }), (r = a);
|
|
continue;
|
|
}
|
|
t.push({ type: "CHAR", index: r, value: e[r++] });
|
|
}
|
|
return t.push({ type: "END", index: r, value: "" }), t;
|
|
})(e),
|
|
n = t.prefixes,
|
|
a = void 0 === n ? "./" : n,
|
|
i = t.delimiter,
|
|
l = void 0 === i ? "/#?" : i,
|
|
s = [],
|
|
c = 0,
|
|
u = 0,
|
|
d = "",
|
|
f = function (e) {
|
|
if (u < r.length && r[u].type === e) return r[u++].value;
|
|
},
|
|
m = function (e) {
|
|
var t = f(e);
|
|
if (void 0 !== t) return t;
|
|
var n = r[u],
|
|
o = n.type,
|
|
a = n.index;
|
|
throw TypeError(
|
|
"Unexpected "
|
|
.concat(o, " at ")
|
|
.concat(a, ", expected ")
|
|
.concat(e),
|
|
);
|
|
},
|
|
p = function () {
|
|
for (var e, t = ""; (e = f("CHAR") || f("ESCAPED_CHAR")); )
|
|
t += e;
|
|
return t;
|
|
},
|
|
h = function (e) {
|
|
for (var t = 0; t < l.length; t++) {
|
|
var r = l[t];
|
|
if (e.indexOf(r) > -1) return !0;
|
|
}
|
|
return !1;
|
|
},
|
|
g = function (e) {
|
|
var t = s[s.length - 1],
|
|
r = e || (t && "string" == typeof t ? t : "");
|
|
if (t && !r)
|
|
throw TypeError(
|
|
'Must have text between two parameters, missing text after "'.concat(
|
|
t.name,
|
|
'"',
|
|
),
|
|
);
|
|
return !r || h(r)
|
|
? "[^".concat(o(l), "]+?")
|
|
: "(?:(?!".concat(o(r), ")[^").concat(o(l), "])+?");
|
|
};
|
|
u < r.length;
|
|
|
|
) {
|
|
var b = f("CHAR"),
|
|
v = f("NAME"),
|
|
_ = f("PATTERN");
|
|
if (v || _) {
|
|
var y = b || "";
|
|
-1 === a.indexOf(y) && ((d += y), (y = "")),
|
|
d && (s.push(d), (d = "")),
|
|
s.push({
|
|
name: v || c++,
|
|
prefix: y,
|
|
suffix: "",
|
|
pattern: _ || g(y),
|
|
modifier: f("MODIFIER") || "",
|
|
});
|
|
continue;
|
|
}
|
|
var x = b || f("ESCAPED_CHAR");
|
|
if (x) {
|
|
d += x;
|
|
continue;
|
|
}
|
|
if ((d && (s.push(d), (d = "")), f("OPEN"))) {
|
|
var y = p(),
|
|
C = f("NAME") || "",
|
|
E = f("PATTERN") || "",
|
|
S = p();
|
|
m("CLOSE"),
|
|
s.push({
|
|
name: C || (E ? c++ : ""),
|
|
pattern: C && !E ? g(y) : E,
|
|
prefix: y,
|
|
suffix: S,
|
|
modifier: f("MODIFIER") || "",
|
|
});
|
|
continue;
|
|
}
|
|
m("END");
|
|
}
|
|
return s;
|
|
}
|
|
function r(e, t) {
|
|
void 0 === t && (t = {});
|
|
var r = a(t),
|
|
n = t.encode,
|
|
o =
|
|
void 0 === n
|
|
? function (e) {
|
|
return e;
|
|
}
|
|
: n,
|
|
i = t.validate,
|
|
l = void 0 === i || i,
|
|
s = e.map(function (e) {
|
|
if ("object" == typeof e)
|
|
return new RegExp("^(?:".concat(e.pattern, ")$"), r);
|
|
});
|
|
return function (t) {
|
|
for (var r = "", n = 0; n < e.length; n++) {
|
|
var a = e[n];
|
|
if ("string" == typeof a) {
|
|
r += a;
|
|
continue;
|
|
}
|
|
var i = t ? t[a.name] : void 0,
|
|
c = "?" === a.modifier || "*" === a.modifier,
|
|
u = "*" === a.modifier || "+" === a.modifier;
|
|
if (Array.isArray(i)) {
|
|
if (!u)
|
|
throw TypeError(
|
|
'Expected "'.concat(
|
|
a.name,
|
|
'" to not repeat, but got an array',
|
|
),
|
|
);
|
|
if (0 === i.length) {
|
|
if (c) continue;
|
|
throw TypeError(
|
|
'Expected "'.concat(a.name, '" to not be empty'),
|
|
);
|
|
}
|
|
for (var d = 0; d < i.length; d++) {
|
|
var f = o(i[d], a);
|
|
if (l && !s[n].test(f))
|
|
throw TypeError(
|
|
'Expected all "'
|
|
.concat(a.name, '" to match "')
|
|
.concat(a.pattern, '", but got "')
|
|
.concat(f, '"'),
|
|
);
|
|
r += a.prefix + f + a.suffix;
|
|
}
|
|
continue;
|
|
}
|
|
if ("string" == typeof i || "number" == typeof i) {
|
|
var f = o(String(i), a);
|
|
if (l && !s[n].test(f))
|
|
throw TypeError(
|
|
'Expected "'
|
|
.concat(a.name, '" to match "')
|
|
.concat(a.pattern, '", but got "')
|
|
.concat(f, '"'),
|
|
);
|
|
r += a.prefix + f + a.suffix;
|
|
continue;
|
|
}
|
|
if (!c) {
|
|
var m = u ? "an array" : "a string";
|
|
throw TypeError(
|
|
'Expected "'.concat(a.name, '" to be ').concat(m),
|
|
);
|
|
}
|
|
}
|
|
return r;
|
|
};
|
|
}
|
|
function n(e, t, r) {
|
|
void 0 === r && (r = {});
|
|
var n = r.decode,
|
|
o =
|
|
void 0 === n
|
|
? function (e) {
|
|
return e;
|
|
}
|
|
: n;
|
|
return function (r) {
|
|
var n = e.exec(r);
|
|
if (!n) return !1;
|
|
for (
|
|
var a = n[0], i = n.index, l = Object.create(null), s = 1;
|
|
s < n.length;
|
|
s++
|
|
)
|
|
!(function (e) {
|
|
if (void 0 !== n[e]) {
|
|
var r = t[e - 1];
|
|
"*" === r.modifier || "+" === r.modifier
|
|
? (l[r.name] = n[e]
|
|
.split(r.prefix + r.suffix)
|
|
.map(function (e) {
|
|
return o(e, r);
|
|
}))
|
|
: (l[r.name] = o(n[e], r));
|
|
}
|
|
})(s);
|
|
return { path: a, index: i, params: l };
|
|
};
|
|
}
|
|
function o(e) {
|
|
return e.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
|
|
}
|
|
function a(e) {
|
|
return e && e.sensitive ? "" : "i";
|
|
}
|
|
function i(e, t, r) {
|
|
void 0 === r && (r = {});
|
|
for (
|
|
var n = r.strict,
|
|
i = void 0 !== n && n,
|
|
l = r.start,
|
|
s = r.end,
|
|
c = r.encode,
|
|
u =
|
|
void 0 === c
|
|
? function (e) {
|
|
return e;
|
|
}
|
|
: c,
|
|
d = r.delimiter,
|
|
f = r.endsWith,
|
|
m = "[".concat(o(void 0 === f ? "" : f), "]|$"),
|
|
p = "[".concat(o(void 0 === d ? "/#?" : d), "]"),
|
|
h = void 0 === l || l ? "^" : "",
|
|
g = 0;
|
|
g < e.length;
|
|
g++
|
|
) {
|
|
var b = e[g];
|
|
if ("string" == typeof b) h += o(u(b));
|
|
else {
|
|
var v = o(u(b.prefix)),
|
|
_ = o(u(b.suffix));
|
|
if (b.pattern)
|
|
if ((t && t.push(b), v || _))
|
|
if ("+" === b.modifier || "*" === b.modifier) {
|
|
var y = "*" === b.modifier ? "?" : "";
|
|
h += "(?:"
|
|
.concat(v, "((?:")
|
|
.concat(b.pattern, ")(?:")
|
|
.concat(_)
|
|
.concat(v, "(?:")
|
|
.concat(b.pattern, "))*)")
|
|
.concat(_, ")")
|
|
.concat(y);
|
|
} else
|
|
h += "(?:"
|
|
.concat(v, "(")
|
|
.concat(b.pattern, ")")
|
|
.concat(_, ")")
|
|
.concat(b.modifier);
|
|
else {
|
|
if ("+" === b.modifier || "*" === b.modifier)
|
|
throw TypeError(
|
|
'Can not repeat "'.concat(
|
|
b.name,
|
|
'" without a prefix and suffix',
|
|
),
|
|
);
|
|
h += "(".concat(b.pattern, ")").concat(b.modifier);
|
|
}
|
|
else h += "(?:".concat(v).concat(_, ")").concat(b.modifier);
|
|
}
|
|
}
|
|
if (void 0 === s || s)
|
|
i || (h += "".concat(p, "?")),
|
|
(h += r.endsWith ? "(?=".concat(m, ")") : "$");
|
|
else {
|
|
var x = e[e.length - 1],
|
|
C =
|
|
"string" == typeof x
|
|
? p.indexOf(x[x.length - 1]) > -1
|
|
: void 0 === x;
|
|
i || (h += "(?:".concat(p, "(?=").concat(m, "))?")),
|
|
C || (h += "(?=".concat(p, "|").concat(m, ")"));
|
|
}
|
|
return new RegExp(h, a(r));
|
|
}
|
|
function l(e, r, n) {
|
|
if (e instanceof RegExp) {
|
|
var o;
|
|
if (!r) return e;
|
|
for (
|
|
var s = /\((?:\?<(.*?)>)?(?!\?)/g, c = 0, u = s.exec(e.source);
|
|
u;
|
|
|
|
)
|
|
r.push({
|
|
name: u[1] || c++,
|
|
prefix: "",
|
|
suffix: "",
|
|
modifier: "",
|
|
pattern: "",
|
|
}),
|
|
(u = s.exec(e.source));
|
|
return e;
|
|
}
|
|
return Array.isArray(e)
|
|
? ((o = e.map(function (e) {
|
|
return l(e, r, n).source;
|
|
})),
|
|
new RegExp("(?:".concat(o.join("|"), ")"), a(n)))
|
|
: i(t(e, n), r, n);
|
|
}
|
|
Object.defineProperty(e, "__esModule", { value: !0 }),
|
|
(e.pathToRegexp =
|
|
e.tokensToRegexp =
|
|
e.regexpToFunction =
|
|
e.match =
|
|
e.tokensToFunction =
|
|
e.compile =
|
|
e.parse =
|
|
void 0),
|
|
(e.parse = t),
|
|
(e.compile = function (e, n) {
|
|
return r(t(e, n), n);
|
|
}),
|
|
(e.tokensToFunction = r),
|
|
(e.match = function (e, t) {
|
|
var r = [];
|
|
return n(l(e, r, t), r, t);
|
|
}),
|
|
(e.regexpToFunction = n),
|
|
(e.tokensToRegexp = i),
|
|
(e.pathToRegexp = l);
|
|
})(),
|
|
(t.exports = e);
|
|
})();
|
|
};
|
|
|
|
export default moduleFactory;
|