PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
gutenberg / build / routes / navigation-edit / content.js

content.js in Gutenberg trunk, at build/routes/navigation-edit/content.js

2,094 lines 88.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var __create = Object.create;
2 var __defProp = Object.defineProperty;
3 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4 var __getOwnPropNames = Object.getOwnPropertyNames;
5 var __getProtoOf = Object.getPrototypeOf;
6 var __hasOwnProp = Object.prototype.hasOwnProperty;
7 var __commonJS = (cb, mod) => function __require() {
8 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9 };
10 var __copyProps = (to, from, except, desc) => {
11 if (from && typeof from === "object" || typeof from === "function") {
12 for (let key of __getOwnPropNames(from))
13 if (!__hasOwnProp.call(to, key) && key !== except)
14 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15 }
16 return to;
17 };
18 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19 // If the importer is in node compatibility mode or this is not an ESM
20 // file that has been converted to a CommonJS file using a Babel-
21 // compatible transform (i.e. "__esModule" has not been set), then set
22 // "default" to the CommonJS "module.exports" for node compatibility.
23 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24 mod
25 ));
26
27 // package-external:@wordpress/i18n
28 var require_i18n = __commonJS({
29 "package-external:@wordpress/i18n"(exports, module) {
30 module.exports = window.wp.i18n;
31 }
32 });
33
34 // package-external:@wordpress/element
35 var require_element = __commonJS({
36 "package-external:@wordpress/element"(exports, module) {
37 module.exports = window.wp.element;
38 }
39 });
40
41 // vendor-external:react
42 var require_react = __commonJS({
43 "vendor-external:react"(exports, module) {
44 module.exports = window.React;
45 }
46 });
47
48 // vendor-external:react/jsx-runtime
49 var require_jsx_runtime = __commonJS({
50 "vendor-external:react/jsx-runtime"(exports, module) {
51 module.exports = window.ReactJSXRuntime;
52 }
53 });
54
55 // package-external:@wordpress/private-apis
56 var require_private_apis = __commonJS({
57 "package-external:@wordpress/private-apis"(exports, module) {
58 module.exports = window.wp.privateApis;
59 }
60 });
61
62 // package-external:@wordpress/primitives
63 var require_primitives = __commonJS({
64 "package-external:@wordpress/primitives"(exports, module) {
65 module.exports = window.wp.primitives;
66 }
67 });
68
69 // package-external:@wordpress/components
70 var require_components = __commonJS({
71 "package-external:@wordpress/components"(exports, module) {
72 module.exports = window.wp.components;
73 }
74 });
75
76 // package-external:@wordpress/data
77 var require_data = __commonJS({
78 "package-external:@wordpress/data"(exports, module) {
79 module.exports = window.wp.data;
80 }
81 });
82
83 // package-external:@wordpress/core-data
84 var require_core_data = __commonJS({
85 "package-external:@wordpress/core-data"(exports, module) {
86 module.exports = window.wp.coreData;
87 }
88 });
89
90 // package-external:@wordpress/html-entities
91 var require_html_entities = __commonJS({
92 "package-external:@wordpress/html-entities"(exports, module) {
93 module.exports = window.wp.htmlEntities;
94 }
95 });
96
97 // package-external:@wordpress/block-editor
98 var require_block_editor = __commonJS({
99 "package-external:@wordpress/block-editor"(exports, module) {
100 module.exports = window.wp.blockEditor;
101 }
102 });
103
104 // package-external:@wordpress/blocks
105 var require_blocks = __commonJS({
106 "package-external:@wordpress/blocks"(exports, module) {
107 module.exports = window.wp.blocks;
108 }
109 });
110
111 // routes/navigation-edit/stage.tsx
112 import { useParams } from "@wordpress/route";
113
114 // packages/admin-ui/build-module/breadcrumbs/index.mjs
115 var import_i18n2 = __toESM(require_i18n(), 1);
116 import { Link as RouterLink } from "@wordpress/route";
117
118 // node_modules/clsx/dist/clsx.mjs
119 function r(e) {
120 var t, f, n = "";
121 if ("string" == typeof e || "number" == typeof e) n += e;
122 else if ("object" == typeof e) if (Array.isArray(e)) {
123 var o = e.length;
124 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
125 } else for (f in e) e[f] && (n && (n += " "), n += f);
126 return n;
127 }
128 function clsx() {
129 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
130 return n;
131 }
132 var clsx_default = clsx;
133
134 // node_modules/@base-ui/utils/createLogOnce.mjs
135 var loggedMessages;
136 if (true) {
137 loggedMessages = /* @__PURE__ */ new Set();
138 }
139 function createLogOnce(severity, prefix) {
140 return function logOnce(...messages) {
141 if (true) {
142 const message = messages.join(" ");
143 const output = prefix ? `${prefix}: ${message}` : message;
144 const key = `${severity}:${output}`;
145 if (!loggedMessages.has(key)) {
146 loggedMessages.add(key);
147 if (severity === "warn") {
148 console.warn(output);
149 } else {
150 console.error(output);
151 }
152 }
153 }
154 };
155 }
156
157 // node_modules/@base-ui/utils/useRefWithInit.mjs
158 var React = __toESM(require_react(), 1);
159 var UNINITIALIZED = {};
160 function useRefWithInit(init, initArg) {
161 const ref = React.useRef(UNINITIALIZED);
162 if (ref.current === UNINITIALIZED) {
163 ref.current = init(initArg);
164 }
165 return ref;
166 }
167
168 // node_modules/@base-ui/utils/warn.mjs
169 var warn = createLogOnce("warn", "Base UI");
170
171 // node_modules/@base-ui/utils/empty.mjs
172 var EMPTY_ARRAY = Object.freeze([]);
173 var EMPTY_OBJECT = Object.freeze({});
174
175 // node_modules/@base-ui/react/internals/useRenderElement.mjs
176 var React4 = __toESM(require_react(), 1);
177
178 // node_modules/@base-ui/utils/useMergedRefs.mjs
179 function useMergedRefs(a, b, c, d) {
180 const forkRef = useRefWithInit(createForkRef).current;
181 if (didChange(forkRef, a, b, c, d)) {
182 update(forkRef, [a, b, c, d]);
183 }
184 return forkRef.callback;
185 }
186 function useMergedRefsN(refs) {
187 const forkRef = useRefWithInit(createForkRef).current;
188 if (didChangeN(forkRef, refs)) {
189 update(forkRef, refs);
190 }
191 return forkRef.callback;
192 }
193 function createForkRef() {
194 return {
195 callback: null,
196 cleanup: null,
197 refs: []
198 };
199 }
200 function didChange(forkRef, a, b, c, d) {
201 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
202 }
203 function didChangeN(forkRef, newRefs) {
204 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
205 }
206 function update(forkRef, refs) {
207 forkRef.refs = refs;
208 if (refs.every((ref) => ref == null)) {
209 forkRef.callback = null;
210 return;
211 }
212 forkRef.callback = (instance) => {
213 if (forkRef.cleanup) {
214 forkRef.cleanup();
215 forkRef.cleanup = null;
216 }
217 if (instance != null) {
218 const cleanupCallbacks = Array(refs.length).fill(null);
219 for (let i = 0; i < refs.length; i += 1) {
220 const ref = refs[i];
221 if (ref == null) {
222 continue;
223 }
224 switch (typeof ref) {
225 case "function": {
226 const refCleanup = ref(instance);
227 if (typeof refCleanup === "function") {
228 cleanupCallbacks[i] = refCleanup;
229 }
230 break;
231 }
232 case "object": {
233 ref.current = instance;
234 break;
235 }
236 default:
237 }
238 }
239 forkRef.cleanup = () => {
240 for (let i = 0; i < refs.length; i += 1) {
241 const ref = refs[i];
242 if (ref == null) {
243 continue;
244 }
245 switch (typeof ref) {
246 case "function": {
247 const cleanupCallback = cleanupCallbacks[i];
248 if (typeof cleanupCallback === "function") {
249 cleanupCallback();
250 } else {
251 void ref(null);
252 }
253 break;
254 }
255 case "object": {
256 ref.current = null;
257 break;
258 }
259 default:
260 }
261 }
262 };
263 }
264 };
265 }
266
267 // node_modules/@base-ui/utils/getReactElementRef.mjs
268 var React3 = __toESM(require_react(), 1);
269
270 // node_modules/@base-ui/utils/reactVersion.mjs
271 var React2 = __toESM(require_react(), 1);
272 var majorVersion = parseInt(React2.version, 10);
273 function isReactVersionAtLeast(reactVersionToCheck) {
274 return majorVersion >= reactVersionToCheck;
275 }
276
277 // node_modules/@base-ui/utils/getReactElementRef.mjs
278 function getReactElementRef(element) {
279 if (!/* @__PURE__ */ React3.isValidElement(element)) {
280 return null;
281 }
282 const reactElement = element;
283 const propsWithRef = reactElement.props;
284 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
285 }
286
287 // node_modules/@base-ui/utils/mergeObjects.mjs
288 function mergeObjects(a, b) {
289 if (a && !b) {
290 return a;
291 }
292 if (!a && b) {
293 return b;
294 }
295 if (a || b) {
296 return {
297 ...a,
298 ...b
299 };
300 }
301 return void 0;
302 }
303
304 // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
305 function getStateAttributesProps(state, customMapping) {
306 const props = {};
307 for (const key in state) {
308 const value = state[key];
309 if (customMapping?.hasOwnProperty(key)) {
310 const customProps = customMapping[key](value);
311 if (customProps != null) {
312 Object.assign(props, customProps);
313 }
314 continue;
315 }
316 if (value === true) {
317 props[`data-${key.toLowerCase()}`] = "";
318 } else if (value) {
319 props[`data-${key.toLowerCase()}`] = value.toString();
320 }
321 }
322 return props;
323 }
324
325 // node_modules/@base-ui/react/utils/resolveClassName.mjs
326 function resolveClassName(className, state) {
327 return typeof className === "function" ? className(state) : className;
328 }
329
330 // node_modules/@base-ui/react/utils/resolveStyle.mjs
331 function resolveStyle(style, state) {
332 return typeof style === "function" ? style(state) : style;
333 }
334
335 // node_modules/@base-ui/react/merge-props/mergeProps.mjs
336 var EMPTY_PROPS = {};
337 function mergeProps(a, b, c, d, e) {
338 if (!c && !d && !e && !a) {
339 return createInitialMergedProps(b);
340 }
341 let merged = createInitialMergedProps(a);
342 if (b) {
343 merged = mergeInto(merged, b);
344 }
345 if (c) {
346 merged = mergeInto(merged, c);
347 }
348 if (d) {
349 merged = mergeInto(merged, d);
350 }
351 if (e) {
352 merged = mergeInto(merged, e);
353 }
354 return merged;
355 }
356 function mergePropsN(props) {
357 if (props.length === 0) {
358 return EMPTY_PROPS;
359 }
360 if (props.length === 1) {
361 return createInitialMergedProps(props[0]);
362 }
363 let merged = createInitialMergedProps(props[0]);
364 for (let i = 1; i < props.length; i += 1) {
365 merged = mergeInto(merged, props[i]);
366 }
367 return merged;
368 }
369 function createInitialMergedProps(inputProps) {
370 if (isPropsGetter(inputProps)) {
371 return {
372 ...resolvePropsGetter(inputProps, EMPTY_PROPS)
373 };
374 }
375 return copyInitialProps(inputProps);
376 }
377 function mergeInto(merged, inputProps) {
378 if (isPropsGetter(inputProps)) {
379 return resolvePropsGetter(inputProps, merged);
380 }
381 return mutablyMergeInto(merged, inputProps);
382 }
383 function copyInitialProps(inputProps) {
384 const copiedProps = {
385 ...inputProps
386 };
387 for (const propName in copiedProps) {
388 const propValue = copiedProps[propName];
389 if (isEventHandler(propName, propValue)) {
390 copiedProps[propName] = wrapEventHandler(propValue);
391 }
392 }
393 return copiedProps;
394 }
395 function mutablyMergeInto(mergedProps, externalProps) {
396 if (!externalProps) {
397 return mergedProps;
398 }
399 for (const propName in externalProps) {
400 const externalPropValue = externalProps[propName];
401 switch (propName) {
402 case "style": {
403 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
404 break;
405 }
406 case "className": {
407 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
408 break;
409 }
410 default: {
411 if (isEventHandler(propName, externalPropValue)) {
412 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
413 } else {
414 mergedProps[propName] = externalPropValue;
415 }
416 }
417 }
418 }
419 return mergedProps;
420 }
421 function isEventHandler(key, value) {
422 const code0 = key.charCodeAt(0);
423 const code1 = key.charCodeAt(1);
424 const code2 = key.charCodeAt(2);
425 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
426 }
427 function isPropsGetter(inputProps) {
428 return typeof inputProps === "function";
429 }
430 function resolvePropsGetter(inputProps, previousProps) {
431 if (isPropsGetter(inputProps)) {
432 return inputProps(previousProps);
433 }
434 return inputProps ?? EMPTY_PROPS;
435 }
436 function mergeEventHandlers(ourHandler, theirHandler) {
437 if (!theirHandler) {
438 return ourHandler;
439 }
440 if (!ourHandler) {
441 return wrapEventHandler(theirHandler);
442 }
443 return (...args) => {
444 const event = args[0];
445 if (isSyntheticEvent(event)) {
446 const baseUIEvent = event;
447 makeEventPreventable(baseUIEvent);
448 const result2 = theirHandler(...args);
449 if (!baseUIEvent.baseUIHandlerPrevented) {
450 ourHandler?.(...args);
451 }
452 return result2;
453 }
454 const result = theirHandler(...args);
455 ourHandler?.(...args);
456 return result;
457 };
458 }
459 function wrapEventHandler(handler) {
460 if (!handler) {
461 return handler;
462 }
463 return (...args) => {
464 const event = args[0];
465 if (isSyntheticEvent(event)) {
466 makeEventPreventable(event);
467 }
468 return handler(...args);
469 };
470 }
471 function makeEventPreventable(event) {
472 event.preventBaseUIHandler = () => {
473 event.baseUIHandlerPrevented = true;
474 };
475 return event;
476 }
477 function mergeClassNames(ourClassName, theirClassName) {
478 if (theirClassName) {
479 if (ourClassName) {
480 return theirClassName + " " + ourClassName;
481 }
482 return theirClassName;
483 }
484 return ourClassName;
485 }
486 function isSyntheticEvent(event) {
487 return event != null && typeof event === "object" && "nativeEvent" in event;
488 }
489
490 // node_modules/@base-ui/react/internals/useRenderElement.mjs
491 var import_react = __toESM(require_react(), 1);
492 function useRenderElement(element, componentProps, params = {}) {
493 let renderProp = componentProps.render;
494 if (params.enabled !== false) {
495 renderProp = unwrapLazyRenderProp(renderProp);
496 }
497 const outProps = useRenderElementProps(componentProps, params, renderProp);
498 if (params.enabled === false) {
499 return null;
500 }
501 const state = params.state ?? EMPTY_OBJECT;
502 return evaluateRenderProp(element, renderProp, outProps, state);
503 }
504 function useRenderElementProps(componentProps, params, renderProp) {
505 const {
506 className: classNameProp,
507 style: styleProp
508 } = componentProps;
509 const {
510 state = EMPTY_OBJECT,
511 ref,
512 props,
513 stateAttributesMapping,
514 enabled = true
515 } = params;
516 const className = enabled ? resolveClassName(classNameProp, state) : void 0;
517 const style = enabled ? resolveStyle(styleProp, state) : void 0;
518 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;
519 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
520 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
521 if (typeof document !== "undefined") {
522 if (!enabled) {
523 void useMergedRefs(null, null);
524 } else if (Array.isArray(ref)) {
525 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
526 } else {
527 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
528 }
529 }
530 if (!enabled) {
531 return EMPTY_OBJECT;
532 }
533 if (className !== void 0) {
534 outProps.className = mergeClassNames(outProps.className, className);
535 }
536 if (style !== void 0) {
537 outProps.style = mergeObjects(outProps.style, style);
538 }
539 return outProps;
540 }
541 function resolveRenderFunctionProps(props) {
542 if (Array.isArray(props)) {
543 return mergePropsN(props);
544 }
545 return mergeProps(void 0, props);
546 }
547 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
548 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
549 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
550 function unwrapLazyRenderProp(render) {
551 if (render?.$$typeof !== REACT_LAZY_TYPE) {
552 return render;
553 }
554 const unwrapped = React4.Children.toArray(render)[0];
555 return /* @__PURE__ */ React4.isValidElement(unwrapped) ? unwrapped : render;
556 }
557 function evaluateRenderProp(element, render, props, state) {
558 if (render) {
559 if (typeof render === "function") {
560 if (true) {
561 warnIfRenderPropLooksLikeComponent(render);
562 }
563 return render(props, state);
564 }
565 const mergedProps = mergeProps(props, render.props);
566 mergedProps.ref = props.ref;
567 if (true) {
568 if (!/* @__PURE__ */ React4.isValidElement(render)) {
569 throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n"));
570 }
571 }
572 return /* @__PURE__ */ React4.cloneElement(render, mergedProps);
573 }
574 if (element) {
575 if (typeof element === "string") {
576 return renderTag(element, props);
577 }
578 }
579 throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8));
580 }
581 function warnIfRenderPropLooksLikeComponent(renderFn) {
582 const functionName = renderFn.name;
583 if (functionName.length === 0) {
584 return;
585 }
586 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {
587 return;
588 }
589 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {
590 return;
591 }
592 warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
593 }
594 function renderTag(Tag, props) {
595 if (Tag === "button") {
596 return /* @__PURE__ */ (0, import_react.createElement)("button", {
597 type: "button",
598 ...props,
599 key: props.key
600 });
601 }
602 if (Tag === "img") {
603 return /* @__PURE__ */ (0, import_react.createElement)("img", {
604 alt: "",
605 ...props,
606 key: props.key
607 });
608 }
609 return /* @__PURE__ */ React4.createElement(Tag, props);
610 }
611
612 // node_modules/@base-ui/react/use-render/useRender.mjs
613 function useRender(params) {
614 return useRenderElement(params.defaultTagName ?? "div", params, params);
615 }
616
617 // packages/ui/build-module/text/text.mjs
618 var import_element = __toESM(require_element(), 1);
619 var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
620 function getRuntime() {
621 const globalScope = globalThis;
622 if (globalScope.__wpStyleRuntime) {
623 return globalScope.__wpStyleRuntime;
624 }
625 globalScope.__wpStyleRuntime = {
626 documents: /* @__PURE__ */ new Map(),
627 styles: /* @__PURE__ */ new Map(),
628 injectedStyles: /* @__PURE__ */ new WeakMap()
629 };
630 if (typeof document !== "undefined") {
631 registerDocument(document);
632 }
633 return globalScope.__wpStyleRuntime;
634 }
635 function documentContainsStyleHash(targetDocument, hash) {
636 if (!targetDocument.head) {
637 return false;
638 }
639 for (const style of targetDocument.head.querySelectorAll(
640 `style[${STYLE_HASH_ATTRIBUTE}]`
641 )) {
642 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
643 return true;
644 }
645 }
646 return false;
647 }
648 function injectStyle(targetDocument, hash, css) {
649 if (!targetDocument.head) {
650 return;
651 }
652 const runtime = getRuntime();
653 let injectedStyles = runtime.injectedStyles.get(targetDocument);
654 if (!injectedStyles) {
655 injectedStyles = /* @__PURE__ */ new Set();
656 runtime.injectedStyles.set(targetDocument, injectedStyles);
657 }
658 if (injectedStyles.has(hash)) {
659 return;
660 }
661 if (documentContainsStyleHash(targetDocument, hash)) {
662 injectedStyles.add(hash);
663 return;
664 }
665 const style = targetDocument.createElement("style");
666 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
667 style.appendChild(targetDocument.createTextNode(css));
668 targetDocument.head.appendChild(style);
669 injectedStyles.add(hash);
670 }
671 function registerDocument(targetDocument) {
672 const runtime = getRuntime();
673 runtime.documents.set(
674 targetDocument,
675 (runtime.documents.get(targetDocument) ?? 0) + 1
676 );
677 for (const [hash, css] of runtime.styles) {
678 injectStyle(targetDocument, hash, css);
679 }
680 return () => {
681 const count = runtime.documents.get(targetDocument);
682 if (count === void 0) {
683 return;
684 }
685 if (count <= 1) {
686 runtime.documents.delete(targetDocument);
687 return;
688 }
689 runtime.documents.set(targetDocument, count - 1);
690 };
691 }
692 function registerStyle(hash, css) {
693 const runtime = getRuntime();
694 runtime.styles.set(hash, css);
695 for (const targetDocument of runtime.documents.keys()) {
696 injectStyle(targetDocument, hash, css);
697 }
698 }
699 if (typeof process === "undefined" || true) {
700 registerStyle("3167e7d116", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{text-wrap:pretty;margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
701 }
702 var style_default = { "text": "_83ed8a8da5dd50ea__text", "heading-2xl": "_14437cfb77831647__heading-2xl", "heading-xl": "_3c78b7fa9b4072dd__heading-xl", "heading-lg": "aa58f227716bcde2__heading-lg", "heading-md": "fc4da56d8dfe52c4__heading-md", "heading-sm": "a9b78c7c82e8dff7__heading-sm", "body-xl": "_305ff559e52180d5__body-xl", "body-lg": "ca1aa3fc2029e958__body-lg", "body-md": "_131101940be12424__body-md", "body-sm": "_0e8d87a42c1f75fa__body-sm" };
703 if (typeof process === "undefined" || true) {
704 registerStyle("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
705 }
706 var global_css_defense_default = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
707 var Text = (0, import_element.forwardRef)(function Text2({ variant = "body-md", render, className, ...props }, ref) {
708 const element = useRender({
709 render,
710 defaultTagName: "span",
711 ref,
712 props: mergeProps(props, {
713 className: clsx_default(
714 style_default.text,
715 global_css_defense_default.heading,
716 global_css_defense_default.p,
717 style_default[variant],
718 className
719 )
720 })
721 });
722 return element;
723 });
724
725 // packages/ui/build-module/link/link.mjs
726 var import_element2 = __toESM(require_element(), 1);
727 var import_i18n = __toESM(require_i18n(), 1);
728 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
729 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
730 function getRuntime2() {
731 const globalScope = globalThis;
732 if (globalScope.__wpStyleRuntime) {
733 return globalScope.__wpStyleRuntime;
734 }
735 globalScope.__wpStyleRuntime = {
736 documents: /* @__PURE__ */ new Map(),
737 styles: /* @__PURE__ */ new Map(),
738 injectedStyles: /* @__PURE__ */ new WeakMap()
739 };
740 if (typeof document !== "undefined") {
741 registerDocument2(document);
742 }
743 return globalScope.__wpStyleRuntime;
744 }
745 function documentContainsStyleHash2(targetDocument, hash) {
746 if (!targetDocument.head) {
747 return false;
748 }
749 for (const style of targetDocument.head.querySelectorAll(
750 `style[${STYLE_HASH_ATTRIBUTE2}]`
751 )) {
752 if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) {
753 return true;
754 }
755 }
756 return false;
757 }
758 function injectStyle2(targetDocument, hash, css) {
759 if (!targetDocument.head) {
760 return;
761 }
762 const runtime = getRuntime2();
763 let injectedStyles = runtime.injectedStyles.get(targetDocument);
764 if (!injectedStyles) {
765 injectedStyles = /* @__PURE__ */ new Set();
766 runtime.injectedStyles.set(targetDocument, injectedStyles);
767 }
768 if (injectedStyles.has(hash)) {
769 return;
770 }
771 if (documentContainsStyleHash2(targetDocument, hash)) {
772 injectedStyles.add(hash);
773 return;
774 }
775 const style = targetDocument.createElement("style");
776 style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash);
777 style.appendChild(targetDocument.createTextNode(css));
778 targetDocument.head.appendChild(style);
779 injectedStyles.add(hash);
780 }
781 function registerDocument2(targetDocument) {
782 const runtime = getRuntime2();
783 runtime.documents.set(
784 targetDocument,
785 (runtime.documents.get(targetDocument) ?? 0) + 1
786 );
787 for (const [hash, css] of runtime.styles) {
788 injectStyle2(targetDocument, hash, css);
789 }
790 return () => {
791 const count = runtime.documents.get(targetDocument);
792 if (count === void 0) {
793 return;
794 }
795 if (count <= 1) {
796 runtime.documents.delete(targetDocument);
797 return;
798 }
799 runtime.documents.set(targetDocument, count - 1);
800 };
801 }
802 function registerStyle2(hash, css) {
803 const runtime = getRuntime2();
804 runtime.styles.set(hash, css);
805 for (const targetDocument of runtime.documents.keys()) {
806 injectStyle2(targetDocument, hash, css);
807 }
808 }
809 if (typeof process === "undefined" || true) {
810 registerStyle2("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
811 }
812 var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
813 if (typeof process === "undefined" || true) {
814 registerStyle2("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
815 }
816 var focus_module_default = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
817 if (typeof process === "undefined" || true) {
818 registerStyle2("e8e6a9be37", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d4250949359b05ce__link{text-decoration-thickness:from-font;text-underline-offset:.2em}.c6055659b8e2cd2c__is-brand,.c6055659b8e2cd2c__is-brand:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.c6055659b8e2cd2c__is-brand:active,.c6055659b8e2cd2c__is-brand:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._92e0dfcaeee15b88__is-neutral,._92e0dfcaeee15b88__is-neutral:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d)}._92e0dfcaeee15b88__is-neutral:active,._92e0dfcaeee15b88__is-neutral:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}.cf122a9bf1035d42__is-unstyled{--_gcd-a-color:inherit;color:inherit;text-decoration:none}._0cb411afac4c86c7__link-icon{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-padding-xs,4px);text-decoration:none}._0cb411afac4c86c7__link-icon:after{content:"\\2197"}._0cb411afac4c86c7__link-icon:dir(rtl):after{content:"\\2196"}}}');
819 }
820 var style_default2 = { "link": "d4250949359b05ce__link", "is-brand": "c6055659b8e2cd2c__is-brand", "is-neutral": "_92e0dfcaeee15b88__is-neutral", "is-unstyled": "cf122a9bf1035d42__is-unstyled", "link-icon": "_0cb411afac4c86c7__link-icon" };
821 if (typeof process === "undefined" || true) {
822 registerStyle2("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
823 }
824 var global_css_defense_default2 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
825 var Link = (0, import_element2.forwardRef)(function Link2({
826 children,
827 variant = "default",
828 tone = "brand",
829 openInNewTab = false,
830 target,
831 render,
832 className,
833 ...props
834 }, ref) {
835 const shouldShowNewTabIndicator = openInNewTab || /^_blank$/i.test(target ?? "");
836 const element = useRender({
837 render,
838 defaultTagName: "a",
839 ref,
840 props: mergeProps(props, {
841 className: clsx_default(
842 global_css_defense_default2.a,
843 resets_default["box-sizing"],
844 focus_module_default["outset-ring--focus-except-active"],
845 variant !== "unstyled" && style_default2.link,
846 variant !== "unstyled" && style_default2[`is-${tone}`],
847 variant === "unstyled" && style_default2["is-unstyled"],
848 className
849 ),
850 target: target ?? (openInNewTab ? "_blank" : void 0),
851 children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
852 children,
853 shouldShowNewTabIndicator && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
854 "span",
855 {
856 className: style_default2["link-icon"],
857 role: "img",
858 "aria-label": (
859 /* translators: accessibility text appended to link text */
860 (0, import_i18n.__)("(opens in a new tab)")
861 )
862 }
863 )
864 ] })
865 })
866 });
867 return element;
868 });
869
870 // packages/icons/build-module/library/chevron-down.mjs
871 var import_primitives = __toESM(require_primitives(), 1);
872 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
873 var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.Path, { d: "M7 11L12 15L17 11", vectorEffect: "non-scaling-stroke" }) });
874
875 // packages/icons/build-module/library/chevron-up.mjs
876 var import_primitives2 = __toESM(require_primitives(), 1);
877 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
878 var chevron_up_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.Path, { d: "M7 13L12 9L17 13", vectorEffect: "non-scaling-stroke" }) });
879
880 // packages/icons/build-module/library/more-vertical.mjs
881 var import_primitives3 = __toESM(require_primitives(), 1);
882 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
883 var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
884 /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.Path, { d: "M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z", fill: "currentColor", stroke: "none" }),
885 /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.Path, { d: "M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z", fill: "currentColor", stroke: "none" }),
886 /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.Path, { d: "M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z", fill: "currentColor", stroke: "none" }),
887 /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.Path, { d: "M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z", vectorEffect: "non-scaling-stroke" }),
888 /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.Path, { d: "M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z", vectorEffect: "non-scaling-stroke" }),
889 /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.Path, { d: "M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z", vectorEffect: "non-scaling-stroke" })
890 ] });
891
892 // packages/ui/build-module/stack/stack.mjs
893 var import_element3 = __toESM(require_element(), 1);
894 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
895 function getRuntime3() {
896 const globalScope = globalThis;
897 if (globalScope.__wpStyleRuntime) {
898 return globalScope.__wpStyleRuntime;
899 }
900 globalScope.__wpStyleRuntime = {
901 documents: /* @__PURE__ */ new Map(),
902 styles: /* @__PURE__ */ new Map(),
903 injectedStyles: /* @__PURE__ */ new WeakMap()
904 };
905 if (typeof document !== "undefined") {
906 registerDocument3(document);
907 }
908 return globalScope.__wpStyleRuntime;
909 }
910 function documentContainsStyleHash3(targetDocument, hash) {
911 if (!targetDocument.head) {
912 return false;
913 }
914 for (const style of targetDocument.head.querySelectorAll(
915 `style[${STYLE_HASH_ATTRIBUTE3}]`
916 )) {
917 if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
918 return true;
919 }
920 }
921 return false;
922 }
923 function injectStyle3(targetDocument, hash, css) {
924 if (!targetDocument.head) {
925 return;
926 }
927 const runtime = getRuntime3();
928 let injectedStyles = runtime.injectedStyles.get(targetDocument);
929 if (!injectedStyles) {
930 injectedStyles = /* @__PURE__ */ new Set();
931 runtime.injectedStyles.set(targetDocument, injectedStyles);
932 }
933 if (injectedStyles.has(hash)) {
934 return;
935 }
936 if (documentContainsStyleHash3(targetDocument, hash)) {
937 injectedStyles.add(hash);
938 return;
939 }
940 const style = targetDocument.createElement("style");
941 style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
942 style.appendChild(targetDocument.createTextNode(css));
943 targetDocument.head.appendChild(style);
944 injectedStyles.add(hash);
945 }
946 function registerDocument3(targetDocument) {
947 const runtime = getRuntime3();
948 runtime.documents.set(
949 targetDocument,
950 (runtime.documents.get(targetDocument) ?? 0) + 1
951 );
952 for (const [hash, css] of runtime.styles) {
953 injectStyle3(targetDocument, hash, css);
954 }
955 return () => {
956 const count = runtime.documents.get(targetDocument);
957 if (count === void 0) {
958 return;
959 }
960 if (count <= 1) {
961 runtime.documents.delete(targetDocument);
962 return;
963 }
964 runtime.documents.set(targetDocument, count - 1);
965 };
966 }
967 function registerStyle3(hash, css) {
968 const runtime = getRuntime3();
969 runtime.styles.set(hash, css);
970 for (const targetDocument of runtime.documents.keys()) {
971 injectStyle3(targetDocument, hash, css);
972 }
973 }
974 if (typeof process === "undefined" || true) {
975 registerStyle3("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
976 }
977 var style_default3 = { "stack": "_19ce0419607e1896__stack" };
978 var gapTokens = {
979 xs: "var(--wpds-dimension-gap-xs, 4px)",
980 sm: "var(--wpds-dimension-gap-sm, 8px)",
981 md: "var(--wpds-dimension-gap-md, 12px)",
982 lg: "var(--wpds-dimension-gap-lg, 16px)",
983 xl: "var(--wpds-dimension-gap-xl, 24px)",
984 "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
985 "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
986 };
987 var Stack = (0, import_element3.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
988 const style = {
989 gap: gap && gapTokens[gap],
990 alignItems: align,
991 justifyContent: justify,
992 flexDirection: direction,
993 flexWrap: wrap
994 };
995 const element = useRender({
996 render,
997 ref,
998 props: mergeProps(props, { style, className: style_default3.stack })
999 });
1000 return element;
1001 });
1002
1003 // packages/admin-ui/build-module/breadcrumbs/index.mjs
1004 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
1005 var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
1006 function getRuntime4() {
1007 const globalScope = globalThis;
1008 if (globalScope.__wpStyleRuntime) {
1009 return globalScope.__wpStyleRuntime;
1010 }
1011 globalScope.__wpStyleRuntime = {
1012 documents: /* @__PURE__ */ new Map(),
1013 styles: /* @__PURE__ */ new Map(),
1014 injectedStyles: /* @__PURE__ */ new WeakMap()
1015 };
1016 if (typeof document !== "undefined") {
1017 registerDocument4(document);
1018 }
1019 return globalScope.__wpStyleRuntime;
1020 }
1021 function documentContainsStyleHash4(targetDocument, hash) {
1022 if (!targetDocument.head) {
1023 return false;
1024 }
1025 for (const style of targetDocument.head.querySelectorAll(
1026 `style[${STYLE_HASH_ATTRIBUTE4}]`
1027 )) {
1028 if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
1029 return true;
1030 }
1031 }
1032 return false;
1033 }
1034 function injectStyle4(targetDocument, hash, css) {
1035 if (!targetDocument.head) {
1036 return;
1037 }
1038 const runtime = getRuntime4();
1039 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1040 if (!injectedStyles) {
1041 injectedStyles = /* @__PURE__ */ new Set();
1042 runtime.injectedStyles.set(targetDocument, injectedStyles);
1043 }
1044 if (injectedStyles.has(hash)) {
1045 return;
1046 }
1047 if (documentContainsStyleHash4(targetDocument, hash)) {
1048 injectedStyles.add(hash);
1049 return;
1050 }
1051 const style = targetDocument.createElement("style");
1052 style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
1053 style.appendChild(targetDocument.createTextNode(css));
1054 targetDocument.head.appendChild(style);
1055 injectedStyles.add(hash);
1056 }
1057 function registerDocument4(targetDocument) {
1058 const runtime = getRuntime4();
1059 runtime.documents.set(
1060 targetDocument,
1061 (runtime.documents.get(targetDocument) ?? 0) + 1
1062 );
1063 for (const [hash, css] of runtime.styles) {
1064 injectStyle4(targetDocument, hash, css);
1065 }
1066 return () => {
1067 const count = runtime.documents.get(targetDocument);
1068 if (count === void 0) {
1069 return;
1070 }
1071 if (count <= 1) {
1072 runtime.documents.delete(targetDocument);
1073 return;
1074 }
1075 runtime.documents.set(targetDocument, count - 1);
1076 };
1077 }
1078 function registerStyle4(hash, css) {
1079 const runtime = getRuntime4();
1080 runtime.styles.set(hash, css);
1081 for (const targetDocument of runtime.documents.keys()) {
1082 injectStyle4(targetDocument, hash, css);
1083 }
1084 }
1085 if (typeof process === "undefined" || true) {
1086 registerStyle4("a90be4572a", "._5f4053eba32ce092__list{list-style:none;margin:0;padding:0}._5f4053eba32ce092__list>li{flex-shrink:0;margin:0}._5f4053eba32ce092__list>li:last-child{flex-shrink:1;min-width:0}.d1978551971a3360__current{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._6d9152063d443376__separator{color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);margin:0 var(--wpds-dimension-gap-sm,8px);user-select:none}");
1087 }
1088 var style_default4 = { "list": "_5f4053eba32ce092__list", "current": "d1978551971a3360__current", "separator": "_6d9152063d443376__separator" };
1089 var Breadcrumbs = ({ items }) => {
1090 if (!items.length) {
1091 return null;
1092 }
1093 const precedingItems = items.slice(0, -1);
1094 const lastItem = items[items.length - 1];
1095 if (true) {
1096 const invalidItem = precedingItems.find((item) => !item.to);
1097 if (invalidItem) {
1098 throw new Error(
1099 `Breadcrumbs: item "${invalidItem.label}" is missing a \`to\` prop. All items except the last one must have a \`to\` prop.`
1100 );
1101 }
1102 }
1103 return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("nav", { "aria-label": (0, import_i18n2._x)("Breadcrumbs", "area label"), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1104 Stack,
1105 {
1106 render: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", {}),
1107 direction: "row",
1108 align: "center",
1109 className: style_default4.list,
1110 children: [
1111 precedingItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("li", { children: [
1112 /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1113 Text,
1114 {
1115 variant: "body-lg",
1116 render: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1117 Link,
1118 {
1119 tone: "neutral",
1120 render: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RouterLink, { to: item.to })
1121 }
1122 ),
1123 children: item.label
1124 }
1125 ),
1126 /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1127 Text,
1128 {
1129 variant: "body-lg",
1130 "aria-hidden": "true",
1131 className: style_default4.separator,
1132 children: "/"
1133 }
1134 )
1135 ] }, index)),
1136 /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: lastItem.to ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1137 Text,
1138 {
1139 variant: "body-lg",
1140 render: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1141 Link,
1142 {
1143 tone: "neutral",
1144 render: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RouterLink, { to: lastItem.to })
1145 }
1146 ),
1147 children: lastItem.label
1148 }
1149 ) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1150 Text,
1151 {
1152 variant: "heading-lg",
1153 render: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", {}),
1154 className: style_default4.current,
1155 children: lastItem.label
1156 }
1157 ) })
1158 ]
1159 }
1160 ) });
1161 };
1162 var breadcrumbs_default = Breadcrumbs;
1163
1164 // packages/admin-ui/build-module/navigable-region/index.mjs
1165 var import_element4 = __toESM(require_element(), 1);
1166 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
1167 var NavigableRegion = (0, import_element4.forwardRef)(
1168 ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => {
1169 return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1170 Tag,
1171 {
1172 ref,
1173 className: clsx_default("admin-ui-navigable-region", className),
1174 "aria-label": ariaLabel,
1175 role: "region",
1176 tabIndex: "-1",
1177 ...props,
1178 children
1179 }
1180 );
1181 }
1182 );
1183 NavigableRegion.displayName = "NavigableRegion";
1184 var navigable_region_default = NavigableRegion;
1185
1186 // packages/admin-ui/build-module/navigation/index.mjs
1187 var import_i18n3 = __toESM(require_i18n(), 1);
1188 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
1189 var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash";
1190 function getRuntime5() {
1191 const globalScope = globalThis;
1192 if (globalScope.__wpStyleRuntime) {
1193 return globalScope.__wpStyleRuntime;
1194 }
1195 globalScope.__wpStyleRuntime = {
1196 documents: /* @__PURE__ */ new Map(),
1197 styles: /* @__PURE__ */ new Map(),
1198 injectedStyles: /* @__PURE__ */ new WeakMap()
1199 };
1200 if (typeof document !== "undefined") {
1201 registerDocument5(document);
1202 }
1203 return globalScope.__wpStyleRuntime;
1204 }
1205 function documentContainsStyleHash5(targetDocument, hash) {
1206 if (!targetDocument.head) {
1207 return false;
1208 }
1209 for (const style of targetDocument.head.querySelectorAll(
1210 `style[${STYLE_HASH_ATTRIBUTE5}]`
1211 )) {
1212 if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) {
1213 return true;
1214 }
1215 }
1216 return false;
1217 }
1218 function injectStyle5(targetDocument, hash, css) {
1219 if (!targetDocument.head) {
1220 return;
1221 }
1222 const runtime = getRuntime5();
1223 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1224 if (!injectedStyles) {
1225 injectedStyles = /* @__PURE__ */ new Set();
1226 runtime.injectedStyles.set(targetDocument, injectedStyles);
1227 }
1228 if (injectedStyles.has(hash)) {
1229 return;
1230 }
1231 if (documentContainsStyleHash5(targetDocument, hash)) {
1232 injectedStyles.add(hash);
1233 return;
1234 }
1235 const style = targetDocument.createElement("style");
1236 style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash);
1237 style.appendChild(targetDocument.createTextNode(css));
1238 targetDocument.head.appendChild(style);
1239 injectedStyles.add(hash);
1240 }
1241 function registerDocument5(targetDocument) {
1242 const runtime = getRuntime5();
1243 runtime.documents.set(
1244 targetDocument,
1245 (runtime.documents.get(targetDocument) ?? 0) + 1
1246 );
1247 for (const [hash, css] of runtime.styles) {
1248 injectStyle5(targetDocument, hash, css);
1249 }
1250 return () => {
1251 const count = runtime.documents.get(targetDocument);
1252 if (count === void 0) {
1253 return;
1254 }
1255 if (count <= 1) {
1256 runtime.documents.delete(targetDocument);
1257 return;
1258 }
1259 runtime.documents.set(targetDocument, count - 1);
1260 };
1261 }
1262 function registerStyle5(hash, css) {
1263 const runtime = getRuntime5();
1264 runtime.styles.set(hash, css);
1265 for (const targetDocument of runtime.documents.keys()) {
1266 injectStyle5(targetDocument, hash, css);
1267 }
1268 }
1269 if (typeof process === "undefined" || true) {
1270 registerStyle5("72ef022400", ".bfb5a2dd8cceebd3__list{--focus-ring-size:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*2);list-style:none;margin:calc(var(--focus-ring-size)*-1);overflow-x:auto;padding:var(--focus-ring-size);scroll-padding:var(--focus-ring-size)}.a4759b4cb2c8bd92__li{flex-shrink:0}._07da506d3f2d9afe__item{align-items:center;color:var(--wpds-color-foreground-interactive-neutral-weak,#707070);display:flex;font-weight:var(--wpds-typography-font-weight-default,400);min-block-size:44px;min-inline-size:44px;text-decoration:none}._07da506d3f2d9afe__item:hover,._07da506d3f2d9afe__item[aria-current=page]{color:var(--wpds-color-foreground-interactive-neutral-weak-active,#1e1e1e)}._07da506d3f2d9afe__item[aria-current=page]{font-weight:var(--wpds-typography-font-weight-emphasis,600)}");
1271 }
1272 var style_default5 = { "list": "bfb5a2dd8cceebd3__list", "li": "a4759b4cb2c8bd92__li", "item": "_07da506d3f2d9afe__item" };
1273 var Navigation = ({
1274 items,
1275 currentHref,
1276 ariaLabel = (0, import_i18n3.__)("Sections"),
1277 linkComponent,
1278 className
1279 }) => {
1280 if (!items.length) {
1281 return null;
1282 }
1283 const LinkComponent = linkComponent ?? "a";
1284 if (true) {
1285 const invalidItem = items.find(
1286 (item) => typeof item.href !== "string"
1287 );
1288 if (invalidItem) {
1289 throw new Error(
1290 `Navigation: item "${invalidItem.label}" is missing an \`href\` prop.`
1291 );
1292 }
1293 const duplicate = items.find(
1294 (item, index) => items.findIndex((other) => other.href === item.href) !== index
1295 );
1296 if (duplicate) {
1297 throw new Error(
1298 `Navigation: duplicate \`href\` "${duplicate.href}". Each item must have a unique \`href\` so a single item receives \`aria-current="page"\`.`
1299 );
1300 }
1301 }
1302 return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("nav", { "aria-label": ariaLabel, className, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1303 Stack,
1304 {
1305 render: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { role: "list" }),
1306 direction: "row",
1307 align: "center",
1308 gap: "md",
1309 className: style_default5.list,
1310 children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { className: style_default5.li, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1311 Text,
1312 {
1313 variant: "body-md",
1314 className: style_default5.item,
1315 render: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1316 Link,
1317 {
1318 variant: "unstyled",
1319 "aria-current": item.href === currentHref ? "page" : void 0,
1320 render: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(LinkComponent, { href: item.href })
1321 }
1322 ),
1323 children: item.label
1324 }
1325 ) }, item.href))
1326 }
1327 ) });
1328 };
1329 var navigation_default = Navigation;
1330
1331 // packages/admin-ui/build-module/page/sidebar-toggle-slot.mjs
1332 var import_components = __toESM(require_components(), 1);
1333 var { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } = (0, import_components.createSlotFill)("SidebarToggle");
1334
1335 // packages/admin-ui/build-module/page/header.mjs
1336 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
1337 var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash";
1338 function getRuntime6() {
1339 const globalScope = globalThis;
1340 if (globalScope.__wpStyleRuntime) {
1341 return globalScope.__wpStyleRuntime;
1342 }
1343 globalScope.__wpStyleRuntime = {
1344 documents: /* @__PURE__ */ new Map(),
1345 styles: /* @__PURE__ */ new Map(),
1346 injectedStyles: /* @__PURE__ */ new WeakMap()
1347 };
1348 if (typeof document !== "undefined") {
1349 registerDocument6(document);
1350 }
1351 return globalScope.__wpStyleRuntime;
1352 }
1353 function documentContainsStyleHash6(targetDocument, hash) {
1354 if (!targetDocument.head) {
1355 return false;
1356 }
1357 for (const style of targetDocument.head.querySelectorAll(
1358 `style[${STYLE_HASH_ATTRIBUTE6}]`
1359 )) {
1360 if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) {
1361 return true;
1362 }
1363 }
1364 return false;
1365 }
1366 function injectStyle6(targetDocument, hash, css) {
1367 if (!targetDocument.head) {
1368 return;
1369 }
1370 const runtime = getRuntime6();
1371 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1372 if (!injectedStyles) {
1373 injectedStyles = /* @__PURE__ */ new Set();
1374 runtime.injectedStyles.set(targetDocument, injectedStyles);
1375 }
1376 if (injectedStyles.has(hash)) {
1377 return;
1378 }
1379 if (documentContainsStyleHash6(targetDocument, hash)) {
1380 injectedStyles.add(hash);
1381 return;
1382 }
1383 const style = targetDocument.createElement("style");
1384 style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash);
1385 style.appendChild(targetDocument.createTextNode(css));
1386 targetDocument.head.appendChild(style);
1387 injectedStyles.add(hash);
1388 }
1389 function registerDocument6(targetDocument) {
1390 const runtime = getRuntime6();
1391 runtime.documents.set(
1392 targetDocument,
1393 (runtime.documents.get(targetDocument) ?? 0) + 1
1394 );
1395 for (const [hash, css] of runtime.styles) {
1396 injectStyle6(targetDocument, hash, css);
1397 }
1398 return () => {
1399 const count = runtime.documents.get(targetDocument);
1400 if (count === void 0) {
1401 return;
1402 }
1403 if (count <= 1) {
1404 runtime.documents.delete(targetDocument);
1405 return;
1406 }
1407 runtime.documents.set(targetDocument, count - 1);
1408 };
1409 }
1410 function registerStyle6(hash, css) {
1411 const runtime = getRuntime6();
1412 runtime.styles.set(hash, css);
1413 for (const targetDocument of runtime.documents.keys()) {
1414 injectStyle6(targetDocument, hash, css);
1415 }
1416 }
1417 if (typeof process === "undefined" || true) {
1418 registerStyle6("1f3750277d", "._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-background-surface-neutral,#fcfcfc);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-background-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);inset-block-start:0;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px);position:sticky;z-index:1}.a43c44d5ae28b2e8__header-content{min-height:var(--wpds-dimension-size-md,32px)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8bcd33103b451f30__header-lockup{min-width:0}._8113be94e7caf73c__header-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9a776c7f70996f61__header-visual{display:grid;flex-shrink:0;grid-template-columns:1fr;grid-template-rows:1fr;height:var(--wpds-dimension-size-sm,24px);width:var(--wpds-dimension-size-sm,24px);>*{grid-column:1/-1;grid-row:1/-1;max-height:100%;max-width:100%}}.d5e0920cd15d35bc__sidebar-toggle-slot:empty{display:none}._60fea2f6bf5319cd__header-subtitle{color:var(--wpds-color-foreground-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}._0625b55e82a0d93d__header._4b0f17e503d11619__has-navigation,._0625b55e82a0d93d__header._4b0f17e503d11619__has-navigation ._60fea2f6bf5319cd__header-subtitle{padding-block-end:0}._673c99dcbfb58211__header-navigation{margin-block-start:var(--wpds-dimension-gap-md,12px)}.be5e57d029ec4036__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto;&._128806d0b26e3a50__has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}}");
1419 }
1420 var style_default6 = { "page": "_956b6df0898efed0__page", "header": "_0625b55e82a0d93d__header", "header-content": "a43c44d5ae28b2e8__header-content", "header-actions": "b7cb5b9daf3a3b25__header-actions", "header-lockup": "_8bcd33103b451f30__header-lockup", "header-title": "_8113be94e7caf73c__header-title", "header-visual": "_9a776c7f70996f61__header-visual", "sidebar-toggle-slot": "d5e0920cd15d35bc__sidebar-toggle-slot", "header-subtitle": "_60fea2f6bf5319cd__header-subtitle", "has-navigation": "_4b0f17e503d11619__has-navigation", "header-navigation": "_673c99dcbfb58211__header-navigation", "content": "be5e57d029ec4036__content", "has-padding": "_128806d0b26e3a50__has-padding" };
1421 function Header({
1422 headingLevel = 1,
1423 breadcrumbs,
1424 badges,
1425 visual,
1426 title,
1427 subTitle,
1428 actions,
1429 navigation,
1430 components,
1431 showSidebarToggle = true
1432 }) {
1433 const HeadingTag = `h${headingLevel}`;
1434 const hasNavigation = !!navigation?.items?.length;
1435 return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1436 Stack,
1437 {
1438 direction: "column",
1439 className: clsx_default(
1440 style_default6.header,
1441 hasNavigation && style_default6["has-navigation"]
1442 ),
1443 children: [
1444 /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1445 Stack,
1446 {
1447 className: style_default6["header-content"],
1448 direction: "row",
1449 gap: "sm",
1450 justify: "space-between",
1451 children: [
1452 /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1453 Stack,
1454 {
1455 direction: "row",
1456 gap: "sm",
1457 align: "center",
1458 justify: "start",
1459 className: style_default6["header-lockup"],
1460 children: [
1461 showSidebarToggle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1462 SidebarToggleSlot,
1463 {
1464 bubblesVirtually: true,
1465 className: style_default6["sidebar-toggle-slot"]
1466 }
1467 ),
1468 visual && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1469 "div",
1470 {
1471 className: style_default6["header-visual"],
1472 "aria-hidden": "true",
1473 children: visual
1474 }
1475 ),
1476 title && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1477 Text,
1478 {
1479 className: style_default6["header-title"],
1480 render: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(HeadingTag, {}),
1481 variant: "heading-lg",
1482 children: title
1483 }
1484 ),
1485 breadcrumbs,
1486 badges
1487 ]
1488 }
1489 ),
1490 actions && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1491 Stack,
1492 {
1493 align: "center",
1494 className: style_default6["header-actions"],
1495 direction: "row",
1496 gap: "sm",
1497 children: actions
1498 }
1499 )
1500 ]
1501 }
1502 ),
1503 subTitle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1504 Text,
1505 {
1506 render: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", {}),
1507 variant: "body-md",
1508 className: style_default6["header-subtitle"],
1509 children: subTitle
1510 }
1511 ),
1512 hasNavigation && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1513 navigation_default,
1514 {
1515 ...navigation,
1516 linkComponent: components?.link,
1517 className: style_default6["header-navigation"]
1518 }
1519 )
1520 ]
1521 }
1522 );
1523 }
1524
1525 // packages/admin-ui/build-module/page/index.mjs
1526 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
1527 var STYLE_HASH_ATTRIBUTE7 = "data-wp-hash";
1528 function getRuntime7() {
1529 const globalScope = globalThis;
1530 if (globalScope.__wpStyleRuntime) {
1531 return globalScope.__wpStyleRuntime;
1532 }
1533 globalScope.__wpStyleRuntime = {
1534 documents: /* @__PURE__ */ new Map(),
1535 styles: /* @__PURE__ */ new Map(),
1536 injectedStyles: /* @__PURE__ */ new WeakMap()
1537 };
1538 if (typeof document !== "undefined") {
1539 registerDocument7(document);
1540 }
1541 return globalScope.__wpStyleRuntime;
1542 }
1543 function documentContainsStyleHash7(targetDocument, hash) {
1544 if (!targetDocument.head) {
1545 return false;
1546 }
1547 for (const style of targetDocument.head.querySelectorAll(
1548 `style[${STYLE_HASH_ATTRIBUTE7}]`
1549 )) {
1550 if (style.getAttribute(STYLE_HASH_ATTRIBUTE7) === hash) {
1551 return true;
1552 }
1553 }
1554 return false;
1555 }
1556 function injectStyle7(targetDocument, hash, css) {
1557 if (!targetDocument.head) {
1558 return;
1559 }
1560 const runtime = getRuntime7();
1561 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1562 if (!injectedStyles) {
1563 injectedStyles = /* @__PURE__ */ new Set();
1564 runtime.injectedStyles.set(targetDocument, injectedStyles);
1565 }
1566 if (injectedStyles.has(hash)) {
1567 return;
1568 }
1569 if (documentContainsStyleHash7(targetDocument, hash)) {
1570 injectedStyles.add(hash);
1571 return;
1572 }
1573 const style = targetDocument.createElement("style");
1574 style.setAttribute(STYLE_HASH_ATTRIBUTE7, hash);
1575 style.appendChild(targetDocument.createTextNode(css));
1576 targetDocument.head.appendChild(style);
1577 injectedStyles.add(hash);
1578 }
1579 function registerDocument7(targetDocument) {
1580 const runtime = getRuntime7();
1581 runtime.documents.set(
1582 targetDocument,
1583 (runtime.documents.get(targetDocument) ?? 0) + 1
1584 );
1585 for (const [hash, css] of runtime.styles) {
1586 injectStyle7(targetDocument, hash, css);
1587 }
1588 return () => {
1589 const count = runtime.documents.get(targetDocument);
1590 if (count === void 0) {
1591 return;
1592 }
1593 if (count <= 1) {
1594 runtime.documents.delete(targetDocument);
1595 return;
1596 }
1597 runtime.documents.set(targetDocument, count - 1);
1598 };
1599 }
1600 function registerStyle7(hash, css) {
1601 const runtime = getRuntime7();
1602 runtime.styles.set(hash, css);
1603 for (const targetDocument of runtime.documents.keys()) {
1604 injectStyle7(targetDocument, hash, css);
1605 }
1606 }
1607 if (typeof process === "undefined" || true) {
1608 registerStyle7("1f3750277d", "._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-background-surface-neutral,#fcfcfc);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-background-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);inset-block-start:0;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px);position:sticky;z-index:1}.a43c44d5ae28b2e8__header-content{min-height:var(--wpds-dimension-size-md,32px)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8bcd33103b451f30__header-lockup{min-width:0}._8113be94e7caf73c__header-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9a776c7f70996f61__header-visual{display:grid;flex-shrink:0;grid-template-columns:1fr;grid-template-rows:1fr;height:var(--wpds-dimension-size-sm,24px);width:var(--wpds-dimension-size-sm,24px);>*{grid-column:1/-1;grid-row:1/-1;max-height:100%;max-width:100%}}.d5e0920cd15d35bc__sidebar-toggle-slot:empty{display:none}._60fea2f6bf5319cd__header-subtitle{color:var(--wpds-color-foreground-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}._0625b55e82a0d93d__header._4b0f17e503d11619__has-navigation,._0625b55e82a0d93d__header._4b0f17e503d11619__has-navigation ._60fea2f6bf5319cd__header-subtitle{padding-block-end:0}._673c99dcbfb58211__header-navigation{margin-block-start:var(--wpds-dimension-gap-md,12px)}.be5e57d029ec4036__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto;&._128806d0b26e3a50__has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}}");
1609 }
1610 var style_default7 = { "page": "_956b6df0898efed0__page", "header": "_0625b55e82a0d93d__header", "header-content": "a43c44d5ae28b2e8__header-content", "header-actions": "b7cb5b9daf3a3b25__header-actions", "header-lockup": "_8bcd33103b451f30__header-lockup", "header-title": "_8113be94e7caf73c__header-title", "header-visual": "_9a776c7f70996f61__header-visual", "sidebar-toggle-slot": "d5e0920cd15d35bc__sidebar-toggle-slot", "header-subtitle": "_60fea2f6bf5319cd__header-subtitle", "has-navigation": "_4b0f17e503d11619__has-navigation", "header-navigation": "_673c99dcbfb58211__header-navigation", "content": "be5e57d029ec4036__content", "has-padding": "_128806d0b26e3a50__has-padding" };
1611 function Page({
1612 headingLevel,
1613 breadcrumbs,
1614 badges,
1615 visual,
1616 title,
1617 subTitle,
1618 children,
1619 className,
1620 actions,
1621 navigation,
1622 components,
1623 ariaLabel,
1624 hasPadding = false,
1625 showSidebarToggle = true
1626 }) {
1627 const classes = clsx_default(style_default7.page, className);
1628 const effectiveAriaLabel = ariaLabel ?? (typeof title === "string" ? title : "");
1629 return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(navigable_region_default, { className: classes, ariaLabel: effectiveAriaLabel, children: [
1630 (title || breadcrumbs || badges || actions || visual || !!navigation?.items?.length) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1631 Header,
1632 {
1633 headingLevel,
1634 breadcrumbs,
1635 badges,
1636 visual,
1637 title,
1638 subTitle,
1639 actions,
1640 navigation,
1641 components,
1642 showSidebarToggle
1643 }
1644 ),
1645 hasPadding ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1646 "div",
1647 {
1648 className: clsx_default(
1649 style_default7.content,
1650 style_default7["has-padding"]
1651 ),
1652 children
1653 }
1654 ) : children
1655 ] });
1656 }
1657 Page.SidebarToggleFill = SidebarToggleFill;
1658 var page_default = Page;
1659
1660 // routes/navigation-edit/stage.tsx
1661 var import_data3 = __toESM(require_data());
1662 var import_core_data3 = __toESM(require_core_data());
1663 var import_i18n5 = __toESM(require_i18n());
1664 var import_html_entities = __toESM(require_html_entities());
1665
1666 // routes/navigation-edit/editor/index.tsx
1667 var import_element6 = __toESM(require_element());
1668 var import_block_editor3 = __toESM(require_block_editor());
1669 var import_blocks3 = __toESM(require_blocks());
1670 var import_components3 = __toESM(require_components());
1671 var import_core_data2 = __toESM(require_core_data());
1672 import { useEditorAssets } from "@wordpress/lazy-editor";
1673
1674 // routes/navigation-edit/editor/style.scss
1675 if (typeof document !== "undefined" && (typeof process === "undefined" || true) && !document.head.querySelector("style[data-wp-hash='ab713497c1']")) {
1676 const style = document.createElement("style");
1677 style.setAttribute("data-wp-hash", "ab713497c1");
1678 style.appendChild(document.createTextNode(".navigation-edit-editor__hidden-blocks{display:none}"));
1679 document.head.appendChild(style);
1680 }
1681
1682 // routes/navigation-edit/editor/content.tsx
1683 var import_block_editor2 = __toESM(require_block_editor());
1684 var import_data2 = __toESM(require_data());
1685 var import_blocks2 = __toESM(require_blocks());
1686 var import_element5 = __toESM(require_element());
1687 var import_core_data = __toESM(require_core_data());
1688
1689 // routes/lock-unlock/index.ts
1690 var import_private_apis = __toESM(require_private_apis());
1691 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
1692 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
1693 "@wordpress/routes"
1694 );
1695
1696 // routes/navigation-edit/editor/leaf-more-menu.tsx
1697 var import_components2 = __toESM(require_components());
1698 var import_data = __toESM(require_data());
1699 var import_i18n4 = __toESM(require_i18n());
1700 var import_block_editor = __toESM(require_block_editor());
1701 var import_blocks = __toESM(require_blocks());
1702 var import_jsx_runtime10 = __toESM(require_jsx_runtime());
1703 var POPOVER_PROPS = {
1704 className: "block-editor-block-settings-menu__popover",
1705 placement: "bottom-start"
1706 };
1707 function LeafMoreMenu({
1708 clientId,
1709 ...props
1710 }) {
1711 const {
1712 moveBlocksDown,
1713 moveBlocksUp,
1714 removeBlocks,
1715 duplicateBlocks,
1716 insertBeforeBlock,
1717 insertAfterBlock
1718 } = (0, import_data.useDispatch)(import_block_editor.store);
1719 const removeLabel = (0, import_i18n4.sprintf)(
1720 /* translators: %s: block name */
1721 (0, import_i18n4.__)("Remove %s"),
1722 (0, import_block_editor.BlockTitle)({ clientId, maximumLength: 25 })
1723 );
1724 const { rootClientId, canDuplicate, canInsertBlock, isFirst, isLast } = (0, import_data.useSelect)(
1725 (select) => {
1726 const {
1727 getBlockRootClientId,
1728 getBlockName,
1729 canInsertBlockType,
1730 getDirectInsertBlock,
1731 getBlockIndex,
1732 getBlockCount
1733 } = select(import_block_editor.store);
1734 const { getDefaultBlockName } = select(import_blocks.store);
1735 const _rootClientId = getBlockRootClientId(clientId);
1736 const _blockName = getBlockName(clientId);
1737 const canInsertDefaultBlock = canInsertBlockType(
1738 getDefaultBlockName(),
1739 _rootClientId
1740 );
1741 const directInsertBlock = _rootClientId ? getDirectInsertBlock(_rootClientId) : null;
1742 return {
1743 rootClientId: _rootClientId,
1744 canDuplicate: (0, import_blocks.hasBlockSupport)(_blockName, "multiple", true) && canInsertBlockType(_blockName, _rootClientId),
1745 canInsertBlock: (canInsertDefaultBlock || !!directInsertBlock) && canInsertBlockType(_blockName, _rootClientId),
1746 isFirst: getBlockIndex(clientId) === 0,
1747 isLast: getBlockIndex(clientId) === getBlockCount(_rootClientId) - 1
1748 };
1749 },
1750 [clientId]
1751 );
1752 return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1753 import_components2.DropdownMenu,
1754 {
1755 icon: more_vertical_default,
1756 label: (0, import_i18n4.__)("Options"),
1757 className: "block-editor-block-settings-menu",
1758 popoverProps: POPOVER_PROPS,
1759 noIcons: true,
1760 ...props,
1761 children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1762 /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_components2.MenuGroup, { children: [
1763 /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1764 import_components2.MenuItem,
1765 {
1766 icon: chevron_up_default,
1767 disabled: isFirst,
1768 onClick: () => {
1769 moveBlocksUp([clientId], rootClientId);
1770 onClose();
1771 },
1772 children: (0, import_i18n4.__)("Move up")
1773 }
1774 ),
1775 /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1776 import_components2.MenuItem,
1777 {
1778 icon: chevron_down_default,
1779 disabled: isLast,
1780 onClick: () => {
1781 moveBlocksDown([clientId], rootClientId);
1782 onClose();
1783 },
1784 children: (0, import_i18n4.__)("Move down")
1785 }
1786 ),
1787 canDuplicate && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1788 import_components2.MenuItem,
1789 {
1790 onClick: () => {
1791 duplicateBlocks([clientId]);
1792 onClose();
1793 },
1794 children: (0, import_i18n4.__)("Duplicate")
1795 }
1796 ),
1797 canInsertBlock && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1798 /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1799 import_components2.MenuItem,
1800 {
1801 onClick: () => {
1802 insertBeforeBlock(clientId);
1803 onClose();
1804 },
1805 children: (0, import_i18n4.__)("Add before")
1806 }
1807 ),
1808 /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1809 import_components2.MenuItem,
1810 {
1811 onClick: () => {
1812 insertAfterBlock(clientId);
1813 onClose();
1814 },
1815 children: (0, import_i18n4.__)("Add after")
1816 }
1817 )
1818 ] })
1819 ] }),
1820 /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_components2.MenuGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1821 import_components2.MenuItem,
1822 {
1823 onClick: () => {
1824 removeBlocks([clientId], false);
1825 onClose();
1826 },
1827 children: removeLabel
1828 }
1829 ) })
1830 ] })
1831 }
1832 );
1833 }
1834
1835 // routes/navigation-edit/editor/content.tsx
1836 var import_jsx_runtime11 = __toESM(require_jsx_runtime());
1837 var { PrivateListView } = unlock(import_block_editor2.privateApis);
1838 var MAX_PAGE_COUNT = 100;
1839 var PAGES_QUERY = [
1840 "postType",
1841 "page",
1842 {
1843 per_page: MAX_PAGE_COUNT,
1844 _fields: ["id", "link", "menu_order", "parent", "title", "type"],
1845 // TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby
1846 // values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent
1847 // sort.
1848 orderby: "menu_order",
1849 order: "asc"
1850 }
1851 ];
1852 function NavigationMenuContent({
1853 rootClientId
1854 }) {
1855 const { NavigationLinkUI } = unlock(
1856 window.wp.blockLibrary.privateApis
1857 );
1858 const { listViewRootClientId, isLoading } = (0, import_data2.useSelect)(
1859 (select) => {
1860 const {
1861 areInnerBlocksControlled,
1862 getBlockName,
1863 getBlockCount,
1864 getBlockOrder
1865 } = select(import_block_editor2.store);
1866 const { isResolving } = select(import_core_data.store);
1867 const blockClientIds = getBlockOrder(rootClientId);
1868 const hasOnlyPageListBlock = blockClientIds.length === 1 && getBlockName(blockClientIds[0]) === "core/page-list";
1869 const pageListHasBlocks = hasOnlyPageListBlock && getBlockCount(blockClientIds[0]) > 0;
1870 const isLoadingPages = isResolving(
1871 "getEntityRecords",
1872 PAGES_QUERY
1873 );
1874 return {
1875 listViewRootClientId: pageListHasBlocks ? blockClientIds[0] : rootClientId,
1876 // This is a small hack to wait for the navigation block
1877 // to actually load its inner blocks.
1878 isLoading: !areInnerBlocksControlled(rootClientId) || isLoadingPages
1879 };
1880 },
1881 [rootClientId]
1882 );
1883 const { replaceBlock, __unstableMarkNextChangeAsNotPersistent } = (0, import_data2.useDispatch)(import_block_editor2.store);
1884 const offCanvasOnselect = (0, import_element5.useCallback)(
1885 (block) => {
1886 if (block.name === "core/navigation-link" && !block.attributes.url) {
1887 __unstableMarkNextChangeAsNotPersistent();
1888 replaceBlock(
1889 block.clientId,
1890 (0, import_blocks2.createBlock)("core/navigation-link", block.attributes)
1891 );
1892 }
1893 },
1894 [__unstableMarkNextChangeAsNotPersistent, replaceBlock]
1895 );
1896 return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1897 !isLoading && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1898 PrivateListView,
1899 {
1900 rootClientId: listViewRootClientId,
1901 onSelect: offCanvasOnselect,
1902 blockSettingsMenu: LeafMoreMenu,
1903 showAppender: true,
1904 additionalBlockContent: NavigationLinkUI,
1905 isExpanded: true
1906 }
1907 ),
1908 /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "navigation-edit-editor__hidden-blocks", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_block_editor2.BlockList, {}) })
1909 ] });
1910 }
1911
1912 // routes/navigation-edit/editor/index.tsx
1913 var import_jsx_runtime12 = __toESM(require_jsx_runtime());
1914 var noop = () => {
1915 };
1916 function NavigationMenuEditor({ id }) {
1917 const { isReady: assetsReady } = useEditorAssets();
1918 const blocks = (0, import_element6.useMemo)(() => {
1919 if (!assetsReady || !id) {
1920 return [];
1921 }
1922 return [(0, import_blocks3.createBlock)("core/navigation", { ref: id })];
1923 }, [assetsReady, id]);
1924 const settings = (0, import_element6.useMemo)(
1925 () => ({
1926 __experimentalFetchLinkSuggestions: (search, searchOptions) => (0, import_core_data2.__experimentalFetchLinkSuggestions)(search, searchOptions, {})
1927 }),
1928 []
1929 );
1930 if (!assetsReady || !blocks.length) {
1931 return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1932 "div",
1933 {
1934 style: {
1935 display: "flex",
1936 justifyContent: "center",
1937 alignItems: "center",
1938 height: "100vh"
1939 },
1940 children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_components3.Spinner, {})
1941 }
1942 );
1943 }
1944 return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1945 import_block_editor3.BlockEditorProvider,
1946 {
1947 settings,
1948 value: blocks,
1949 onChange: noop,
1950 onInput: noop,
1951 children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(NavigationMenuContent, { rootClientId: blocks[0].clientId })
1952 }
1953 );
1954 }
1955
1956 // packages/style-runtime/src/index.ts
1957 var STYLE_HASH_ATTRIBUTE8 = "data-wp-hash";
1958 function getRuntime8() {
1959 const globalScope = globalThis;
1960 if (globalScope.__wpStyleRuntime) {
1961 return globalScope.__wpStyleRuntime;
1962 }
1963 globalScope.__wpStyleRuntime = {
1964 documents: /* @__PURE__ */ new Map(),
1965 styles: /* @__PURE__ */ new Map(),
1966 injectedStyles: /* @__PURE__ */ new WeakMap()
1967 };
1968 if (typeof document !== "undefined") {
1969 registerDocument8(document);
1970 }
1971 return globalScope.__wpStyleRuntime;
1972 }
1973 function documentContainsStyleHash8(targetDocument, hash) {
1974 if (!targetDocument.head) {
1975 return false;
1976 }
1977 for (const style of targetDocument.head.querySelectorAll(
1978 `style[${STYLE_HASH_ATTRIBUTE8}]`
1979 )) {
1980 if (style.getAttribute(STYLE_HASH_ATTRIBUTE8) === hash) {
1981 return true;
1982 }
1983 }
1984 return false;
1985 }
1986 function injectStyle8(targetDocument, hash, css) {
1987 if (!targetDocument.head) {
1988 return;
1989 }
1990 const runtime = getRuntime8();
1991 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1992 if (!injectedStyles) {
1993 injectedStyles = /* @__PURE__ */ new Set();
1994 runtime.injectedStyles.set(targetDocument, injectedStyles);
1995 }
1996 if (injectedStyles.has(hash)) {
1997 return;
1998 }
1999 if (documentContainsStyleHash8(targetDocument, hash)) {
2000 injectedStyles.add(hash);
2001 return;
2002 }
2003 const style = targetDocument.createElement("style");
2004 style.setAttribute(STYLE_HASH_ATTRIBUTE8, hash);
2005 style.appendChild(targetDocument.createTextNode(css));
2006 targetDocument.head.appendChild(style);
2007 injectedStyles.add(hash);
2008 }
2009 function registerDocument8(targetDocument) {
2010 const runtime = getRuntime8();
2011 runtime.documents.set(
2012 targetDocument,
2013 (runtime.documents.get(targetDocument) ?? 0) + 1
2014 );
2015 for (const [hash, css] of runtime.styles) {
2016 injectStyle8(targetDocument, hash, css);
2017 }
2018 return () => {
2019 const count = runtime.documents.get(targetDocument);
2020 if (count === void 0) {
2021 return;
2022 }
2023 if (count <= 1) {
2024 runtime.documents.delete(targetDocument);
2025 return;
2026 }
2027 runtime.documents.set(targetDocument, count - 1);
2028 };
2029 }
2030 function registerStyle8(hash, css) {
2031 const runtime = getRuntime8();
2032 runtime.styles.set(hash, css);
2033 for (const targetDocument of runtime.documents.keys()) {
2034 injectStyle8(targetDocument, hash, css);
2035 }
2036 }
2037
2038 // routes/navigation-edit/style.module.scss
2039 if (typeof process === "undefined" || true) {
2040 registerStyle8("70af410a92", "._813be682e01d3b06__content{background-color:var(--wpds-color-background-surface-neutral-strong,#fff);flex-grow:1;min-height:0;overflow:auto;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}");
2041 }
2042 var style_module_default = { "content": "_813be682e01d3b06__content" };
2043
2044 // routes/navigation-edit/stage.tsx
2045 var import_jsx_runtime13 = __toESM(require_jsx_runtime());
2046 var NAVIGATION_POST_TYPE = "wp_navigation";
2047 function NavigationEditStage() {
2048 const { id } = useParams({ from: "/navigation/edit/$id" });
2049 const navigationId = parseInt(id);
2050 const { navigationMenu } = (0, import_data3.useSelect)(
2051 (select) => {
2052 const { getEntityRecord } = select(import_core_data3.store);
2053 return {
2054 navigationMenu: getEntityRecord(
2055 "postType",
2056 NAVIGATION_POST_TYPE,
2057 navigationId
2058 )
2059 };
2060 },
2061 [navigationId]
2062 );
2063 if (!navigationMenu) {
2064 return;
2065 }
2066 const menuTitle = navigationMenu.title?.rendered || navigationMenu.title?.raw || "";
2067 return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2068 page_default,
2069 {
2070 ariaLabel: (0, import_html_entities.decodeEntities)(menuTitle),
2071 headingLevel: 2,
2072 breadcrumbs: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2073 breadcrumbs_default,
2074 {
2075 items: [
2076 {
2077 label: (0, import_i18n5.__)("Navigation"),
2078 to: "/navigation/list"
2079 },
2080 {
2081 label: (0, import_html_entities.decodeEntities)(menuTitle)
2082 }
2083 ]
2084 }
2085 ),
2086 children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: style_module_default.content, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NavigationMenuEditor, { id: navigationId }) })
2087 }
2088 );
2089 }
2090 var stage = NavigationEditStage;
2091 export {
2092 stage
2093 };
2094