PluginProbe
Gutenberg / 23.3.1
Gutenberg v23.3.1
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 12.6.0 7.4.0 All 402 releases
gutenberg / build / modules / boot / index.js

index.js in Gutenberg 23.3.1, at build/modules/boot/index.js

2,963 lines 139.9 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 __export = (target, all) => {
11 for (var name in all)
12 __defProp(target, name, { get: all[name], enumerable: true });
13 };
14 var __copyProps = (to, from, except, desc) => {
15 if (from && typeof from === "object" || typeof from === "function") {
16 for (let key of __getOwnPropNames(from))
17 if (!__hasOwnProp.call(to, key) && key !== except)
18 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19 }
20 return to;
21 };
22 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23 // If the importer is in node compatibility mode or this is not an ESM
24 // file that has been converted to a CommonJS file using a Babel-
25 // compatible transform (i.e. "__esModule" has not been set), then set
26 // "default" to the CommonJS "module.exports" for node compatibility.
27 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28 mod
29 ));
30
31 // package-external:@wordpress/element
32 var require_element = __commonJS({
33 "package-external:@wordpress/element"(exports, module) {
34 module.exports = window.wp.element;
35 }
36 });
37
38 // package-external:@wordpress/data
39 var require_data = __commonJS({
40 "package-external:@wordpress/data"(exports, module) {
41 module.exports = window.wp.data;
42 }
43 });
44
45 // package-external:@wordpress/i18n
46 var require_i18n = __commonJS({
47 "package-external:@wordpress/i18n"(exports, module) {
48 module.exports = window.wp.i18n;
49 }
50 });
51
52 // vendor-external:react
53 var require_react = __commonJS({
54 "vendor-external:react"(exports, module) {
55 module.exports = window.React;
56 }
57 });
58
59 // vendor-external:react/jsx-runtime
60 var require_jsx_runtime = __commonJS({
61 "vendor-external:react/jsx-runtime"(exports, module) {
62 module.exports = window.ReactJSXRuntime;
63 }
64 });
65
66 // package-external:@wordpress/primitives
67 var require_primitives = __commonJS({
68 "package-external:@wordpress/primitives"(exports, module) {
69 module.exports = window.wp.primitives;
70 }
71 });
72
73 // package-external:@wordpress/compose
74 var require_compose = __commonJS({
75 "package-external:@wordpress/compose"(exports, module) {
76 module.exports = window.wp.compose;
77 }
78 });
79
80 // package-external:@wordpress/theme
81 var require_theme = __commonJS({
82 "package-external:@wordpress/theme"(exports, module) {
83 module.exports = window.wp.theme;
84 }
85 });
86
87 // package-external:@wordpress/private-apis
88 var require_private_apis = __commonJS({
89 "package-external:@wordpress/private-apis"(exports, module) {
90 module.exports = window.wp.privateApis;
91 }
92 });
93
94 // package-external:@wordpress/components
95 var require_components = __commonJS({
96 "package-external:@wordpress/components"(exports, module) {
97 module.exports = window.wp.components;
98 }
99 });
100
101 // package-external:@wordpress/core-data
102 var require_core_data = __commonJS({
103 "package-external:@wordpress/core-data"(exports, module) {
104 module.exports = window.wp.coreData;
105 }
106 });
107
108 // package-external:@wordpress/notices
109 var require_notices = __commonJS({
110 "package-external:@wordpress/notices"(exports, module) {
111 module.exports = window.wp.notices;
112 }
113 });
114
115 // package-external:@wordpress/html-entities
116 var require_html_entities = __commonJS({
117 "package-external:@wordpress/html-entities"(exports, module) {
118 module.exports = window.wp.htmlEntities;
119 }
120 });
121
122 // package-external:@wordpress/keycodes
123 var require_keycodes = __commonJS({
124 "package-external:@wordpress/keycodes"(exports, module) {
125 module.exports = window.wp.keycodes;
126 }
127 });
128
129 // package-external:@wordpress/commands
130 var require_commands = __commonJS({
131 "package-external:@wordpress/commands"(exports, module) {
132 module.exports = window.wp.commands;
133 }
134 });
135
136 // package-external:@wordpress/url
137 var require_url = __commonJS({
138 "package-external:@wordpress/url"(exports, module) {
139 module.exports = window.wp.url;
140 }
141 });
142
143 // package-external:@wordpress/editor
144 var require_editor = __commonJS({
145 "package-external:@wordpress/editor"(exports, module) {
146 module.exports = window.wp.editor;
147 }
148 });
149
150 // package-external:@wordpress/keyboard-shortcuts
151 var require_keyboard_shortcuts = __commonJS({
152 "package-external:@wordpress/keyboard-shortcuts"(exports, module) {
153 module.exports = window.wp.keyboardShortcuts;
154 }
155 });
156
157 // packages/boot/build-module/components/app/index.mjs
158 var import_element17 = __toESM(require_element(), 1);
159 var import_data12 = __toESM(require_data(), 1);
160
161 // packages/boot/build-module/components/app/router.mjs
162 var import_i18n12 = __toESM(require_i18n(), 1);
163 var import_element16 = __toESM(require_element(), 1);
164
165 // node_modules/clsx/dist/clsx.mjs
166 function r(e) {
167 var t, f, n = "";
168 if ("string" == typeof e || "number" == typeof e) n += e;
169 else if ("object" == typeof e) if (Array.isArray(e)) {
170 var o = e.length;
171 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
172 } else for (f in e) e[f] && (n && (n += " "), n += f);
173 return n;
174 }
175 function clsx() {
176 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
177 return n;
178 }
179 var clsx_default = clsx;
180
181 // node_modules/@base-ui/utils/esm/useRefWithInit.js
182 var React = __toESM(require_react(), 1);
183 var UNINITIALIZED = {};
184 function useRefWithInit(init2, initArg) {
185 const ref = React.useRef(UNINITIALIZED);
186 if (ref.current === UNINITIALIZED) {
187 ref.current = init2(initArg);
188 }
189 return ref;
190 }
191
192 // node_modules/@base-ui/utils/esm/warn.js
193 var set;
194 if (true) {
195 set = /* @__PURE__ */ new Set();
196 }
197 function warn(...messages) {
198 if (true) {
199 const messageKey = messages.join(" ");
200 if (!set.has(messageKey)) {
201 set.add(messageKey);
202 console.warn(`Base UI: ${messageKey}`);
203 }
204 }
205 }
206
207 // node_modules/@base-ui/react/esm/internals/useRenderElement.js
208 var React4 = __toESM(require_react(), 1);
209
210 // node_modules/@base-ui/utils/esm/useMergedRefs.js
211 function useMergedRefs(a, b, c, d) {
212 const forkRef = useRefWithInit(createForkRef).current;
213 if (didChange(forkRef, a, b, c, d)) {
214 update(forkRef, [a, b, c, d]);
215 }
216 return forkRef.callback;
217 }
218 function useMergedRefsN(refs) {
219 const forkRef = useRefWithInit(createForkRef).current;
220 if (didChangeN(forkRef, refs)) {
221 update(forkRef, refs);
222 }
223 return forkRef.callback;
224 }
225 function createForkRef() {
226 return {
227 callback: null,
228 cleanup: null,
229 refs: []
230 };
231 }
232 function didChange(forkRef, a, b, c, d) {
233 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
234 }
235 function didChangeN(forkRef, newRefs) {
236 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
237 }
238 function update(forkRef, refs) {
239 forkRef.refs = refs;
240 if (refs.every((ref) => ref == null)) {
241 forkRef.callback = null;
242 return;
243 }
244 forkRef.callback = (instance) => {
245 if (forkRef.cleanup) {
246 forkRef.cleanup();
247 forkRef.cleanup = null;
248 }
249 if (instance != null) {
250 const cleanupCallbacks = Array(refs.length).fill(null);
251 for (let i = 0; i < refs.length; i += 1) {
252 const ref = refs[i];
253 if (ref == null) {
254 continue;
255 }
256 switch (typeof ref) {
257 case "function": {
258 const refCleanup = ref(instance);
259 if (typeof refCleanup === "function") {
260 cleanupCallbacks[i] = refCleanup;
261 }
262 break;
263 }
264 case "object": {
265 ref.current = instance;
266 break;
267 }
268 default:
269 }
270 }
271 forkRef.cleanup = () => {
272 for (let i = 0; i < refs.length; i += 1) {
273 const ref = refs[i];
274 if (ref == null) {
275 continue;
276 }
277 switch (typeof ref) {
278 case "function": {
279 const cleanupCallback = cleanupCallbacks[i];
280 if (typeof cleanupCallback === "function") {
281 cleanupCallback();
282 } else {
283 ref(null);
284 }
285 break;
286 }
287 case "object": {
288 ref.current = null;
289 break;
290 }
291 default:
292 }
293 }
294 };
295 }
296 };
297 }
298
299 // node_modules/@base-ui/utils/esm/getReactElementRef.js
300 var React3 = __toESM(require_react(), 1);
301
302 // node_modules/@base-ui/utils/esm/reactVersion.js
303 var React2 = __toESM(require_react(), 1);
304 var majorVersion = parseInt(React2.version, 10);
305 function isReactVersionAtLeast(reactVersionToCheck) {
306 return majorVersion >= reactVersionToCheck;
307 }
308
309 // node_modules/@base-ui/utils/esm/getReactElementRef.js
310 function getReactElementRef(element) {
311 if (!/* @__PURE__ */ React3.isValidElement(element)) {
312 return null;
313 }
314 const reactElement = element;
315 const propsWithRef = reactElement.props;
316 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
317 }
318
319 // node_modules/@base-ui/utils/esm/mergeObjects.js
320 function mergeObjects(a, b) {
321 if (a && !b) {
322 return a;
323 }
324 if (!a && b) {
325 return b;
326 }
327 if (a || b) {
328 return {
329 ...a,
330 ...b
331 };
332 }
333 return void 0;
334 }
335
336 // node_modules/@base-ui/utils/esm/empty.js
337 var EMPTY_ARRAY = Object.freeze([]);
338 var EMPTY_OBJECT = Object.freeze({});
339
340 // node_modules/@base-ui/react/esm/internals/getStateAttributesProps.js
341 function getStateAttributesProps(state, customMapping) {
342 const props = {};
343 for (const key in state) {
344 const value = state[key];
345 if (customMapping?.hasOwnProperty(key)) {
346 const customProps = customMapping[key](value);
347 if (customProps != null) {
348 Object.assign(props, customProps);
349 }
350 continue;
351 }
352 if (value === true) {
353 props[`data-${key.toLowerCase()}`] = "";
354 } else if (value) {
355 props[`data-${key.toLowerCase()}`] = value.toString();
356 }
357 }
358 return props;
359 }
360
361 // node_modules/@base-ui/react/esm/utils/resolveClassName.js
362 function resolveClassName(className, state) {
363 return typeof className === "function" ? className(state) : className;
364 }
365
366 // node_modules/@base-ui/react/esm/utils/resolveStyle.js
367 function resolveStyle(style, state) {
368 return typeof style === "function" ? style(state) : style;
369 }
370
371 // node_modules/@base-ui/react/esm/merge-props/mergeProps.js
372 var EMPTY_PROPS = {};
373 function mergeProps(a, b, c, d, e) {
374 if (!c && !d && !e && !a) {
375 return createInitialMergedProps(b);
376 }
377 let merged = createInitialMergedProps(a);
378 if (b) {
379 merged = mergeInto(merged, b);
380 }
381 if (c) {
382 merged = mergeInto(merged, c);
383 }
384 if (d) {
385 merged = mergeInto(merged, d);
386 }
387 if (e) {
388 merged = mergeInto(merged, e);
389 }
390 return merged;
391 }
392 function mergePropsN(props) {
393 if (props.length === 0) {
394 return EMPTY_PROPS;
395 }
396 if (props.length === 1) {
397 return createInitialMergedProps(props[0]);
398 }
399 let merged = createInitialMergedProps(props[0]);
400 for (let i = 1; i < props.length; i += 1) {
401 merged = mergeInto(merged, props[i]);
402 }
403 return merged;
404 }
405 function createInitialMergedProps(inputProps) {
406 if (isPropsGetter(inputProps)) {
407 return {
408 ...resolvePropsGetter(inputProps, EMPTY_PROPS)
409 };
410 }
411 return copyInitialProps(inputProps);
412 }
413 function mergeInto(merged, inputProps) {
414 if (isPropsGetter(inputProps)) {
415 return resolvePropsGetter(inputProps, merged);
416 }
417 return mutablyMergeInto(merged, inputProps);
418 }
419 function copyInitialProps(inputProps) {
420 const copiedProps = {
421 ...inputProps
422 };
423 for (const propName in copiedProps) {
424 const propValue = copiedProps[propName];
425 if (isEventHandler(propName, propValue)) {
426 copiedProps[propName] = wrapEventHandler(propValue);
427 }
428 }
429 return copiedProps;
430 }
431 function mutablyMergeInto(mergedProps, externalProps) {
432 if (!externalProps) {
433 return mergedProps;
434 }
435 for (const propName in externalProps) {
436 const externalPropValue = externalProps[propName];
437 switch (propName) {
438 case "style": {
439 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
440 break;
441 }
442 case "className": {
443 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
444 break;
445 }
446 default: {
447 if (isEventHandler(propName, externalPropValue)) {
448 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
449 } else {
450 mergedProps[propName] = externalPropValue;
451 }
452 }
453 }
454 }
455 return mergedProps;
456 }
457 function isEventHandler(key, value) {
458 const code0 = key.charCodeAt(0);
459 const code1 = key.charCodeAt(1);
460 const code2 = key.charCodeAt(2);
461 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
462 }
463 function isPropsGetter(inputProps) {
464 return typeof inputProps === "function";
465 }
466 function resolvePropsGetter(inputProps, previousProps) {
467 if (isPropsGetter(inputProps)) {
468 return inputProps(previousProps);
469 }
470 return inputProps ?? EMPTY_PROPS;
471 }
472 function mergeEventHandlers(ourHandler, theirHandler) {
473 if (!theirHandler) {
474 return ourHandler;
475 }
476 if (!ourHandler) {
477 return wrapEventHandler(theirHandler);
478 }
479 return (...args) => {
480 const event = args[0];
481 if (isSyntheticEvent(event)) {
482 const baseUIEvent = event;
483 makeEventPreventable(baseUIEvent);
484 const result2 = theirHandler(...args);
485 if (!baseUIEvent.baseUIHandlerPrevented) {
486 ourHandler?.(...args);
487 }
488 return result2;
489 }
490 const result = theirHandler(...args);
491 ourHandler?.(...args);
492 return result;
493 };
494 }
495 function wrapEventHandler(handler) {
496 if (!handler) {
497 return handler;
498 }
499 return (...args) => {
500 const event = args[0];
501 if (isSyntheticEvent(event)) {
502 makeEventPreventable(event);
503 }
504 return handler(...args);
505 };
506 }
507 function makeEventPreventable(event) {
508 event.preventBaseUIHandler = () => {
509 event.baseUIHandlerPrevented = true;
510 };
511 return event;
512 }
513 function mergeClassNames(ourClassName, theirClassName) {
514 if (theirClassName) {
515 if (ourClassName) {
516 return theirClassName + " " + ourClassName;
517 }
518 return theirClassName;
519 }
520 return ourClassName;
521 }
522 function isSyntheticEvent(event) {
523 return event != null && typeof event === "object" && "nativeEvent" in event;
524 }
525
526 // node_modules/@base-ui/react/esm/internals/useRenderElement.js
527 var import_react = __toESM(require_react(), 1);
528 function useRenderElement(element, componentProps, params = {}) {
529 const renderProp = componentProps.render;
530 const outProps = useRenderElementProps(componentProps, params);
531 if (params.enabled === false) {
532 return null;
533 }
534 const state = params.state ?? EMPTY_OBJECT;
535 return evaluateRenderProp(element, renderProp, outProps, state);
536 }
537 function useRenderElementProps(componentProps, params = {}) {
538 const {
539 className: classNameProp,
540 style: styleProp,
541 render: renderProp
542 } = componentProps;
543 const {
544 state = EMPTY_OBJECT,
545 ref,
546 props,
547 stateAttributesMapping,
548 enabled = true
549 } = params;
550 const className = enabled ? resolveClassName(classNameProp, state) : void 0;
551 const style = enabled ? resolveStyle(styleProp, state) : void 0;
552 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;
553 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
554 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
555 if (typeof document !== "undefined") {
556 if (!enabled) {
557 useMergedRefs(null, null);
558 } else if (Array.isArray(ref)) {
559 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
560 } else {
561 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
562 }
563 }
564 if (!enabled) {
565 return EMPTY_OBJECT;
566 }
567 if (className !== void 0) {
568 outProps.className = mergeClassNames(outProps.className, className);
569 }
570 if (style !== void 0) {
571 outProps.style = mergeObjects(outProps.style, style);
572 }
573 return outProps;
574 }
575 function resolveRenderFunctionProps(props) {
576 if (Array.isArray(props)) {
577 return mergePropsN(props);
578 }
579 return mergeProps(void 0, props);
580 }
581 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
582 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
583 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
584 function evaluateRenderProp(element, render, props, state) {
585 if (render) {
586 if (typeof render === "function") {
587 if (true) {
588 warnIfRenderPropLooksLikeComponent(render);
589 }
590 return render(props, state);
591 }
592 const mergedProps = mergeProps(props, render.props);
593 mergedProps.ref = props.ref;
594 let newElement = render;
595 if (newElement?.$$typeof === REACT_LAZY_TYPE) {
596 const children = React4.Children.toArray(render);
597 newElement = children[0];
598 }
599 if (true) {
600 if (!/* @__PURE__ */ React4.isValidElement(newElement)) {
601 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"));
602 }
603 }
604 return /* @__PURE__ */ React4.cloneElement(newElement, mergedProps);
605 }
606 if (element) {
607 if (typeof element === "string") {
608 return renderTag(element, props);
609 }
610 }
611 throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8));
612 }
613 function warnIfRenderPropLooksLikeComponent(renderFn) {
614 const functionName = renderFn.name;
615 if (functionName.length === 0) {
616 return;
617 }
618 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {
619 return;
620 }
621 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {
622 return;
623 }
624 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");
625 }
626 function renderTag(Tag, props) {
627 if (Tag === "button") {
628 return /* @__PURE__ */ (0, import_react.createElement)("button", {
629 type: "button",
630 ...props,
631 key: props.key
632 });
633 }
634 if (Tag === "img") {
635 return /* @__PURE__ */ (0, import_react.createElement)("img", {
636 alt: "",
637 ...props,
638 key: props.key
639 });
640 }
641 return /* @__PURE__ */ React4.createElement(Tag, props);
642 }
643
644 // node_modules/@base-ui/react/esm/use-render/useRender.js
645 function useRender(params) {
646 return useRenderElement(params.defaultTagName ?? "div", params, params);
647 }
648
649 // packages/ui/build-module/text/text.mjs
650 var import_element = __toESM(require_element(), 1);
651 var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
652 function getRuntime() {
653 const globalScope = globalThis;
654 if (globalScope.__wpStyleRuntime) {
655 return globalScope.__wpStyleRuntime;
656 }
657 globalScope.__wpStyleRuntime = {
658 documents: /* @__PURE__ */ new Map(),
659 styles: /* @__PURE__ */ new Map(),
660 injectedStyles: /* @__PURE__ */ new WeakMap()
661 };
662 if (typeof document !== "undefined") {
663 registerDocument(document);
664 }
665 return globalScope.__wpStyleRuntime;
666 }
667 function documentContainsStyleHash(targetDocument, hash) {
668 if (!targetDocument.head) {
669 return false;
670 }
671 for (const style of targetDocument.head.querySelectorAll(
672 `style[${STYLE_HASH_ATTRIBUTE}]`
673 )) {
674 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
675 return true;
676 }
677 }
678 return false;
679 }
680 function injectStyle(targetDocument, hash, css) {
681 if (!targetDocument.head) {
682 return;
683 }
684 const runtime = getRuntime();
685 let injectedStyles = runtime.injectedStyles.get(targetDocument);
686 if (!injectedStyles) {
687 injectedStyles = /* @__PURE__ */ new Set();
688 runtime.injectedStyles.set(targetDocument, injectedStyles);
689 }
690 if (injectedStyles.has(hash)) {
691 return;
692 }
693 if (documentContainsStyleHash(targetDocument, hash)) {
694 injectedStyles.add(hash);
695 return;
696 }
697 const style = targetDocument.createElement("style");
698 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
699 style.appendChild(targetDocument.createTextNode(css));
700 targetDocument.head.appendChild(style);
701 injectedStyles.add(hash);
702 }
703 function registerDocument(targetDocument) {
704 const runtime = getRuntime();
705 runtime.documents.set(
706 targetDocument,
707 (runtime.documents.get(targetDocument) ?? 0) + 1
708 );
709 for (const [hash, css] of runtime.styles) {
710 injectStyle(targetDocument, hash, css);
711 }
712 return () => {
713 const count = runtime.documents.get(targetDocument);
714 if (count === void 0) {
715 return;
716 }
717 if (count <= 1) {
718 runtime.documents.delete(targetDocument);
719 return;
720 }
721 runtime.documents.set(targetDocument, count - 1);
722 };
723 }
724 function registerStyle(hash, css) {
725 const runtime = getRuntime();
726 runtime.styles.set(hash, css);
727 for (const targetDocument of runtime.documents.keys()) {
728 injectStyle(targetDocument, hash, css);
729 }
730 }
731 if (typeof process === "undefined" || true) {
732 registerStyle("0c8601dd83", '@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._83ed8a8da5dd50ea__text{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-medium,499);--_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-medium,499)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_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-medium,499);--_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-medium,499);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-medium,499);--_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-medium,499);--_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-medium,499);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-regular,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-regular,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,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-regular,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-regular,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,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)}}');
733 }
734 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" };
735 if (typeof process === "undefined" || true) {
736 registerStyle("1fb29d3a3c", "._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);&: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,#0000);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 #0000);color:var(--_gcd-input-color,var(--wpds-color-fg-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,#0000);border-color:var(--_gcd-input-border-color-disabled,#0000);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-fg-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 #0000)}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-fg-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));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 #0000);transition:var(--_gcd-a-transition,none)}");
737 }
738 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" };
739 var Text = (0, import_element.forwardRef)(function Text2({ variant = "body-md", render, className, ...props }, ref) {
740 const element = useRender({
741 render,
742 defaultTagName: "span",
743 ref,
744 props: mergeProps(props, {
745 className: clsx_default(
746 style_default.text,
747 global_css_defense_default.heading,
748 global_css_defense_default.p,
749 style_default[variant],
750 className
751 )
752 })
753 });
754 return element;
755 });
756
757 // packages/icons/build-module/icon/index.mjs
758 var import_element2 = __toESM(require_element(), 1);
759 var icon_default = (0, import_element2.forwardRef)(
760 ({ icon, size = 24, ...props }, ref) => {
761 return (0, import_element2.cloneElement)(
762 icon,
763 {
764 width: size,
765 height: size,
766 ...props,
767 ref
768 }
769 );
770 }
771 );
772
773 // packages/icons/build-module/library/arrow-up-left.mjs
774 var import_primitives = __toESM(require_primitives(), 1);
775 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
776 var arrow_up_left_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z" }) });
777
778 // packages/icons/build-module/library/arrow-up-right.mjs
779 var import_primitives2 = __toESM(require_primitives(), 1);
780 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
781 var arrow_up_right_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M10 6H18V14H16.5V8.5L7 18L6 17L15.5 7.5H10V6Z" }) });
782
783 // packages/icons/build-module/library/check.mjs
784 var import_primitives3 = __toESM(require_primitives(), 1);
785 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
786 var check_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });
787
788 // packages/icons/build-module/library/chevron-down-small.mjs
789 var import_primitives4 = __toESM(require_primitives(), 1);
790 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
791 var chevron_down_small_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "m15.99 10.889-3.988 3.418-3.988-3.418.976-1.14 3.012 2.582 3.012-2.581.976 1.139Z" }) });
792
793 // packages/icons/build-module/library/chevron-left-small.mjs
794 var import_primitives5 = __toESM(require_primitives(), 1);
795 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
796 var chevron_left_small_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" }) });
797
798 // packages/icons/build-module/library/chevron-left.mjs
799 var import_primitives6 = __toESM(require_primitives(), 1);
800 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
801 var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) });
802
803 // packages/icons/build-module/library/chevron-right-small.mjs
804 var import_primitives7 = __toESM(require_primitives(), 1);
805 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
806 var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) });
807
808 // packages/icons/build-module/library/chevron-right.mjs
809 var import_primitives8 = __toESM(require_primitives(), 1);
810 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
811 var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });
812
813 // packages/icons/build-module/library/menu.mjs
814 var import_primitives9 = __toESM(require_primitives(), 1);
815 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
816 var menu_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z" }) });
817
818 // packages/icons/build-module/library/search.mjs
819 var import_primitives10 = __toESM(require_primitives(), 1);
820 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
821 var search_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) });
822
823 // packages/icons/build-module/library/wordpress.mjs
824 var import_primitives11 = __toESM(require_primitives(), 1);
825 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
826 var wordpress_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.Path, { d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z" }) });
827
828 // packages/ui/build-module/stack/stack.mjs
829 var import_element3 = __toESM(require_element(), 1);
830 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
831 function getRuntime2() {
832 const globalScope = globalThis;
833 if (globalScope.__wpStyleRuntime) {
834 return globalScope.__wpStyleRuntime;
835 }
836 globalScope.__wpStyleRuntime = {
837 documents: /* @__PURE__ */ new Map(),
838 styles: /* @__PURE__ */ new Map(),
839 injectedStyles: /* @__PURE__ */ new WeakMap()
840 };
841 if (typeof document !== "undefined") {
842 registerDocument2(document);
843 }
844 return globalScope.__wpStyleRuntime;
845 }
846 function documentContainsStyleHash2(targetDocument, hash) {
847 if (!targetDocument.head) {
848 return false;
849 }
850 for (const style of targetDocument.head.querySelectorAll(
851 `style[${STYLE_HASH_ATTRIBUTE2}]`
852 )) {
853 if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) {
854 return true;
855 }
856 }
857 return false;
858 }
859 function injectStyle2(targetDocument, hash, css) {
860 if (!targetDocument.head) {
861 return;
862 }
863 const runtime = getRuntime2();
864 let injectedStyles = runtime.injectedStyles.get(targetDocument);
865 if (!injectedStyles) {
866 injectedStyles = /* @__PURE__ */ new Set();
867 runtime.injectedStyles.set(targetDocument, injectedStyles);
868 }
869 if (injectedStyles.has(hash)) {
870 return;
871 }
872 if (documentContainsStyleHash2(targetDocument, hash)) {
873 injectedStyles.add(hash);
874 return;
875 }
876 const style = targetDocument.createElement("style");
877 style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash);
878 style.appendChild(targetDocument.createTextNode(css));
879 targetDocument.head.appendChild(style);
880 injectedStyles.add(hash);
881 }
882 function registerDocument2(targetDocument) {
883 const runtime = getRuntime2();
884 runtime.documents.set(
885 targetDocument,
886 (runtime.documents.get(targetDocument) ?? 0) + 1
887 );
888 for (const [hash, css] of runtime.styles) {
889 injectStyle2(targetDocument, hash, css);
890 }
891 return () => {
892 const count = runtime.documents.get(targetDocument);
893 if (count === void 0) {
894 return;
895 }
896 if (count <= 1) {
897 runtime.documents.delete(targetDocument);
898 return;
899 }
900 runtime.documents.set(targetDocument, count - 1);
901 };
902 }
903 function registerStyle2(hash, css) {
904 const runtime = getRuntime2();
905 runtime.styles.set(hash, css);
906 for (const targetDocument of runtime.documents.keys()) {
907 injectStyle2(targetDocument, hash, css);
908 }
909 }
910 if (typeof process === "undefined" || true) {
911 registerStyle2("b51ff41489", "@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}");
912 }
913 var style_default2 = { "stack": "_19ce0419607e1896__stack" };
914 var gapTokens = {
915 xs: "var(--wpds-dimension-gap-xs, 4px)",
916 sm: "var(--wpds-dimension-gap-sm, 8px)",
917 md: "var(--wpds-dimension-gap-md, 12px)",
918 lg: "var(--wpds-dimension-gap-lg, 16px)",
919 xl: "var(--wpds-dimension-gap-xl, 24px)",
920 "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
921 "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
922 };
923 var Stack = (0, import_element3.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
924 const style = {
925 gap: gap && gapTokens[gap],
926 alignItems: align,
927 justifyContent: justify,
928 flexDirection: direction,
929 flexWrap: wrap
930 };
931 const element = useRender({
932 render,
933 ref,
934 props: mergeProps(props, { style, className: style_default2.stack })
935 });
936 return element;
937 });
938
939 // packages/admin-ui/build-module/navigable-region/index.mjs
940 var import_element4 = __toESM(require_element(), 1);
941 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
942 var NavigableRegion = (0, import_element4.forwardRef)(
943 ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => {
944 return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
945 Tag,
946 {
947 ref,
948 className: clsx_default("admin-ui-navigable-region", className),
949 "aria-label": ariaLabel,
950 role: "region",
951 tabIndex: "-1",
952 ...props,
953 children
954 }
955 );
956 }
957 );
958 NavigableRegion.displayName = "NavigableRegion";
959 var navigable_region_default = NavigableRegion;
960
961 // packages/admin-ui/build-module/page/sidebar-toggle-slot.mjs
962 var import_components = __toESM(require_components(), 1);
963 var { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } = (0, import_components.createSlotFill)("SidebarToggle");
964
965 // packages/admin-ui/build-module/page/header.mjs
966 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
967 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
968 function getRuntime3() {
969 const globalScope = globalThis;
970 if (globalScope.__wpStyleRuntime) {
971 return globalScope.__wpStyleRuntime;
972 }
973 globalScope.__wpStyleRuntime = {
974 documents: /* @__PURE__ */ new Map(),
975 styles: /* @__PURE__ */ new Map(),
976 injectedStyles: /* @__PURE__ */ new WeakMap()
977 };
978 if (typeof document !== "undefined") {
979 registerDocument3(document);
980 }
981 return globalScope.__wpStyleRuntime;
982 }
983 function documentContainsStyleHash3(targetDocument, hash) {
984 if (!targetDocument.head) {
985 return false;
986 }
987 for (const style of targetDocument.head.querySelectorAll(
988 `style[${STYLE_HASH_ATTRIBUTE3}]`
989 )) {
990 if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
991 return true;
992 }
993 }
994 return false;
995 }
996 function injectStyle3(targetDocument, hash, css) {
997 if (!targetDocument.head) {
998 return;
999 }
1000 const runtime = getRuntime3();
1001 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1002 if (!injectedStyles) {
1003 injectedStyles = /* @__PURE__ */ new Set();
1004 runtime.injectedStyles.set(targetDocument, injectedStyles);
1005 }
1006 if (injectedStyles.has(hash)) {
1007 return;
1008 }
1009 if (documentContainsStyleHash3(targetDocument, hash)) {
1010 injectedStyles.add(hash);
1011 return;
1012 }
1013 const style = targetDocument.createElement("style");
1014 style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
1015 style.appendChild(targetDocument.createTextNode(css));
1016 targetDocument.head.appendChild(style);
1017 injectedStyles.add(hash);
1018 }
1019 function registerDocument3(targetDocument) {
1020 const runtime = getRuntime3();
1021 runtime.documents.set(
1022 targetDocument,
1023 (runtime.documents.get(targetDocument) ?? 0) + 1
1024 );
1025 for (const [hash, css] of runtime.styles) {
1026 injectStyle3(targetDocument, hash, css);
1027 }
1028 return () => {
1029 const count = runtime.documents.get(targetDocument);
1030 if (count === void 0) {
1031 return;
1032 }
1033 if (count <= 1) {
1034 runtime.documents.delete(targetDocument);
1035 return;
1036 }
1037 runtime.documents.set(targetDocument, count - 1);
1038 };
1039 }
1040 function registerStyle3(hash, css) {
1041 const runtime = getRuntime3();
1042 runtime.styles.set(hash, css);
1043 for (const targetDocument of runtime.documents.keys()) {
1044 injectStyle3(targetDocument, hash, css);
1045 }
1046 }
1047 if (typeof process === "undefined" || true) {
1048 registerStyle3("aa9c241ccc", "._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-bg-surface-neutral,#fcfcfc);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);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:calc(var(--wpds-dimension-base, 4px)*8)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8113be94e7caf73c__header-title{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:calc(var(--wpds-dimension-base, 4px)*6);width:calc(var(--wpds-dimension-base, 4px)*6);>*{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-fg-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}.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)}}");
1049 }
1050 var style_default3 = { "page": "_956b6df0898efed0__page", "header": "_0625b55e82a0d93d__header", "header-content": "a43c44d5ae28b2e8__header-content", "header-actions": "b7cb5b9daf3a3b25__header-actions", "header-title": "_8113be94e7caf73c__header-title", "header-visual": "_9a776c7f70996f61__header-visual", "sidebar-toggle-slot": "d5e0920cd15d35bc__sidebar-toggle-slot", "header-subtitle": "_60fea2f6bf5319cd__header-subtitle", "content": "be5e57d029ec4036__content", "has-padding": "_128806d0b26e3a50__has-padding" };
1051 function Header({
1052 headingLevel = 1,
1053 breadcrumbs,
1054 badges,
1055 visual,
1056 title,
1057 subTitle,
1058 actions,
1059 showSidebarToggle = true
1060 }) {
1061 const HeadingTag = `h${headingLevel}`;
1062 return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Stack, { direction: "column", className: style_default3.header, children: [
1063 /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1064 Stack,
1065 {
1066 className: style_default3["header-content"],
1067 direction: "row",
1068 gap: "sm",
1069 justify: "space-between",
1070 children: [
1071 /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Stack, { direction: "row", gap: "sm", align: "center", justify: "start", children: [
1072 showSidebarToggle && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1073 SidebarToggleSlot,
1074 {
1075 bubblesVirtually: true,
1076 className: style_default3["sidebar-toggle-slot"]
1077 }
1078 ),
1079 visual && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1080 "div",
1081 {
1082 className: style_default3["header-visual"],
1083 "aria-hidden": "true",
1084 children: visual
1085 }
1086 ),
1087 title && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1088 Text,
1089 {
1090 className: style_default3["header-title"],
1091 render: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(HeadingTag, {}),
1092 variant: "heading-lg",
1093 children: title
1094 }
1095 ),
1096 breadcrumbs,
1097 badges
1098 ] }),
1099 actions && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1100 Stack,
1101 {
1102 align: "center",
1103 className: style_default3["header-actions"],
1104 direction: "row",
1105 gap: "sm",
1106 children: actions
1107 }
1108 )
1109 ]
1110 }
1111 ),
1112 subTitle && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1113 Text,
1114 {
1115 render: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", {}),
1116 variant: "body-md",
1117 className: style_default3["header-subtitle"],
1118 children: subTitle
1119 }
1120 )
1121 ] });
1122 }
1123
1124 // packages/admin-ui/build-module/page/index.mjs
1125 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
1126 var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
1127 function getRuntime4() {
1128 const globalScope = globalThis;
1129 if (globalScope.__wpStyleRuntime) {
1130 return globalScope.__wpStyleRuntime;
1131 }
1132 globalScope.__wpStyleRuntime = {
1133 documents: /* @__PURE__ */ new Map(),
1134 styles: /* @__PURE__ */ new Map(),
1135 injectedStyles: /* @__PURE__ */ new WeakMap()
1136 };
1137 if (typeof document !== "undefined") {
1138 registerDocument4(document);
1139 }
1140 return globalScope.__wpStyleRuntime;
1141 }
1142 function documentContainsStyleHash4(targetDocument, hash) {
1143 if (!targetDocument.head) {
1144 return false;
1145 }
1146 for (const style of targetDocument.head.querySelectorAll(
1147 `style[${STYLE_HASH_ATTRIBUTE4}]`
1148 )) {
1149 if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
1150 return true;
1151 }
1152 }
1153 return false;
1154 }
1155 function injectStyle4(targetDocument, hash, css) {
1156 if (!targetDocument.head) {
1157 return;
1158 }
1159 const runtime = getRuntime4();
1160 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1161 if (!injectedStyles) {
1162 injectedStyles = /* @__PURE__ */ new Set();
1163 runtime.injectedStyles.set(targetDocument, injectedStyles);
1164 }
1165 if (injectedStyles.has(hash)) {
1166 return;
1167 }
1168 if (documentContainsStyleHash4(targetDocument, hash)) {
1169 injectedStyles.add(hash);
1170 return;
1171 }
1172 const style = targetDocument.createElement("style");
1173 style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
1174 style.appendChild(targetDocument.createTextNode(css));
1175 targetDocument.head.appendChild(style);
1176 injectedStyles.add(hash);
1177 }
1178 function registerDocument4(targetDocument) {
1179 const runtime = getRuntime4();
1180 runtime.documents.set(
1181 targetDocument,
1182 (runtime.documents.get(targetDocument) ?? 0) + 1
1183 );
1184 for (const [hash, css] of runtime.styles) {
1185 injectStyle4(targetDocument, hash, css);
1186 }
1187 return () => {
1188 const count = runtime.documents.get(targetDocument);
1189 if (count === void 0) {
1190 return;
1191 }
1192 if (count <= 1) {
1193 runtime.documents.delete(targetDocument);
1194 return;
1195 }
1196 runtime.documents.set(targetDocument, count - 1);
1197 };
1198 }
1199 function registerStyle4(hash, css) {
1200 const runtime = getRuntime4();
1201 runtime.styles.set(hash, css);
1202 for (const targetDocument of runtime.documents.keys()) {
1203 injectStyle4(targetDocument, hash, css);
1204 }
1205 }
1206 if (typeof process === "undefined" || true) {
1207 registerStyle4("aa9c241ccc", "._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-bg-surface-neutral,#fcfcfc);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);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:calc(var(--wpds-dimension-base, 4px)*8)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8113be94e7caf73c__header-title{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:calc(var(--wpds-dimension-base, 4px)*6);width:calc(var(--wpds-dimension-base, 4px)*6);>*{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-fg-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}.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)}}");
1208 }
1209 var style_default4 = { "page": "_956b6df0898efed0__page", "header": "_0625b55e82a0d93d__header", "header-content": "a43c44d5ae28b2e8__header-content", "header-actions": "b7cb5b9daf3a3b25__header-actions", "header-title": "_8113be94e7caf73c__header-title", "header-visual": "_9a776c7f70996f61__header-visual", "sidebar-toggle-slot": "d5e0920cd15d35bc__sidebar-toggle-slot", "header-subtitle": "_60fea2f6bf5319cd__header-subtitle", "content": "be5e57d029ec4036__content", "has-padding": "_128806d0b26e3a50__has-padding" };
1210 function Page({
1211 headingLevel,
1212 breadcrumbs,
1213 badges,
1214 visual,
1215 title,
1216 subTitle,
1217 children,
1218 className,
1219 actions,
1220 ariaLabel,
1221 hasPadding = false,
1222 showSidebarToggle = true
1223 }) {
1224 const classes = clsx_default(style_default4.page, className);
1225 const effectiveAriaLabel = ariaLabel ?? (typeof title === "string" ? title : "");
1226 return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(navigable_region_default, { className: classes, ariaLabel: effectiveAriaLabel, children: [
1227 (title || breadcrumbs || badges || actions || visual) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1228 Header,
1229 {
1230 headingLevel,
1231 breadcrumbs,
1232 badges,
1233 visual,
1234 title,
1235 subTitle,
1236 actions,
1237 showSidebarToggle
1238 }
1239 ),
1240 hasPadding ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1241 "div",
1242 {
1243 className: clsx_default(
1244 style_default4.content,
1245 style_default4["has-padding"]
1246 ),
1247 children
1248 }
1249 ) : children
1250 ] });
1251 }
1252 Page.SidebarToggleFill = SidebarToggleFill;
1253 var page_default = Page;
1254
1255 // packages/boot/build-module/components/app/router.mjs
1256 var import_data11 = __toESM(require_data(), 1);
1257 var import_core_data6 = __toESM(require_core_data(), 1);
1258 import {
1259 privateApis as routePrivateApis6
1260 } from "@wordpress/route";
1261
1262 // packages/boot/build-module/components/root/index.mjs
1263 var import_notices = __toESM(require_notices(), 1);
1264 var import_compose4 = __toESM(require_compose(), 1);
1265 var import_components15 = __toESM(require_components(), 1);
1266 import { privateApis as routePrivateApis5 } from "@wordpress/route";
1267 var import_element15 = __toESM(require_element(), 1);
1268 var import_i18n11 = __toESM(require_i18n(), 1);
1269
1270 // packages/boot/build-module/components/sidebar/index.mjs
1271 var import_components11 = __toESM(require_components(), 1);
1272 var import_data9 = __toESM(require_data(), 1);
1273 var import_i18n7 = __toESM(require_i18n(), 1);
1274
1275 // packages/boot/build-module/components/site-hub/index.mjs
1276 var import_data3 = __toESM(require_data(), 1);
1277 var import_components3 = __toESM(require_components(), 1);
1278 var import_i18n2 = __toESM(require_i18n(), 1);
1279 var import_core_data2 = __toESM(require_core_data(), 1);
1280 var import_html_entities = __toESM(require_html_entities(), 1);
1281 var import_keycodes = __toESM(require_keycodes(), 1);
1282 var import_commands = __toESM(require_commands(), 1);
1283 var import_url = __toESM(require_url(), 1);
1284
1285 // packages/boot/build-module/components/site-icon-link/index.mjs
1286 var import_components2 = __toESM(require_components(), 1);
1287 import { Link, privateApis as routePrivateApis } from "@wordpress/route";
1288
1289 // packages/boot/build-module/lock-unlock.mjs
1290 var import_private_apis = __toESM(require_private_apis(), 1);
1291 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
1292 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
1293 "@wordpress/boot"
1294 );
1295
1296 // packages/boot/build-module/components/site-icon/index.mjs
1297 var import_data = __toESM(require_data(), 1);
1298 var import_i18n = __toESM(require_i18n(), 1);
1299 var import_core_data = __toESM(require_core_data(), 1);
1300 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
1301 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='3ada0e3b8a']")) {
1302 const style = document.createElement("style");
1303 style.setAttribute("data-wp-hash", "3ada0e3b8a");
1304 style.appendChild(document.createTextNode(".boot-site-icon{display:flex}.boot-site-icon__icon{fill:var(--wpds-color-fg-content-neutral,#1e1e1e);height:32px;width:32px}.boot-site-icon__image{aspect-ratio:1/1;border-radius:var(--wpds-border-radius-md,4px);height:32px;object-fit:cover;width:32px}"));
1305 document.head.appendChild(style);
1306 }
1307 function SiteIcon({ className }) {
1308 const { isRequestingSite, siteIconUrl } = (0, import_data.useSelect)((select) => {
1309 const { getEntityRecord } = select(import_core_data.store);
1310 const siteData = getEntityRecord(
1311 "root",
1312 "__unstableBase",
1313 void 0
1314 );
1315 return {
1316 isRequestingSite: !siteData,
1317 siteIconUrl: siteData?.site_icon_url
1318 };
1319 }, []);
1320 let icon = null;
1321 if (isRequestingSite && !siteIconUrl) {
1322 icon = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "boot-site-icon__image" });
1323 } else {
1324 icon = siteIconUrl ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1325 "img",
1326 {
1327 className: "boot-site-icon__image",
1328 alt: (0, import_i18n.__)("Site Icon"),
1329 src: siteIconUrl
1330 }
1331 ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1332 icon_default,
1333 {
1334 className: "boot-site-icon__icon",
1335 icon: wordpress_default,
1336 size: 48
1337 }
1338 );
1339 }
1340 return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: clsx_default(className, "boot-site-icon"), children: icon });
1341 }
1342 var site_icon_default = SiteIcon;
1343
1344 // packages/boot/build-module/components/site-icon-link/index.mjs
1345 var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
1346 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='5aacc86eea']")) {
1347 const style = document.createElement("style");
1348 style.setAttribute("data-wp-hash", "5aacc86eea");
1349 style.appendChild(document.createTextNode(".boot-site-icon-link{align-items:center;background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);display:inline-flex;height:64px;justify-content:center;text-decoration:none;width:64px}@media not (prefers-reduced-motion){.boot-site-icon-link{transition:outline .1s ease-out}}.boot-site-icon-link:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}"));
1350 document.head.appendChild(style);
1351 }
1352 var { useCanGoBack, useRouter } = unlock(routePrivateApis);
1353 function SiteIconLink({
1354 to,
1355 isBackButton,
1356 ...props
1357 }) {
1358 const router = useRouter();
1359 const canGoBack = useCanGoBack();
1360 return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components2.Tooltip, { text: props["aria-label"], placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1361 Link,
1362 {
1363 to,
1364 "aria-label": props["aria-label"],
1365 className: "boot-site-icon-link",
1366 onClick: (event) => {
1367 if (canGoBack && isBackButton) {
1368 event.preventDefault();
1369 router.history.back();
1370 }
1371 },
1372 children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(site_icon_default, {})
1373 }
1374 ) });
1375 }
1376 var site_icon_link_default = SiteIconLink;
1377
1378 // packages/boot/build-module/store/index.mjs
1379 var import_data2 = __toESM(require_data(), 1);
1380
1381 // packages/boot/build-module/store/reducer.mjs
1382 var initialState = {
1383 menuItems: {},
1384 routes: [],
1385 dashboardLink: void 0
1386 };
1387 function reducer(state = initialState, action) {
1388 switch (action.type) {
1389 case "REGISTER_MENU_ITEM":
1390 return {
1391 ...state,
1392 menuItems: {
1393 ...state.menuItems,
1394 [action.id]: action.menuItem
1395 }
1396 };
1397 case "UPDATE_MENU_ITEM":
1398 return {
1399 ...state,
1400 menuItems: {
1401 ...state.menuItems,
1402 [action.id]: {
1403 ...state.menuItems[action.id],
1404 ...action.updates
1405 }
1406 }
1407 };
1408 case "REGISTER_ROUTE":
1409 return {
1410 ...state,
1411 routes: [...state.routes, action.route]
1412 };
1413 case "SET_DASHBOARD_LINK":
1414 return {
1415 ...state,
1416 dashboardLink: action.dashboardLink
1417 };
1418 }
1419 return state;
1420 }
1421
1422 // packages/boot/build-module/store/actions.mjs
1423 var actions_exports = {};
1424 __export(actions_exports, {
1425 registerMenuItem: () => registerMenuItem,
1426 registerRoute: () => registerRoute,
1427 setDashboardLink: () => setDashboardLink,
1428 updateMenuItem: () => updateMenuItem
1429 });
1430 function registerMenuItem(id, menuItem) {
1431 return {
1432 type: "REGISTER_MENU_ITEM",
1433 id,
1434 menuItem
1435 };
1436 }
1437 function updateMenuItem(id, updates) {
1438 return {
1439 type: "UPDATE_MENU_ITEM",
1440 id,
1441 updates
1442 };
1443 }
1444 function registerRoute(route) {
1445 return {
1446 type: "REGISTER_ROUTE",
1447 route
1448 };
1449 }
1450 function setDashboardLink(dashboardLink) {
1451 return {
1452 type: "SET_DASHBOARD_LINK",
1453 dashboardLink
1454 };
1455 }
1456
1457 // packages/boot/build-module/store/selectors.mjs
1458 var selectors_exports = {};
1459 __export(selectors_exports, {
1460 getDashboardLink: () => getDashboardLink,
1461 getMenuItems: () => getMenuItems,
1462 getRoutes: () => getRoutes
1463 });
1464 function getMenuItems(state) {
1465 return Object.values(state.menuItems);
1466 }
1467 function getRoutes(state) {
1468 return state.routes;
1469 }
1470 function getDashboardLink(state) {
1471 return state.dashboardLink;
1472 }
1473
1474 // packages/boot/build-module/store/index.mjs
1475 var STORE_NAME = "wordpress/boot";
1476 var store = (0, import_data2.createReduxStore)(STORE_NAME, {
1477 reducer,
1478 actions: actions_exports,
1479 selectors: selectors_exports
1480 });
1481 (0, import_data2.register)(store);
1482
1483 // packages/boot/build-module/components/site-hub/index.mjs
1484 var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
1485 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='bc60675bd6']")) {
1486 const style = document.createElement("style");
1487 style.setAttribute("data-wp-hash", "bc60675bd6");
1488 style.appendChild(document.createTextNode(".boot-site-hub{align-items:center;background-color:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);display:grid;flex-shrink:0;grid-template-columns:60px 1fr auto;padding-right:16px;position:sticky;top:0;z-index:1}.boot-site-hub__actions{flex-shrink:0}.boot-site-hub__title{align-items:center;display:flex;text-decoration:none}.boot-site-hub__title .components-external-link__contents{margin-inline-start:4px;max-width:140px;overflow:hidden;text-decoration:none}.boot-site-hub__title .components-external-link__icon{opacity:0;transition:opacity .1s ease-out}.boot-site-hub__title:hover .components-external-link__icon{opacity:1}@media not (prefers-reduced-motion){.boot-site-hub__title{transition:outline .1s ease-out}}.boot-site-hub__title:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}.boot-site-hub__title-text{color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-size:13px;font-weight:499}.boot-site-hub__title-text,.boot-site-hub__url{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.boot-site-hub__url{color:var(--wpds-color-fg-content-neutral-weak,#707070);font-size:12px}"));
1489 document.head.appendChild(style);
1490 }
1491 function SiteHub() {
1492 const { dashboardLink, homeUrl, siteTitle } = (0, import_data3.useSelect)((select) => {
1493 const { getEntityRecord } = select(import_core_data2.store);
1494 const _base = getEntityRecord(
1495 "root",
1496 "__unstableBase"
1497 );
1498 return {
1499 dashboardLink: select(store).getDashboardLink(),
1500 homeUrl: _base?.home,
1501 siteTitle: !_base?.name && !!_base?.url ? (0, import_url.filterURLForDisplay)(_base?.url) : _base?.name
1502 };
1503 }, []);
1504 const { open: openCommandCenter } = (0, import_data3.useDispatch)(import_commands.store);
1505 return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "boot-site-hub", children: [
1506 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1507 site_icon_link_default,
1508 {
1509 to: dashboardLink || "/",
1510 "aria-label": (0, import_i18n2.__)("Go to the Dashboard")
1511 }
1512 ),
1513 /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1514 import_components3.ExternalLink,
1515 {
1516 href: homeUrl ?? "/",
1517 className: "boot-site-hub__title",
1518 children: [
1519 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "boot-site-hub__title-text", children: siteTitle && (0, import_html_entities.decodeEntities)(siteTitle) }),
1520 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "boot-site-hub__url", children: (0, import_url.filterURLForDisplay)(homeUrl ?? "") })
1521 ]
1522 }
1523 ),
1524 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components3.__experimentalHStack, { className: "boot-site-hub__actions", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1525 import_components3.Button,
1526 {
1527 variant: "tertiary",
1528 icon: search_default,
1529 onClick: () => openCommandCenter(),
1530 size: "compact",
1531 label: (0, import_i18n2.__)("Open command palette"),
1532 shortcut: import_keycodes.displayShortcut.primary("k")
1533 }
1534 ) })
1535 ] });
1536 }
1537 var site_hub_default = SiteHub;
1538
1539 // packages/boot/build-module/components/navigation/index.mjs
1540 var import_element8 = __toESM(require_element(), 1);
1541 var import_data6 = __toESM(require_data(), 1);
1542
1543 // packages/boot/build-module/components/navigation/navigation-item/index.mjs
1544 var import_components6 = __toESM(require_components(), 1);
1545
1546 // packages/boot/build-module/components/navigation/router-link-item.mjs
1547 var import_element5 = __toESM(require_element(), 1);
1548 var import_components4 = __toESM(require_components(), 1);
1549 import { privateApis as routePrivateApis2 } from "@wordpress/route";
1550 var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
1551 var { createLink } = unlock(routePrivateApis2);
1552 function AnchorOnlyItem(props, forwardedRef) {
1553 return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components4.__experimentalItem, { as: "a", ref: forwardedRef, ...props });
1554 }
1555 var RouterLinkItem = createLink((0, import_element5.forwardRef)(AnchorOnlyItem));
1556 var router_link_item_default = RouterLinkItem;
1557
1558 // packages/boot/build-module/components/navigation/items.mjs
1559 var import_element6 = __toESM(require_element(), 1);
1560 var import_components5 = __toESM(require_components(), 1);
1561 var import_primitives12 = __toESM(require_primitives(), 1);
1562 var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
1563 function isSvg(element) {
1564 return (0, import_element6.isValidElement)(element) && (element.type === import_primitives12.SVG || element.type === "svg");
1565 }
1566 function wrapIcon(icon, shouldShowPlaceholder = true) {
1567 if (isSvg(icon)) {
1568 return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components5.Icon, { icon });
1569 }
1570 if (typeof icon === "string" && icon.startsWith("dashicons-")) {
1571 const iconKey = icon.replace(
1572 /^dashicons-/,
1573 ""
1574 );
1575 return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1576 import_components5.Dashicon,
1577 {
1578 style: { padding: "2px" },
1579 icon: iconKey,
1580 "aria-hidden": "true"
1581 }
1582 );
1583 }
1584 if (typeof icon === "string" && icon.startsWith("data:")) {
1585 return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1586 "img",
1587 {
1588 src: icon,
1589 alt: "",
1590 "aria-hidden": "true",
1591 style: {
1592 width: "20px",
1593 height: "20px",
1594 display: "block",
1595 padding: "2px"
1596 }
1597 }
1598 );
1599 }
1600 if (icon) {
1601 return icon;
1602 }
1603 if (shouldShowPlaceholder) {
1604 return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1605 "div",
1606 {
1607 style: { width: "24px", height: "24px" },
1608 "aria-hidden": "true"
1609 }
1610 );
1611 }
1612 return null;
1613 }
1614
1615 // packages/boot/build-module/components/navigation/navigation-item/index.mjs
1616 var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
1617 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='26b8e27d3f']")) {
1618 const style = document.createElement("style");
1619 style.setAttribute("data-wp-hash", "26b8e27d3f");
1620 style.appendChild(document.createTextNode('.boot-navigation-item.components-item{align-items:center;border:none;color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:400;line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.boot-dropdown-item__children .boot-navigation-item.components-item{min-height:24px}.boot-navigation-item.components-item{border-radius:var(--wpds-border-radius-sm,2px)}.boot-navigation-item.components-item.active,.boot-navigation-item.components-item:focus,.boot-navigation-item.components-item:hover,.boot-navigation-item.components-item[aria-current=true]{color:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9))}.boot-navigation-item.components-item.active{font-weight:499}.boot-navigation-item.components-item svg:last-child{padding:4px}.boot-navigation-item.components-item[aria-current=true]{color:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9));font-weight:499}.boot-navigation-item.components-item:focus-visible{transform:translateZ(0)}.boot-navigation-item.components-item.with-suffix{padding-right:16px}'));
1621 document.head.appendChild(style);
1622 }
1623 function NavigationItem({
1624 className,
1625 icon,
1626 shouldShowPlaceholder = true,
1627 children,
1628 to
1629 }) {
1630 const isExternal = !String(
1631 new URL(to, window.location.origin)
1632 ).startsWith(window.location.origin);
1633 const content = /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_components6.__experimentalHStack, { justify: "flex-start", spacing: 2, style: { flexGrow: "1" }, children: [
1634 wrapIcon(icon, shouldShowPlaceholder),
1635 /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_components6.FlexBlock, { children })
1636 ] });
1637 if (isExternal) {
1638 return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1639 import_components6.__experimentalItem,
1640 {
1641 as: "a",
1642 href: to,
1643 className: clsx_default("boot-navigation-item", className),
1644 children: content
1645 }
1646 );
1647 }
1648 return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1649 router_link_item_default,
1650 {
1651 to,
1652 className: clsx_default("boot-navigation-item", className),
1653 children: content
1654 }
1655 );
1656 }
1657
1658 // packages/boot/build-module/components/navigation/drilldown-item/index.mjs
1659 var import_components7 = __toESM(require_components(), 1);
1660 var import_i18n3 = __toESM(require_i18n(), 1);
1661 var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
1662 function DrilldownItem({
1663 className,
1664 id,
1665 icon,
1666 shouldShowPlaceholder = true,
1667 children,
1668 onNavigate
1669 }) {
1670 const handleClick = (e) => {
1671 e.preventDefault();
1672 onNavigate({ id, direction: "forward" });
1673 };
1674 return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1675 import_components7.__experimentalItem,
1676 {
1677 className: clsx_default("boot-navigation-item", className),
1678 onClick: handleClick,
1679 children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
1680 import_components7.__experimentalHStack,
1681 {
1682 justify: "flex-start",
1683 spacing: 2,
1684 style: { flexGrow: "1" },
1685 children: [
1686 wrapIcon(icon, shouldShowPlaceholder),
1687 /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components7.FlexBlock, { children }),
1688 /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1689 import_components7.Icon,
1690 {
1691 icon: (0, import_i18n3.isRTL)() ? chevron_left_small_default : chevron_right_small_default
1692 }
1693 )
1694 ]
1695 }
1696 )
1697 }
1698 );
1699 }
1700
1701 // packages/boot/build-module/components/navigation/dropdown-item/index.mjs
1702 var import_components8 = __toESM(require_components(), 1);
1703 var import_compose = __toESM(require_compose(), 1);
1704 var import_data4 = __toESM(require_data(), 1);
1705 var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
1706 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='608eff82f3']")) {
1707 const style = document.createElement("style");
1708 style.setAttribute("data-wp-hash", "608eff82f3");
1709 style.appendChild(document.createTextNode(".boot-dropdown-item__children{display:flex;flex-direction:column;margin-block-end:2px;margin-block-start:-2px;margin-inline-start:30px;overflow:hidden;padding:2px}.boot-dropdown-item__chevron.is-up{transform:rotate(180deg)}"));
1710 document.head.appendChild(style);
1711 }
1712 var ANIMATION_DURATION = 0.2;
1713 function DropdownItem({
1714 className,
1715 id,
1716 icon,
1717 children,
1718 isExpanded,
1719 onToggle
1720 }) {
1721 const menuItems = (0, import_data4.useSelect)(
1722 (select) => (
1723 // @ts-ignore
1724 select(STORE_NAME).getMenuItems()
1725 ),
1726 []
1727 );
1728 const items = menuItems.filter((item) => item.parent === id);
1729 const disableMotion = (0, import_compose.useReducedMotion)();
1730 return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "boot-dropdown-item", children: [
1731 /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1732 import_components8.__experimentalItem,
1733 {
1734 className: clsx_default("boot-navigation-item", className),
1735 onClick: (e) => {
1736 e.preventDefault();
1737 e.stopPropagation();
1738 onToggle();
1739 },
1740 onMouseDown: (e) => e.preventDefault(),
1741 children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
1742 import_components8.__experimentalHStack,
1743 {
1744 justify: "flex-start",
1745 spacing: 2,
1746 style: { flexGrow: "1" },
1747 children: [
1748 wrapIcon(icon, false),
1749 /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components8.FlexBlock, { children }),
1750 /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1751 import_components8.Icon,
1752 {
1753 icon: chevron_down_small_default,
1754 className: clsx_default("boot-dropdown-item__chevron", {
1755 "is-up": isExpanded
1756 })
1757 }
1758 )
1759 ]
1760 }
1761 )
1762 }
1763 ),
1764 /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components8.__unstableAnimatePresence, { initial: false, children: isExpanded && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1765 import_components8.__unstableMotion.div,
1766 {
1767 initial: { height: 0 },
1768 animate: { height: "auto" },
1769 exit: { height: 0 },
1770 transition: {
1771 type: "tween",
1772 duration: disableMotion ? 0 : ANIMATION_DURATION,
1773 ease: "easeOut"
1774 },
1775 className: "boot-dropdown-item__children",
1776 children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1777 NavigationItem,
1778 {
1779 to: item.to,
1780 shouldShowPlaceholder: false,
1781 children: item.label
1782 },
1783 index
1784 ))
1785 }
1786 ) })
1787 ] });
1788 }
1789
1790 // packages/boot/build-module/components/navigation/navigation-screen/index.mjs
1791 var import_components9 = __toESM(require_components(), 1);
1792 var import_i18n4 = __toESM(require_i18n(), 1);
1793 var import_compose2 = __toESM(require_compose(), 1);
1794 var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
1795 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='c5e42e1495']")) {
1796 const style = document.createElement("style");
1797 style.setAttribute("data-wp-hash", "c5e42e1495");
1798 style.appendChild(document.createTextNode(".boot-navigation-screen{padding-block-end:4px}.boot-navigation-screen .components-text{color:var(--wpds-color-fg-content-neutral,#1e1e1e)}.boot-navigation-screen__title-icon{padding:12px 16px 8px;position:sticky;top:0}.boot-navigation-screen__title{flex-grow:1;overflow-wrap:break-word}.boot-navigation-screen__title.boot-navigation-screen__title,.boot-navigation-screen__title.boot-navigation-screen__title .boot-navigation-screen__title{color:var(--wpds-color-fg-content-neutral,#1e1e1e);line-height:32px}.boot-navigation-screen__actions{display:flex;flex-shrink:0}"));
1799 document.head.appendChild(style);
1800 }
1801 var ANIMATION_DURATION2 = 0.3;
1802 var slideVariants = {
1803 initial: (direction) => ({
1804 x: direction === "forward" ? 100 : -100,
1805 opacity: 0
1806 }),
1807 animate: {
1808 x: 0,
1809 opacity: 1
1810 },
1811 exit: (direction) => ({
1812 x: direction === "forward" ? 100 : -100,
1813 opacity: 0
1814 })
1815 };
1816 function NavigationScreen({
1817 isRoot,
1818 title,
1819 actions,
1820 content,
1821 description,
1822 animationDirection,
1823 backMenuItem,
1824 backButtonRef,
1825 navigationKey,
1826 onNavigate
1827 }) {
1828 const icon = (0, import_i18n4.isRTL)() ? chevron_right_default : chevron_left_default;
1829 const disableMotion = (0, import_compose2.useReducedMotion)();
1830 const handleBackClick = (e) => {
1831 e.preventDefault();
1832 onNavigate({ id: backMenuItem, direction: "backward" });
1833 };
1834 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1835 "div",
1836 {
1837 className: "boot-navigation-screen",
1838 style: {
1839 overflow: "hidden",
1840 position: "relative",
1841 display: "grid",
1842 gridTemplateColumns: "1fr",
1843 gridTemplateRows: "1fr"
1844 },
1845 children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.__unstableAnimatePresence, { initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
1846 import_components9.__unstableMotion.div,
1847 {
1848 custom: animationDirection,
1849 variants: slideVariants,
1850 initial: "initial",
1851 animate: "animate",
1852 exit: "exit",
1853 transition: {
1854 type: "tween",
1855 duration: disableMotion ? 0 : ANIMATION_DURATION2,
1856 ease: [0.33, 0, 0, 1]
1857 },
1858 style: {
1859 width: "100%",
1860 gridColumn: "1",
1861 gridRow: "1"
1862 },
1863 children: [
1864 /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
1865 import_components9.__experimentalHStack,
1866 {
1867 spacing: 2,
1868 className: "boot-navigation-screen__title-icon",
1869 children: [
1870 !isRoot && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1871 import_components9.Button,
1872 {
1873 ref: backButtonRef,
1874 icon,
1875 onClick: handleBackClick,
1876 label: (0, import_i18n4.__)("Back"),
1877 size: "small",
1878 variant: "tertiary"
1879 }
1880 ),
1881 /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1882 import_components9.__experimentalHeading,
1883 {
1884 className: "boot-navigation-screen__title",
1885 level: 1,
1886 size: "15px",
1887 children: title
1888 }
1889 ),
1890 actions && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "boot-navigation-screen__actions", children: actions })
1891 ]
1892 }
1893 ),
1894 description && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "boot-navigation-screen__description", children: description }),
1895 content
1896 ]
1897 },
1898 navigationKey
1899 ) })
1900 }
1901 );
1902 }
1903
1904 // packages/boot/build-module/components/navigation/use-sidebar-parent.mjs
1905 var import_element7 = __toESM(require_element(), 1);
1906 var import_data5 = __toESM(require_data(), 1);
1907 import { privateApis as routePrivateApis3 } from "@wordpress/route";
1908
1909 // packages/boot/build-module/components/navigation/path-matching.mjs
1910 var isValidParentPath = (currentPath, menuPath) => {
1911 if (!menuPath || menuPath === currentPath) {
1912 return false;
1913 }
1914 const normalizePath = (path) => {
1915 const normalized = path.startsWith("/") ? path : "/" + path;
1916 return normalized.endsWith("/") && normalized.length > 1 ? normalized.slice(0, -1) : normalized;
1917 };
1918 const normalizedCurrent = normalizePath(currentPath);
1919 const normalizedMenu = normalizePath(menuPath);
1920 return normalizedCurrent.startsWith(normalizedMenu) && (normalizedCurrent[normalizedMenu.length] === "/" || normalizedMenu === "/");
1921 };
1922 var findClosestMenuItem = (currentPath, menuItems) => {
1923 const exactMatch = menuItems.find((item) => item.to === currentPath);
1924 if (exactMatch) {
1925 return exactMatch;
1926 }
1927 let bestMatch = null;
1928 let bestPathLength = 0;
1929 for (const item of menuItems) {
1930 if (!item.to) {
1931 continue;
1932 }
1933 if (isValidParentPath(currentPath, item.to)) {
1934 if (item.to.length > bestPathLength) {
1935 bestMatch = item;
1936 bestPathLength = item.to.length;
1937 }
1938 }
1939 }
1940 return bestMatch;
1941 };
1942 var findDrilldownParent = (id, menuItems) => {
1943 if (!id) {
1944 return void 0;
1945 }
1946 const currentItem = menuItems.find((item) => item.id === id);
1947 if (!currentItem) {
1948 return void 0;
1949 }
1950 if (currentItem.parent) {
1951 const parentItem = menuItems.find(
1952 (item) => item.id === currentItem.parent
1953 );
1954 if (parentItem?.parent_type === "drilldown") {
1955 return parentItem.id;
1956 }
1957 if (parentItem) {
1958 return findDrilldownParent(parentItem.id, menuItems);
1959 }
1960 }
1961 return void 0;
1962 };
1963 var findDropdownParent = (id, menuItems) => {
1964 if (!id) {
1965 return void 0;
1966 }
1967 const currentItem = menuItems.find((item) => item.id === id);
1968 if (!currentItem) {
1969 return void 0;
1970 }
1971 if (currentItem.parent) {
1972 const parentItem = menuItems.find(
1973 (item) => item.id === currentItem.parent
1974 );
1975 if (parentItem?.parent_type === "dropdown") {
1976 return parentItem.id;
1977 }
1978 }
1979 return void 0;
1980 };
1981
1982 // packages/boot/build-module/components/navigation/use-sidebar-parent.mjs
1983 var { useRouter: useRouter2, useMatches } = unlock(routePrivateApis3);
1984 function useSidebarParent() {
1985 const matches = useMatches();
1986 const router = useRouter2();
1987 const menuItems = (0, import_data5.useSelect)(
1988 (select) => (
1989 // @ts-ignore
1990 select(STORE_NAME).getMenuItems()
1991 ),
1992 []
1993 );
1994 const currentPath = matches[matches.length - 1].pathname.slice(
1995 router.options.basepath?.length ?? 0
1996 );
1997 const currentMenuItem = findClosestMenuItem(currentPath, menuItems);
1998 const [parentId, setParentId] = (0, import_element7.useState)(
1999 findDrilldownParent(currentMenuItem?.id, menuItems)
2000 );
2001 const [parentDropdownId, setParentDropdownId] = (0, import_element7.useState)(findDropdownParent(currentMenuItem?.id, menuItems));
2002 (0, import_element7.useEffect)(() => {
2003 const matchedMenuItem = findClosestMenuItem(currentPath, menuItems);
2004 const updatedParentId = findDrilldownParent(
2005 matchedMenuItem?.id,
2006 menuItems
2007 );
2008 const updatedDropdownParent = findDropdownParent(
2009 matchedMenuItem?.id,
2010 menuItems
2011 );
2012 setParentId(updatedParentId);
2013 setParentDropdownId(updatedDropdownParent);
2014 }, [currentPath, menuItems]);
2015 return [
2016 parentId,
2017 setParentId,
2018 parentDropdownId,
2019 setParentDropdownId
2020 ];
2021 }
2022
2023 // packages/boot/build-module/components/navigation/index.mjs
2024 var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
2025 function Navigation() {
2026 const backButtonRef = (0, import_element8.useRef)(null);
2027 const [animationDirection, setAnimationDirection] = (0, import_element8.useState)(null);
2028 const [parentId, setParentId, parentDropdownId, setParentDropdownId] = useSidebarParent();
2029 const menuItems = (0, import_data6.useSelect)(
2030 (select) => (
2031 // @ts-ignore
2032 select(STORE_NAME).getMenuItems()
2033 ),
2034 []
2035 );
2036 const parent = (0, import_element8.useMemo)(
2037 () => menuItems.find((item) => item.id === parentId),
2038 [menuItems, parentId]
2039 );
2040 const navigationKey = parent ? `drilldown-${parent.id}` : "root";
2041 const handleNavigate = ({
2042 id,
2043 direction
2044 }) => {
2045 setAnimationDirection(direction);
2046 setParentId(id);
2047 };
2048 const handleDropdownToggle = (dropdownId) => {
2049 setParentDropdownId(
2050 parentDropdownId === dropdownId ? void 0 : dropdownId
2051 );
2052 };
2053 const items = (0, import_element8.useMemo)(
2054 () => menuItems.filter((item) => item.parent === parentId),
2055 [menuItems, parentId]
2056 );
2057 const hasRealIcons = items.some((item) => !!item.icon);
2058 return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2059 NavigationScreen,
2060 {
2061 isRoot: !parent,
2062 title: parent ? parent.label : "",
2063 backMenuItem: parent?.parent,
2064 backButtonRef,
2065 animationDirection: animationDirection || void 0,
2066 navigationKey,
2067 onNavigate: handleNavigate,
2068 content: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: items.map((item) => {
2069 if (item.parent_type === "dropdown") {
2070 return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2071 DropdownItem,
2072 {
2073 id: item.id,
2074 className: "boot-navigation-item",
2075 icon: item.icon,
2076 shouldShowPlaceholder: hasRealIcons,
2077 isExpanded: parentDropdownId === item.id,
2078 onToggle: () => handleDropdownToggle(item.id),
2079 children: item.label
2080 },
2081 item.id
2082 );
2083 }
2084 if (item.parent_type === "drilldown") {
2085 return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2086 DrilldownItem,
2087 {
2088 id: item.id,
2089 icon: item.icon,
2090 shouldShowPlaceholder: hasRealIcons,
2091 onNavigate: handleNavigate,
2092 children: item.label
2093 },
2094 item.id
2095 );
2096 }
2097 return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2098 NavigationItem,
2099 {
2100 to: item.to,
2101 icon: item.icon,
2102 shouldShowPlaceholder: hasRealIcons,
2103 children: item.label
2104 },
2105 item.id
2106 );
2107 }) })
2108 }
2109 );
2110 }
2111 var navigation_default = Navigation;
2112
2113 // packages/boot/build-module/components/save-button/index.mjs
2114 var import_element10 = __toESM(require_element(), 1);
2115 var import_data8 = __toESM(require_data(), 1);
2116 var import_i18n6 = __toESM(require_i18n(), 1);
2117 var import_core_data4 = __toESM(require_core_data(), 1);
2118 var import_keycodes2 = __toESM(require_keycodes(), 1);
2119 var import_editor2 = __toESM(require_editor(), 1);
2120 var import_components10 = __toESM(require_components(), 1);
2121
2122 // packages/boot/build-module/components/save-panel/use-save-shortcut.mjs
2123 var import_element9 = __toESM(require_element(), 1);
2124 var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1);
2125 var import_i18n5 = __toESM(require_i18n(), 1);
2126 var import_data7 = __toESM(require_data(), 1);
2127 var import_core_data3 = __toESM(require_core_data(), 1);
2128 var import_editor = __toESM(require_editor(), 1);
2129 var shortcutName = "core/boot/save";
2130 function useSaveShortcut({
2131 openSavePanel
2132 }) {
2133 const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } = (0, import_data7.useSelect)(import_core_data3.store);
2134 const { hasNonPostEntityChanges, isPostSavingLocked } = (0, import_data7.useSelect)(import_editor.store);
2135 const { savePost } = (0, import_data7.useDispatch)(import_editor.store);
2136 const { registerShortcut, unregisterShortcut } = (0, import_data7.useDispatch)(
2137 import_keyboard_shortcuts.store
2138 );
2139 (0, import_element9.useEffect)(() => {
2140 registerShortcut({
2141 name: shortcutName,
2142 category: "global",
2143 description: (0, import_i18n5.__)("Save your changes."),
2144 keyCombination: {
2145 modifier: "primary",
2146 character: "s"
2147 }
2148 });
2149 return () => {
2150 unregisterShortcut(shortcutName);
2151 };
2152 }, [registerShortcut, unregisterShortcut]);
2153 (0, import_keyboard_shortcuts.useShortcut)(shortcutName, (event) => {
2154 event.preventDefault();
2155 const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
2156 const hasDirtyEntities = !!dirtyEntityRecords.length;
2157 const isSaving = dirtyEntityRecords.some(
2158 (record) => isSavingEntityRecord(record.kind, record.name, record.key)
2159 );
2160 if (!hasDirtyEntities || isSaving) {
2161 return;
2162 }
2163 if (hasNonPostEntityChanges()) {
2164 openSavePanel();
2165 } else if (!isPostSavingLocked()) {
2166 savePost();
2167 }
2168 });
2169 }
2170
2171 // packages/boot/build-module/components/save-button/index.mjs
2172 var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
2173 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='294e36b777']")) {
2174 const style = document.createElement("style");
2175 style.setAttribute("data-wp-hash", "294e36b777");
2176 style.appendChild(document.createTextNode(".boot-save-button{width:100%}"));
2177 document.head.appendChild(style);
2178 }
2179 function SaveButton() {
2180 const [isSaveViewOpen, setIsSaveViewOpened] = (0, import_element10.useState)(false);
2181 const { isSaving, dirtyEntityRecordsCount } = (0, import_data8.useSelect)((select) => {
2182 const { isSavingEntityRecord, __experimentalGetDirtyEntityRecords } = select(import_core_data4.store);
2183 const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
2184 return {
2185 isSaving: dirtyEntityRecords.some(
2186 (record) => isSavingEntityRecord(record.kind, record.name, record.key)
2187 ),
2188 dirtyEntityRecordsCount: dirtyEntityRecords.length
2189 };
2190 }, []);
2191 const [showSavedState, setShowSavedState] = (0, import_element10.useState)(false);
2192 (0, import_element10.useEffect)(() => {
2193 if (isSaving) {
2194 setShowSavedState(true);
2195 }
2196 }, [isSaving]);
2197 const hasChanges = dirtyEntityRecordsCount > 0;
2198 (0, import_element10.useEffect)(() => {
2199 if (!isSaving && hasChanges) {
2200 setShowSavedState(false);
2201 }
2202 }, [isSaving, hasChanges]);
2203 function hideSavedState() {
2204 if (showSavedState) {
2205 setShowSavedState(false);
2206 }
2207 }
2208 const shouldShowButton = hasChanges || showSavedState;
2209 useSaveShortcut({ openSavePanel: () => setIsSaveViewOpened(true) });
2210 if (!shouldShowButton) {
2211 return null;
2212 }
2213 const isInSavedState = showSavedState && !hasChanges;
2214 const disabled = isSaving || isInSavedState;
2215 const getLabel = () => {
2216 if (isInSavedState) {
2217 return (0, import_i18n6.__)("Saved");
2218 }
2219 return (0, import_i18n6.sprintf)(
2220 // translators: %d: number of unsaved changes (number).
2221 (0, import_i18n6._n)(
2222 "Review %d change\u2026",
2223 "Review %d changes\u2026",
2224 dirtyEntityRecordsCount
2225 ),
2226 dirtyEntityRecordsCount
2227 );
2228 };
2229 const label = getLabel();
2230 return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
2231 /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2232 import_components10.Tooltip,
2233 {
2234 text: hasChanges ? label : void 0,
2235 shortcut: import_keycodes2.displayShortcut.primary("s"),
2236 children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2237 import_components10.Button,
2238 {
2239 variant: "primary",
2240 size: "compact",
2241 onClick: () => setIsSaveViewOpened(true),
2242 onBlur: hideSavedState,
2243 disabled,
2244 accessibleWhenDisabled: true,
2245 isBusy: isSaving,
2246 "aria-keyshortcuts": import_keycodes2.rawShortcut.primary("s"),
2247 className: "boot-save-button",
2248 icon: isInSavedState ? check_default : void 0,
2249 children: label
2250 }
2251 )
2252 }
2253 ),
2254 isSaveViewOpen && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2255 import_components10.Modal,
2256 {
2257 title: (0, import_i18n6.__)("Review changes"),
2258 onRequestClose: () => setIsSaveViewOpened(false),
2259 size: "small",
2260 children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2261 import_editor2.EntitiesSavedStates,
2262 {
2263 close: () => setIsSaveViewOpened(false),
2264 variant: "inline"
2265 }
2266 )
2267 }
2268 )
2269 ] });
2270 }
2271
2272 // packages/boot/build-module/components/sidebar/index.mjs
2273 var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
2274 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='1f27eae1b9']")) {
2275 const style = document.createElement("style");
2276 style.setAttribute("data-wp-hash", "1f27eae1b9");
2277 style.appendChild(document.createTextNode(".boot-sidebar__scrollable{display:flex;flex-direction:column;height:100%;overflow:auto;position:relative}.boot-sidebar__content{contain:content;flex-grow:1;position:relative}.boot-sidebar__footer{padding:16px 8px 8px 16px}.boot-sidebar__back-button{margin:8px 12px}"));
2278 document.head.appendChild(style);
2279 }
2280 function DashboardBackButton() {
2281 const dashboardLink = (0, import_data9.useSelect)(
2282 (select) => select(store).getDashboardLink(),
2283 []
2284 );
2285 return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2286 import_components11.Button,
2287 {
2288 __next40pxDefaultSize: true,
2289 className: "boot-sidebar__back-button",
2290 href: dashboardLink || "/",
2291 icon: (0, import_i18n7.isRTL)() ? chevron_right_default : chevron_left_default,
2292 label: (0, import_i18n7.__)("Go to the Dashboard"),
2293 children: (0, import_i18n7.__)("Dashboard")
2294 }
2295 );
2296 }
2297 function Sidebar() {
2298 const hasAdminBarInEditor = window.__experimentalAdminBarInEditor;
2299 return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "boot-sidebar__scrollable", children: [
2300 hasAdminBarInEditor ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DashboardBackButton, {}) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(site_hub_default, {}),
2301 /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "boot-sidebar__content", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(navigation_default, {}) }),
2302 /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "boot-sidebar__footer", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SaveButton, {}) })
2303 ] });
2304 }
2305
2306 // packages/boot/build-module/components/save-panel/index.mjs
2307 var import_element11 = __toESM(require_element(), 1);
2308 var import_components12 = __toESM(require_components(), 1);
2309 var import_editor3 = __toESM(require_editor(), 1);
2310 var import_i18n8 = __toESM(require_i18n(), 1);
2311 var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
2312 function SavePanel() {
2313 const [isOpen, setIsOpen] = (0, import_element11.useState)(false);
2314 useSaveShortcut({
2315 openSavePanel: () => setIsOpen(true)
2316 });
2317 if (!isOpen) {
2318 return false;
2319 }
2320 return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2321 import_components12.Modal,
2322 {
2323 className: "edit-site-save-panel__modal",
2324 onRequestClose: () => setIsOpen(false),
2325 title: (0, import_i18n8.__)("Review changes"),
2326 size: "small",
2327 children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2328 import_editor3.EntitiesSavedStates,
2329 {
2330 close: () => setIsOpen(false),
2331 variant: "inline"
2332 }
2333 )
2334 }
2335 );
2336 }
2337
2338 // packages/boot/build-module/components/canvas-renderer/index.mjs
2339 var import_element13 = __toESM(require_element(), 1);
2340
2341 // packages/boot/build-module/components/canvas/index.mjs
2342 var import_element12 = __toESM(require_element(), 1);
2343 var import_components14 = __toESM(require_components(), 1);
2344 import { useNavigate } from "@wordpress/route";
2345
2346 // packages/boot/build-module/components/canvas/back-button.mjs
2347 var import_components13 = __toESM(require_components(), 1);
2348 var import_compose3 = __toESM(require_compose(), 1);
2349 var import_i18n9 = __toESM(require_i18n(), 1);
2350 var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
2351 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='c8750e18d1']")) {
2352 const style = document.createElement("style");
2353 style.setAttribute("data-wp-hash", "c8750e18d1");
2354 style.appendChild(document.createTextNode(".boot-canvas-back-button{height:64px;left:0;position:absolute;top:0;width:64px;z-index:100}.boot-canvas-back-button__container{height:100%;position:relative;width:100%}.boot-canvas-back-button__link.components-button{align-items:center;background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);border-radius:0;display:inline-flex;height:64px;justify-content:center;padding:0;text-decoration:none;width:64px}@media not (prefers-reduced-motion){.boot-canvas-back-button__link.components-button{transition:outline .1s ease-out}}.boot-canvas-back-button__link.components-button:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}.boot-canvas-back-button__icon{align-items:center;background-color:#ccc;display:flex;height:64px;justify-content:center;left:0;pointer-events:none;position:absolute;top:0;width:64px}.boot-canvas-back-button__icon svg{fill:currentColor}.boot-canvas-back-button__icon.has-site-icon{-webkit-backdrop-filter:saturate(180%) blur(15px);backdrop-filter:saturate(180%) blur(15px);background-color:#fff9}.interface-interface-skeleton__header{margin-top:0!important}"));
2355 document.head.appendChild(style);
2356 }
2357 var toggleHomeIconVariants = {
2358 edit: {
2359 opacity: 0,
2360 scale: 0.2
2361 },
2362 hover: {
2363 opacity: 1,
2364 scale: 1,
2365 clipPath: "inset( 22% round 2px )"
2366 }
2367 };
2368 function BootBackButton({ length }) {
2369 const disableMotion = (0, import_compose3.useReducedMotion)();
2370 const hasAdminBarInEditor = window.__experimentalAdminBarInEditor;
2371 const handleBack = () => {
2372 window.history.back();
2373 };
2374 if (length > 1) {
2375 return null;
2376 }
2377 const transition = {
2378 duration: disableMotion ? 0 : 0.3
2379 };
2380 const arrowIcon = (0, import_i18n9.isRTL)() ? arrow_up_right_default : arrow_up_left_default;
2381 return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
2382 import_components13.__unstableMotion.div,
2383 {
2384 className: "boot-canvas-back-button",
2385 animate: "edit",
2386 initial: "edit",
2387 whileHover: "hover",
2388 whileTap: "tap",
2389 transition,
2390 children: [
2391 /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2392 import_components13.Button,
2393 {
2394 className: "boot-canvas-back-button__link",
2395 onClick: handleBack,
2396 "aria-label": (0, import_i18n9.__)("Go back"),
2397 __next40pxDefaultSize: true,
2398 children: !hasAdminBarInEditor && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(site_icon_default, {})
2399 }
2400 ),
2401 hasAdminBarInEditor ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "boot-canvas-back-button__icon", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components13.Icon, { icon: arrowIcon }) }) : (
2402 /* Overlay arrow that appears on hover */
2403 /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2404 import_components13.__unstableMotion.div,
2405 {
2406 className: "boot-canvas-back-button__icon",
2407 variants: toggleHomeIconVariants,
2408 children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components13.Icon, { icon: arrowIcon })
2409 }
2410 )
2411 )
2412 ]
2413 }
2414 );
2415 }
2416
2417 // packages/boot/build-module/components/canvas/index.mjs
2418 var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
2419 function Canvas({ canvas }) {
2420 const [Editor, setEditor] = (0, import_element12.useState)(null);
2421 const navigate = useNavigate();
2422 (0, import_element12.useEffect)(() => {
2423 import("@wordpress/lazy-editor").then((module) => {
2424 setEditor(() => module.Editor);
2425 }).catch((error) => {
2426 console.error("Failed to load lazy editor:", error);
2427 });
2428 }, []);
2429 if (!Editor) {
2430 return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2431 "div",
2432 {
2433 style: {
2434 display: "flex",
2435 justifyContent: "center",
2436 alignItems: "center",
2437 height: "100%",
2438 padding: "2rem"
2439 },
2440 children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components14.Spinner, {})
2441 }
2442 );
2443 }
2444 const backButton = !canvas.isPreview ? ({ length }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(BootBackButton, { length }) : void 0;
2445 return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { style: { height: "100%", position: "relative" }, children: [
2446 /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2447 "div",
2448 {
2449 style: { height: "100%" },
2450 inert: canvas.isPreview ? "true" : void 0,
2451 children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2452 Editor,
2453 {
2454 postType: canvas.postType,
2455 postId: canvas.postId,
2456 settings: {
2457 isPreviewMode: canvas.isPreview,
2458 styles: canvas.isPreview ? [{ css: "body{min-height:100vh;}" }] : []
2459 },
2460 backButton
2461 }
2462 )
2463 }
2464 ),
2465 canvas.isPreview && canvas.editLink && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2466 "div",
2467 {
2468 onClick: () => navigate({ to: canvas.editLink }),
2469 onKeyDown: (e) => {
2470 if (e.key === "Enter" || e.key === " ") {
2471 e.preventDefault();
2472 navigate({ to: canvas.editLink });
2473 }
2474 },
2475 style: {
2476 position: "absolute",
2477 inset: 0,
2478 cursor: "pointer",
2479 zIndex: 1
2480 },
2481 role: "button",
2482 tabIndex: 0,
2483 "aria-label": "Click to edit"
2484 }
2485 )
2486 ] });
2487 }
2488
2489 // packages/boot/build-module/components/canvas-renderer/index.mjs
2490 var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
2491 function CanvasRenderer({
2492 canvas,
2493 routeContentModule
2494 }) {
2495 const [CustomCanvas, setCustomCanvas] = (0, import_element13.useState)(null);
2496 (0, import_element13.useEffect)(() => {
2497 if (canvas === null && routeContentModule) {
2498 import(routeContentModule).then((module) => {
2499 setCustomCanvas(() => module.canvas);
2500 }).catch((error) => {
2501 console.error("Failed to load custom canvas:", error);
2502 });
2503 } else {
2504 setCustomCanvas(null);
2505 }
2506 }, [canvas, routeContentModule]);
2507 if (canvas === void 0) {
2508 return null;
2509 }
2510 if (canvas === null) {
2511 if (!CustomCanvas) {
2512 return null;
2513 }
2514 return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CustomCanvas, {});
2515 }
2516 return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Canvas, { canvas });
2517 }
2518
2519 // packages/boot/build-module/components/app/use-route-title.mjs
2520 var import_element14 = __toESM(require_element(), 1);
2521 var import_data10 = __toESM(require_data(), 1);
2522 var import_core_data5 = __toESM(require_core_data(), 1);
2523 var import_i18n10 = __toESM(require_i18n(), 1);
2524 var import_html_entities2 = __toESM(require_html_entities(), 1);
2525 import { speak } from "@wordpress/a11y";
2526 import { privateApis as routePrivateApis4 } from "@wordpress/route";
2527 var { useLocation, useMatches: useMatches2 } = unlock(routePrivateApis4);
2528 function useRouteTitle() {
2529 const location = useLocation();
2530 const matches = useMatches2();
2531 const currentMatch = matches[matches.length - 1];
2532 const routeTitle = currentMatch?.loaderData?.title;
2533 const siteTitle = (0, import_data10.useSelect)(
2534 (select) => select(import_core_data5.store).getEntityRecord(
2535 "root",
2536 "__unstableBase"
2537 )?.name,
2538 []
2539 );
2540 const isInitialLocationRef = (0, import_element14.useRef)(true);
2541 (0, import_element14.useEffect)(() => {
2542 isInitialLocationRef.current = false;
2543 }, [location]);
2544 (0, import_element14.useEffect)(() => {
2545 if (isInitialLocationRef.current) {
2546 return;
2547 }
2548 if (routeTitle && typeof routeTitle === "string" && siteTitle && typeof siteTitle === "string") {
2549 const decodedRouteTitle = (0, import_html_entities2.decodeEntities)(routeTitle);
2550 const decodedSiteTitle = (0, import_html_entities2.decodeEntities)(siteTitle);
2551 const formattedTitle = (0, import_i18n10.sprintf)(
2552 /* translators: Admin document title. 1: Admin screen name, 2: Site name. */
2553 (0, import_i18n10.__)("%1$s \u2039 %2$s \u2014 WordPress"),
2554 decodedRouteTitle,
2555 decodedSiteTitle
2556 );
2557 document.title = formattedTitle;
2558 if (decodedRouteTitle) {
2559 speak(decodedRouteTitle, "assertive");
2560 }
2561 }
2562 }, [routeTitle, siteTitle, location]);
2563 }
2564
2565 // packages/boot/build-module/components/user-theme-provider/index.mjs
2566 var import_theme = __toESM(require_theme(), 1);
2567 var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
2568 var ThemeProvider = unlock(import_theme.privateApis).ThemeProvider;
2569 var THEME_PRIMARY_COLORS = /* @__PURE__ */ new Map([
2570 ["light", "#0085ba"],
2571 ["modern", "#3858e9"],
2572 ["blue", "#096484"],
2573 ["coffee", "#46403c"],
2574 ["ectoplasm", "#523f6d"],
2575 ["midnight", "#e14d43"],
2576 ["ocean", "#627c83"],
2577 ["sunrise", "#dd823b"]
2578 ]);
2579 function getAdminThemePrimaryColor() {
2580 const theme = document.body.className.match(/admin-color-([a-z]+)/)?.[1];
2581 return theme && THEME_PRIMARY_COLORS.get(theme);
2582 }
2583 function UserThemeProvider({
2584 color,
2585 ...restProps
2586 }) {
2587 const primary = getAdminThemePrimaryColor();
2588 return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ThemeProvider, { ...restProps, color: { primary, ...color } });
2589 }
2590
2591 // packages/boot/build-module/components/root/index.mjs
2592 var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
2593 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='be0c278a6c']")) {
2594 const style = document.createElement("style");
2595 style.setAttribute("data-wp-hash", "be0c278a6c");
2596 style.appendChild(document.createTextNode(".boot-layout{background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}.boot-layout__sidebar-backdrop{background-color:#00000080;bottom:0;cursor:var(--wpds-cursor-control,pointer);left:0;position:fixed;right:0;top:0;z-index:100002}.boot-layout__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.boot-layout__sidebar.is-mobile{background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px #0003;inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.boot-layout__mobile-sidebar-drawer{left:0;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout__mobile-sidebar-drawer{top:46px}.boot-layout__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);display:flex;justify-content:flex-start;padding:16px;z-index:3}.boot-layout__canvas.has-mobile-drawer{padding-top:65px;position:relative}.boot-layout__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.boot-layout__surfaces{margin:8px}.boot-layout--single-page .boot-layout__surfaces{margin-top:0;margin-inline-start:0}}.boot-layout__inspector,.boot-layout__stage{background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__inspector,.boot-layout__stage{border-radius:8px;height:auto;margin:0;position:static;width:auto}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:auto}}.boot-layout__stage{z-index:2}@media (min-width:782px){.boot-layout__stage{z-index:auto}}.boot-layout__inspector{z-index:3}@media (min-width:782px){.boot-layout__inspector{z-index:auto}}.boot-layout__canvas{background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);border-radius:0;bottom:0;box-shadow:0 1px 3px #0000001a;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw;z-index:1}.boot-layout--single-page .boot-layout__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__canvas{border-radius:8px;height:auto;position:static;width:auto;z-index:auto}.boot-layout--single-page .boot-layout__canvas{height:auto}.boot-layout.has-canvas .boot-layout__stage,.boot-layout__inspector{max-width:400px}}.boot-layout__canvas .interface-interface-skeleton{height:100%;left:0!important;position:relative;top:0!important}.boot-layout.has-full-canvas .boot-layout__surfaces{gap:0;margin:0}.boot-layout.has-full-canvas .boot-layout__inspector,.boot-layout.has-full-canvas .boot-layout__stage{display:none}.boot-layout.has-full-canvas .boot-layout__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;left:0;margin:0;max-width:none;overflow:hidden;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:46px}@media (min-width:782px){.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:32px}}"));
2597 document.head.appendChild(style);
2598 }
2599 var { useLocation: useLocation2, useMatches: useMatches3, Outlet } = unlock(routePrivateApis5);
2600 function Root() {
2601 const matches = useMatches3();
2602 const location = useLocation2();
2603 const currentMatch = matches[matches.length - 1];
2604 const canvas = currentMatch?.loaderData?.canvas;
2605 const routeContentModule = currentMatch?.loaderData?.routeContentModule;
2606 const isFullScreen = canvas && !canvas.isPreview;
2607 useRouteTitle();
2608 const isMobileViewport = (0, import_compose4.useViewportMatch)("medium", "<");
2609 const [isMobileSidebarOpen, setIsMobileSidebarOpen] = (0, import_element15.useState)(false);
2610 const disableMotion = (0, import_compose4.useReducedMotion)();
2611 (0, import_element15.useEffect)(() => {
2612 setIsMobileSidebarOpen(false);
2613 }, [location.pathname, isMobileViewport]);
2614 return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components15.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(UserThemeProvider, { isRoot: true, color: { bg: "#f8f8f8" }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(UserThemeProvider, { color: { bg: "#1d2327" }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
2615 "div",
2616 {
2617 className: clsx_default("boot-layout", {
2618 "has-canvas": !!canvas || canvas === null,
2619 "has-full-canvas": isFullScreen
2620 }),
2621 children: [
2622 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SavePanel, {}),
2623 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_notices.SnackbarNotices, { className: "boot-notices__snackbar" }),
2624 isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(page_default.SidebarToggleFill, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2625 import_components15.Button,
2626 {
2627 icon: menu_default,
2628 onClick: () => setIsMobileSidebarOpen(true),
2629 label: (0, import_i18n11.__)("Open navigation panel"),
2630 size: "compact"
2631 }
2632 ) }),
2633 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components15.__unstableAnimatePresence, { children: isMobileViewport && isMobileSidebarOpen && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2634 import_components15.__unstableMotion.div,
2635 {
2636 initial: { opacity: 0 },
2637 animate: { opacity: 1 },
2638 exit: { opacity: 0 },
2639 transition: {
2640 type: "tween",
2641 duration: disableMotion ? 0 : 0.2,
2642 ease: "easeOut"
2643 },
2644 className: "boot-layout__sidebar-backdrop",
2645 onClick: () => setIsMobileSidebarOpen(false),
2646 onKeyDown: (event) => {
2647 if (event.key === "Escape") {
2648 setIsMobileSidebarOpen(false);
2649 }
2650 },
2651 role: "button",
2652 tabIndex: -1,
2653 "aria-label": (0, import_i18n11.__)(
2654 "Close navigation panel"
2655 )
2656 }
2657 ) }),
2658 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components15.__unstableAnimatePresence, { children: isMobileViewport && isMobileSidebarOpen && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2659 import_components15.__unstableMotion.div,
2660 {
2661 initial: { x: "-100%" },
2662 animate: { x: 0 },
2663 exit: { x: "-100%" },
2664 transition: {
2665 type: "tween",
2666 duration: disableMotion ? 0 : 0.2,
2667 ease: "easeOut"
2668 },
2669 className: "boot-layout__sidebar is-mobile",
2670 children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Sidebar, {})
2671 }
2672 ) }),
2673 !isMobileViewport && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "boot-layout__sidebar", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Sidebar, {}) }),
2674 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "boot-layout__surfaces", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(UserThemeProvider, { color: { bg: "#ffffff" }, children: [
2675 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Outlet, {}),
2676 (canvas || canvas === null) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
2677 "div",
2678 {
2679 className: clsx_default(
2680 "boot-layout__canvas",
2681 {
2682 "has-mobile-drawer": canvas?.isPreview && isMobileViewport
2683 }
2684 ),
2685 children: [
2686 canvas?.isPreview && isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "boot-layout__mobile-sidebar-drawer", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2687 import_components15.Button,
2688 {
2689 icon: menu_default,
2690 onClick: () => setIsMobileSidebarOpen(
2691 true
2692 ),
2693 label: (0, import_i18n11.__)(
2694 "Open navigation panel"
2695 ),
2696 size: "compact"
2697 }
2698 ) }),
2699 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2700 CanvasRenderer,
2701 {
2702 canvas,
2703 routeContentModule
2704 }
2705 )
2706 ]
2707 }
2708 )
2709 ] }) })
2710 ]
2711 }
2712 ) }) }) });
2713 }
2714
2715 // packages/boot/build-module/components/app/router.mjs
2716 var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
2717 var {
2718 createLazyRoute,
2719 createRouter,
2720 createRootRoute,
2721 createRoute,
2722 RouterProvider,
2723 createBrowserHistory,
2724 parseHref,
2725 useLoaderData
2726 } = unlock(routePrivateApis6);
2727 function NotFoundComponent() {
2728 return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "boot-layout__stage", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(page_default, { title: (0, import_i18n12.__)("Route not found"), hasPadding: true, children: (0, import_i18n12.__)("The page you're looking for does not exist") }) });
2729 }
2730 function createRouteFromDefinition(route, parentRoute) {
2731 let tanstackRoute = createRoute({
2732 getParentRoute: () => parentRoute,
2733 path: route.path,
2734 beforeLoad: async (opts) => {
2735 if (route.route_module) {
2736 const module = await import(route.route_module);
2737 const routeConfig = module.route || {};
2738 if (routeConfig.beforeLoad) {
2739 return routeConfig.beforeLoad({
2740 params: opts.params || {},
2741 search: opts.search || {}
2742 });
2743 }
2744 }
2745 },
2746 loader: async (opts) => {
2747 let routeConfig = {};
2748 if (route.route_module) {
2749 const module = await import(route.route_module);
2750 routeConfig = module.route || {};
2751 }
2752 const context = {
2753 params: opts.params || {},
2754 search: opts.deps || {}
2755 };
2756 const [, loaderData, canvasData, titleData] = await Promise.all([
2757 (0, import_data11.resolveSelect)(import_core_data6.store).getEntityRecord(
2758 "root",
2759 "__unstableBase"
2760 ),
2761 routeConfig.loader ? routeConfig.loader(context) : Promise.resolve(void 0),
2762 routeConfig.canvas ? routeConfig.canvas(context) : Promise.resolve(void 0),
2763 routeConfig.title ? routeConfig.title(context) : Promise.resolve(void 0)
2764 ]);
2765 let inspector = true;
2766 if (routeConfig.inspector) {
2767 inspector = await routeConfig.inspector(context);
2768 }
2769 return {
2770 ...loaderData,
2771 canvas: canvasData,
2772 inspector,
2773 title: titleData,
2774 routeContentModule: route.content_module
2775 };
2776 },
2777 loaderDeps: (opts) => opts.search
2778 });
2779 tanstackRoute = tanstackRoute.lazy(async () => {
2780 const module = route.content_module ? await import(route.content_module) : {};
2781 const Stage = module.stage;
2782 const Inspector = module.inspector;
2783 return createLazyRoute(route.path)({
2784 component: function RouteComponent() {
2785 const { inspector: showInspector } = useLoaderData({ from: route.path }) ?? {};
2786 return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
2787 Stage && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "boot-layout__stage", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Stage, {}) }),
2788 Inspector && showInspector && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "boot-layout__inspector", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Inspector, {}) })
2789 ] });
2790 }
2791 });
2792 });
2793 return tanstackRoute;
2794 }
2795 function createRouteTree(routes, rootComponent = Root) {
2796 const rootRoute = createRootRoute({
2797 component: rootComponent,
2798 context: () => ({})
2799 });
2800 const dynamicRoutes = routes.map(
2801 (route) => createRouteFromDefinition(route, rootRoute)
2802 );
2803 return rootRoute.addChildren(dynamicRoutes);
2804 }
2805 function createPathHistory() {
2806 return createBrowserHistory({
2807 parseLocation: () => {
2808 const url = new URL(window.location.href);
2809 const path = url.searchParams.get("p") || "/";
2810 const pathHref = `${path}${url.hash}`;
2811 return parseHref(pathHref, window.history.state);
2812 },
2813 createHref: (href) => {
2814 const searchParams = new URLSearchParams(window.location.search);
2815 searchParams.set("p", href);
2816 return `${window.location.pathname}?${searchParams}`;
2817 }
2818 });
2819 }
2820 function Router({
2821 routes,
2822 rootComponent = Root
2823 }) {
2824 const router = (0, import_element16.useMemo)(() => {
2825 const history = createPathHistory();
2826 const routeTree = createRouteTree(routes, rootComponent);
2827 return createRouter({
2828 history,
2829 routeTree,
2830 defaultPreload: "intent",
2831 defaultNotFoundComponent: NotFoundComponent,
2832 defaultViewTransition: {
2833 types: ({
2834 fromLocation
2835 }) => {
2836 if (!fromLocation) {
2837 return false;
2838 }
2839 return ["navigate"];
2840 }
2841 }
2842 });
2843 }, [routes, rootComponent]);
2844 return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RouterProvider, { router });
2845 }
2846
2847 // packages/boot/build-module/components/root/single-page.mjs
2848 var import_notices2 = __toESM(require_notices(), 1);
2849 var import_components16 = __toESM(require_components(), 1);
2850 import { privateApis as routePrivateApis7 } from "@wordpress/route";
2851 var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
2852 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='be0c278a6c']")) {
2853 const style = document.createElement("style");
2854 style.setAttribute("data-wp-hash", "be0c278a6c");
2855 style.appendChild(document.createTextNode(".boot-layout{background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}.boot-layout__sidebar-backdrop{background-color:#00000080;bottom:0;cursor:var(--wpds-cursor-control,pointer);left:0;position:fixed;right:0;top:0;z-index:100002}.boot-layout__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.boot-layout__sidebar.is-mobile{background:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px #0003;inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.boot-layout__mobile-sidebar-drawer{left:0;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout__mobile-sidebar-drawer{top:46px}.boot-layout__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);display:flex;justify-content:flex-start;padding:16px;z-index:3}.boot-layout__canvas.has-mobile-drawer{padding-top:65px;position:relative}.boot-layout__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.boot-layout__surfaces{margin:8px}.boot-layout--single-page .boot-layout__surfaces{margin-top:0;margin-inline-start:0}}.boot-layout__inspector,.boot-layout__stage{background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__inspector,.boot-layout__stage{border-radius:8px;height:auto;margin:0;position:static;width:auto}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:auto}}.boot-layout__stage{z-index:2}@media (min-width:782px){.boot-layout__stage{z-index:auto}}.boot-layout__inspector{z-index:3}@media (min-width:782px){.boot-layout__inspector{z-index:auto}}.boot-layout__canvas{background:var(--wpds-color-bg-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e4e4e4);border-radius:0;bottom:0;box-shadow:0 1px 3px #0000001a;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw;z-index:1}.boot-layout--single-page .boot-layout__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__canvas{border-radius:8px;height:auto;position:static;width:auto;z-index:auto}.boot-layout--single-page .boot-layout__canvas{height:auto}.boot-layout.has-canvas .boot-layout__stage,.boot-layout__inspector{max-width:400px}}.boot-layout__canvas .interface-interface-skeleton{height:100%;left:0!important;position:relative;top:0!important}.boot-layout.has-full-canvas .boot-layout__surfaces{gap:0;margin:0}.boot-layout.has-full-canvas .boot-layout__inspector,.boot-layout.has-full-canvas .boot-layout__stage{display:none}.boot-layout.has-full-canvas .boot-layout__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;left:0;margin:0;max-width:none;overflow:hidden;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:46px}@media (min-width:782px){.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:32px}}"));
2856 document.head.appendChild(style);
2857 }
2858 var { useMatches: useMatches4, Outlet: Outlet2 } = unlock(routePrivateApis7);
2859 function RootSinglePage() {
2860 const matches = useMatches4();
2861 const currentMatch = matches[matches.length - 1];
2862 const canvas = currentMatch?.loaderData?.canvas;
2863 const routeContentModule = currentMatch?.loaderData?.routeContentModule;
2864 const isFullScreen = canvas && !canvas.isPreview;
2865 useRouteTitle();
2866 return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components16.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(UserThemeProvider, { isRoot: true, color: { bg: "#f8f8f8" }, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(UserThemeProvider, { color: { bg: "#1d2327" }, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2867 "div",
2868 {
2869 className: clsx_default(
2870 "boot-layout boot-layout--single-page",
2871 {
2872 "has-canvas": !!canvas || canvas === null,
2873 "has-full-canvas": isFullScreen
2874 }
2875 ),
2876 children: [
2877 /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SavePanel, {}),
2878 /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_notices2.SnackbarNotices, { className: "boot-notices__snackbar" }),
2879 /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "boot-layout__surfaces", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(UserThemeProvider, { color: { bg: "#ffffff" }, children: [
2880 /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Outlet2, {}),
2881 (canvas || canvas === null) && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "boot-layout__canvas", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2882 CanvasRenderer,
2883 {
2884 canvas,
2885 routeContentModule
2886 }
2887 ) })
2888 ] }) })
2889 ]
2890 }
2891 ) }) }) });
2892 }
2893
2894 // packages/boot/build-module/components/app/index.mjs
2895 var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
2896 function App({ rootComponent }) {
2897 const routes = (0, import_data12.useSelect)((select) => select(store).getRoutes(), []);
2898 return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Router, { routes, rootComponent });
2899 }
2900 async function init({
2901 mountId,
2902 menuItems,
2903 routes,
2904 initModules,
2905 dashboardLink
2906 }) {
2907 (menuItems ?? []).forEach((menuItem) => {
2908 (0, import_data12.dispatch)(store).registerMenuItem(menuItem.id, menuItem);
2909 });
2910 (routes ?? []).forEach((route) => {
2911 (0, import_data12.dispatch)(store).registerRoute(route);
2912 });
2913 if (dashboardLink) {
2914 (0, import_data12.dispatch)(store).setDashboardLink(dashboardLink);
2915 }
2916 for (const moduleId of initModules ?? []) {
2917 const module = await import(moduleId);
2918 await module.init();
2919 }
2920 const rootElement = document.getElementById(mountId);
2921 if (rootElement) {
2922 const root = (0, import_element17.createRoot)(rootElement);
2923 root.render(
2924 /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_element17.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(App, {}) })
2925 );
2926 }
2927 }
2928 async function initSinglePage({
2929 mountId,
2930 routes
2931 }) {
2932 (routes ?? []).forEach((route) => {
2933 (0, import_data12.dispatch)(store).registerRoute(route);
2934 });
2935 const rootElement = document.getElementById(mountId);
2936 if (rootElement) {
2937 const root = (0, import_element17.createRoot)(rootElement);
2938 root.render(
2939 /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_element17.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(App, { rootComponent: RootSinglePage }) })
2940 );
2941 }
2942 }
2943
2944 // packages/boot/build-module/index.mjs
2945 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='9947af2e2a']")) {
2946 const style = document.createElement("style");
2947 style.setAttribute("data-wp-hash", "9947af2e2a");
2948 style.appendChild(document.createTextNode(':root{--wpds-border-radius-xs:1px;--wpds-border-radius-sm:2px;--wpds-border-radius-md:4px;--wpds-border-radius-lg:8px;--wpds-border-width-xs:1px;--wpds-border-width-sm:2px;--wpds-border-width-md:4px;--wpds-border-width-lg:8px;--wpds-border-width-focus:2px;--wpds-color-bg-surface-neutral:#fcfcfc;--wpds-color-bg-surface-neutral-strong:#fff;--wpds-color-bg-surface-neutral-weak:#f4f4f4;--wpds-color-bg-surface-brand:#ecf0fa;--wpds-color-bg-surface-success:#c6f7cd;--wpds-color-bg-surface-success-weak:#ebffed;--wpds-color-bg-surface-info:#deebfa;--wpds-color-bg-surface-info-weak:#f3f9ff;--wpds-color-bg-surface-warning:#fde6be;--wpds-color-bg-surface-warning-weak:#fff7e1;--wpds-color-bg-surface-caution:#fee995;--wpds-color-bg-surface-caution-weak:#fff9ca;--wpds-color-bg-surface-error:#f6e6e3;--wpds-color-bg-surface-error-weak:#fff6f5;--wpds-color-bg-interactive-neutral-strong:#2d2d2d;--wpds-color-bg-interactive-neutral-strong-active:#1e1e1e;--wpds-color-bg-interactive-neutral-strong-disabled:#e6e6e6;--wpds-color-bg-interactive-neutral-weak:#0000;--wpds-color-bg-interactive-neutral-weak-active:#ededed;--wpds-color-bg-interactive-neutral-weak-disabled:#0000;--wpds-color-bg-interactive-brand-strong:#3858e9;--wpds-color-bg-interactive-brand-strong-active:#2e49d9;--wpds-color-bg-interactive-brand-weak:#0000;--wpds-color-bg-interactive-brand-weak-active:#e6eaf4;--wpds-color-bg-interactive-error:#0000;--wpds-color-bg-interactive-error-active:#fff6f5;--wpds-color-bg-interactive-error-strong:#cc1818;--wpds-color-bg-interactive-error-strong-active:#b90000;--wpds-color-bg-interactive-error-weak:#0000;--wpds-color-bg-interactive-error-weak-active:#f6e6e3;--wpds-color-bg-track-neutral-weak:#e4e4e4;--wpds-color-bg-track-neutral:#dbdbdb;--wpds-color-bg-thumb-neutral-weak:#8d8d8d;--wpds-color-bg-thumb-neutral-weak-active:#6e6e6e;--wpds-color-bg-thumb-brand:#3858e9;--wpds-color-bg-thumb-brand-active:#3858e9;--wpds-color-bg-thumb-neutral-disabled:#dbdbdb;--wpds-color-fg-content-neutral:#1e1e1e;--wpds-color-fg-content-neutral-weak:#707070;--wpds-color-fg-content-success:#002900;--wpds-color-fg-content-success-weak:#008030;--wpds-color-fg-content-info:#001b4f;--wpds-color-fg-content-info-weak:#006bd7;--wpds-color-fg-content-warning:#2e1900;--wpds-color-fg-content-warning-weak:#926300;--wpds-color-fg-content-caution:#281d00;--wpds-color-fg-content-caution-weak:#826a00;--wpds-color-fg-content-error:#470000;--wpds-color-fg-content-error-weak:#cc1818;--wpds-color-fg-interactive-neutral:#1e1e1e;--wpds-color-fg-interactive-neutral-active:#1e1e1e;--wpds-color-fg-interactive-neutral-disabled:#8d8d8d;--wpds-color-fg-interactive-neutral-strong:#f0f0f0;--wpds-color-fg-interactive-neutral-strong-active:#f0f0f0;--wpds-color-fg-interactive-neutral-strong-disabled:#8d8d8d;--wpds-color-fg-interactive-neutral-weak:#707070;--wpds-color-fg-interactive-neutral-weak-disabled:#8d8d8d;--wpds-color-fg-interactive-brand:#3858e9;--wpds-color-fg-interactive-brand-active:#3858e9;--wpds-color-fg-interactive-brand-strong:#eff0f2;--wpds-color-fg-interactive-brand-strong-active:#eff0f2;--wpds-color-fg-interactive-error:#cc1818;--wpds-color-fg-interactive-error-active:#cc1818;--wpds-color-fg-interactive-error-strong:#f2efef;--wpds-color-fg-interactive-error-strong-active:#f2efef;--wpds-color-stroke-surface-neutral:#dbdbdb;--wpds-color-stroke-surface-neutral-weak:#e4e4e4;--wpds-color-stroke-surface-neutral-strong:#8d8d8d;--wpds-color-stroke-surface-brand:#a3b1d4;--wpds-color-stroke-surface-brand-strong:#3858e9;--wpds-color-stroke-surface-success:#8ac894;--wpds-color-stroke-surface-success-strong:#008030;--wpds-color-stroke-surface-info:#9fbcdc;--wpds-color-stroke-surface-info-strong:#006bd7;--wpds-color-stroke-surface-warning:#d0b481;--wpds-color-stroke-surface-warning-strong:#926300;--wpds-color-stroke-surface-error:#daa39b;--wpds-color-stroke-surface-error-strong:#cc1818;--wpds-color-stroke-interactive-neutral:#8d8d8d;--wpds-color-stroke-interactive-neutral-active:#6e6e6e;--wpds-color-stroke-interactive-neutral-disabled:#dbdbdb;--wpds-color-stroke-interactive-neutral-strong:#6e6e6e;--wpds-color-stroke-interactive-brand:#3858e9;--wpds-color-stroke-interactive-brand-active:#2337c8;--wpds-color-stroke-interactive-error:#cc1818;--wpds-color-stroke-interactive-error-active:#9d0000;--wpds-color-stroke-interactive-error-strong:#cc1818;--wpds-color-stroke-focus-brand:#3858e9;--wpds-cursor-control:pointer;--wpds-dimension-base:4px;--wpds-dimension-padding-xs:4px;--wpds-dimension-padding-sm:8px;--wpds-dimension-padding-md:12px;--wpds-dimension-padding-lg:16px;--wpds-dimension-padding-xl:20px;--wpds-dimension-padding-2xl:24px;--wpds-dimension-padding-3xl:32px;--wpds-dimension-gap-xs:4px;--wpds-dimension-gap-sm:8px;--wpds-dimension-gap-md:12px;--wpds-dimension-gap-lg:16px;--wpds-dimension-gap-xl:24px;--wpds-dimension-gap-2xl:32px;--wpds-dimension-gap-3xl:40px;--wpds-dimension-surface-width-xs:240px;--wpds-dimension-surface-width-sm:320px;--wpds-dimension-surface-width-md:400px;--wpds-dimension-surface-width-lg:560px;--wpds-dimension-surface-width-xl:720px;--wpds-dimension-surface-width-2xl:960px;--wpds-elevation-xs:0 1px 1px 0 #00000008,0 1px 2px 0 #00000005,0 3px 3px 0 #00000005,0 4px 4px 0 #00000003;--wpds-elevation-sm:0 1px 2px 0 #0000000d,0 2px 3px 0 #0000000a,0 6px 6px 0 #00000008,0 8px 8px 0 #00000005;--wpds-elevation-md:0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005;--wpds-elevation-lg:0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005;--wpds-motion-duration-xs:50ms;--wpds-motion-duration-sm:100ms;--wpds-motion-duration-md:200ms;--wpds-motion-duration-lg:300ms;--wpds-motion-duration-xl:400ms;--wpds-motion-easing-subtle:cubic-bezier(0.15,0,0.15,1);--wpds-motion-easing-balanced:cubic-bezier(0.4,0,0.2,1);--wpds-motion-easing-expressive:cubic-bezier(0.25,0,0,1);--wpds-typography-font-family-heading:-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif;--wpds-typography-font-family-body:-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif;--wpds-typography-font-family-mono:"Menlo","Consolas",monaco,monospace;--wpds-typography-font-size-xs:11px;--wpds-typography-font-size-sm:12px;--wpds-typography-font-size-md:13px;--wpds-typography-font-size-lg:15px;--wpds-typography-font-size-xl:20px;--wpds-typography-font-size-2xl:32px;--wpds-typography-line-height-xs:16px;--wpds-typography-line-height-sm:20px;--wpds-typography-line-height-md:24px;--wpds-typography-line-height-lg:28px;--wpds-typography-line-height-xl:32px;--wpds-typography-line-height-2xl:40px;--wpds-typography-font-weight-regular:400;--wpds-typography-font-weight-medium:499}[data-wpds-theme-provider-id][data-wpds-density=compact]{--wpds-dimension-padding-xs:4px;--wpds-dimension-padding-sm:4px;--wpds-dimension-padding-md:8px;--wpds-dimension-padding-lg:12px;--wpds-dimension-padding-xl:16px;--wpds-dimension-padding-2xl:20px;--wpds-dimension-padding-3xl:24px;--wpds-dimension-gap-xs:4px;--wpds-dimension-gap-sm:4px;--wpds-dimension-gap-md:8px;--wpds-dimension-gap-lg:12px;--wpds-dimension-gap-xl:20px;--wpds-dimension-gap-2xl:24px;--wpds-dimension-gap-3xl:32px}[data-wpds-theme-provider-id][data-wpds-density=comfortable]{--wpds-dimension-padding-xs:8px;--wpds-dimension-padding-sm:12px;--wpds-dimension-padding-md:16px;--wpds-dimension-padding-lg:20px;--wpds-dimension-padding-xl:24px;--wpds-dimension-padding-2xl:32px;--wpds-dimension-padding-3xl:40px;--wpds-dimension-gap-xs:8px;--wpds-dimension-gap-sm:12px;--wpds-dimension-gap-md:16px;--wpds-dimension-gap-lg:20px;--wpds-dimension-gap-xl:32px;--wpds-dimension-gap-2xl:40px;--wpds-dimension-gap-3xl:48px}[data-wpds-theme-provider-id][data-wpds-density=default]{--wpds-dimension-base:4px;--wpds-dimension-padding-xs:4px;--wpds-dimension-padding-sm:8px;--wpds-dimension-padding-md:12px;--wpds-dimension-padding-lg:16px;--wpds-dimension-padding-xl:20px;--wpds-dimension-padding-2xl:24px;--wpds-dimension-padding-3xl:32px;--wpds-dimension-gap-xs:4px;--wpds-dimension-gap-sm:8px;--wpds-dimension-gap-md:12px;--wpds-dimension-gap-lg:16px;--wpds-dimension-gap-xl:24px;--wpds-dimension-gap-2xl:32px;--wpds-dimension-gap-3xl:40px;--wpds-dimension-surface-width-xs:240px;--wpds-dimension-surface-width-sm:320px;--wpds-dimension-surface-width-md:400px;--wpds-dimension-surface-width-lg:560px;--wpds-dimension-surface-width-xl:720px;--wpds-dimension-surface-width-2xl:960px}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){:root{--wpds-border-width-focus:1.5px}}body.has-admin-bar-in-editor #wpadminbar{display:block}body.has-admin-bar-in-editor .boot-canvas-back-button__link{background:#0000}body.has-admin-bar-in-editor .boot-canvas-back-button__icon{background-color:initial}body.has-admin-bar-in-editor #site-editor-v2-app{bottom:0;height:calc(100vh - 32px)!important;left:0;position:fixed;right:0;top:32px}body.has-admin-bar-in-editor .boot-layout.has-full-canvas .boot-layout__canvas{height:calc(100vh - 32px);top:32px}@media (max-width:782px){body.has-admin-bar-in-editor #site-editor-v2-app{height:calc(100vh - 46px)!important;top:46px}body.has-admin-bar-in-editor .boot-layout.has-full-canvas .boot-layout__canvas,body.has-admin-bar-in-editor .boot-layout__canvas:not(.has-mobile-drawer),body.has-admin-bar-in-editor .boot-layout__inspector,body.has-admin-bar-in-editor .boot-layout__stage{height:calc(100vh - 46px);top:46px}body.has-admin-bar-in-editor .boot-layout__mobile-sidebar-drawer{top:46px}}@media (min-width:600px){.boot-layout-container .boot-layout{bottom:0;left:0;min-height:calc(100vh - 46px);position:absolute;right:0;top:0}}@media (min-width:782px){.boot-layout-container .boot-layout{min-height:calc(100vh - 32px)}body:has(.boot-layout.has-full-canvas) .boot-layout-container .boot-layout{min-height:100vh}}.boot-layout-container .boot-layout img{height:auto;max-width:100%}.boot-layout .boot-notices__snackbar{bottom:24px;box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}.boot-layout .boot-notices__snackbar .components-snackbar{margin-inline:auto}'));
2949 document.head.appendChild(style);
2950 }
2951 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='cc217bc358']")) {
2952 const style = document.createElement("style");
2953 style.setAttribute("data-wp-hash", "cc217bc358");
2954 style.appendChild(document.createTextNode("@media (max-width:782px){*{view-transition-name:none!important}}::view-transition-new(root),::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){.boot-layout__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.boot-layout__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.boot-layout.has-full-canvas .boot-layout__canvas .boot-site-icon-link,.boot-layout:not(.has-full-canvas) .boot-site-hub .boot-site-icon-link{view-transition-name:boot--site-icon-link}.boot-layout__stage{view-transition-name:boot--stage}.boot-layout__inspector{view-transition-name:boot--inspector}.boot-layout__canvas.is-full-canvas .interface-interface-skeleton__content,.boot-layout__canvas:not(.is-full-canvas){view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.boot-layout__stage{view-transition-name:boot-safari--stage}.boot-layout__inspector{view-transition-name:boot-safari--inspector}.boot-layout__canvas.is-full-canvas .interface-interface-skeleton__content,.boot-layout__canvas:not(.is-full-canvas){view-transition-name:boot-safari--canvas}}.components-popover:first-of-type{view-transition-name:boot--components-popover}}::view-transition-group(boot--canvas),::view-transition-group(boot--canvas-header),::view-transition-group(boot--canvas-sidebar),::view-transition-group(boot-safari--canvas){z-index:1}::view-transition-group(boot--site-icon-link){z-index:2}::view-transition-new(boot--site-icon-link),::view-transition-old(boot--site-icon-link){animation:none}::view-transition-new(boot-safari--canvas),::view-transition-new(boot-safari--inspector),::view-transition-new(boot-safari--stage),::view-transition-old(boot-safari--canvas),::view-transition-old(boot-safari--inspector),::view-transition-old(boot-safari--stage){width:auto}::view-transition-new(boot--canvas),::view-transition-new(boot--inspector),::view-transition-new(boot--stage),::view-transition-old(boot--canvas),::view-transition-old(boot--inspector),::view-transition-old(boot--stage){background:#fff;border-radius:8px;height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}::view-transition-new(boot--canvas),::view-transition-old(boot--canvas){object-position:center top}::view-transition-old(boot--inspector):only-child,::view-transition-old(boot--stage):only-child,::view-transition-old(boot-safari--inspector):only-child,::view-transition-old(boot-safari--stage):only-child{animation-name:zoomOut;will-change:transform,opacity}::view-transition-new(boot--inspector):only-child,::view-transition-new(boot--stage):only-child,::view-transition-new(boot-safari--inspector):only-child,::view-transition-new(boot-safari--stage):only-child{animation-name:zoomIn;will-change:transform,opacity}@keyframes zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}::view-transition-new(boot--canvas):only-child,::view-transition-new(boot-safari--canvas):only-child{animation-name:slideFromRight;will-change:transform}::view-transition-old(boot--canvas):only-child,::view-transition-old(boot-safari--canvas):only-child{animation-name:slideToRight;will-change:transform}@keyframes slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}::view-transition-new(boot--canvas-header):only-child{animation-name:slideHeaderFromTop;will-change:transform}::view-transition-old(boot--canvas-header):only-child{animation-name:slideHeaderToTop;will-change:transform}@keyframes slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes slideHeaderToTop{to{transform:translateY(-100%)}}::view-transition-new(boot--canvas-sidebar):only-child{animation-name:slideSidebarFromRight;will-change:transform}::view-transition-old(boot--canvas-sidebar):only-child{animation-name:slideSidebarToRight;will-change:transform}@keyframes slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes slideSidebarToRight{to{transform:translateX(100%)}}"));
2955 document.head.appendChild(style);
2956 }
2957 export {
2958 init,
2959 initSinglePage,
2960 store
2961 };
2962 //# sourceMappingURL=index.js.map
2963