PluginProbe
Gutenberg / 23.7.2
Gutenberg v23.7.2
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 / scripts / customize-widgets / index.js

index.js in Gutenberg 23.7.2, at build/scripts/customize-widgets/index.js

3,044 lines 110.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var wp;
2 (wp ||= {}).customizeWidgets = (() => {
3 var __create = Object.create;
4 var __defProp = Object.defineProperty;
5 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6 var __getOwnPropNames = Object.getOwnPropertyNames;
7 var __getProtoOf = Object.getPrototypeOf;
8 var __hasOwnProp = Object.prototype.hasOwnProperty;
9 var __commonJS = (cb, mod) => function __require() {
10 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11 };
12 var __export = (target, all) => {
13 for (var name in all)
14 __defProp(target, name, { get: all[name], enumerable: true });
15 };
16 var __copyProps = (to, from, except, desc) => {
17 if (from && typeof from === "object" || typeof from === "function") {
18 for (let key of __getOwnPropNames(from))
19 if (!__hasOwnProp.call(to, key) && key !== except)
20 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21 }
22 return to;
23 };
24 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25 // If the importer is in node compatibility mode or this is not an ESM
26 // file that has been converted to a CommonJS file using a Babel-
27 // compatible transform (i.e. "__esModule" has not been set), then set
28 // "default" to the CommonJS "module.exports" for node compatibility.
29 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30 mod
31 ));
32 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
34 // package-external:@wordpress/element
35 var require_element = __commonJS({
36 "package-external:@wordpress/element"(exports, module) {
37 module.exports = window.wp.element;
38 }
39 });
40
41 // package-external:@wordpress/block-library
42 var require_block_library = __commonJS({
43 "package-external:@wordpress/block-library"(exports, module) {
44 module.exports = window.wp.blockLibrary;
45 }
46 });
47
48 // package-external:@wordpress/widgets
49 var require_widgets = __commonJS({
50 "package-external:@wordpress/widgets"(exports, module) {
51 module.exports = window.wp.widgets;
52 }
53 });
54
55 // package-external:@wordpress/blocks
56 var require_blocks = __commonJS({
57 "package-external:@wordpress/blocks"(exports, module) {
58 module.exports = window.wp.blocks;
59 }
60 });
61
62 // package-external:@wordpress/data
63 var require_data = __commonJS({
64 "package-external:@wordpress/data"(exports, module) {
65 module.exports = window.wp.data;
66 }
67 });
68
69 // package-external:@wordpress/preferences
70 var require_preferences = __commonJS({
71 "package-external:@wordpress/preferences"(exports, module) {
72 module.exports = window.wp.preferences;
73 }
74 });
75
76 // package-external:@wordpress/components
77 var require_components = __commonJS({
78 "package-external:@wordpress/components"(exports, module) {
79 module.exports = window.wp.components;
80 }
81 });
82
83 // package-external:@wordpress/i18n
84 var require_i18n = __commonJS({
85 "package-external:@wordpress/i18n"(exports, module) {
86 module.exports = window.wp.i18n;
87 }
88 });
89
90 // package-external:@wordpress/block-editor
91 var require_block_editor = __commonJS({
92 "package-external:@wordpress/block-editor"(exports, module) {
93 module.exports = window.wp.blockEditor;
94 }
95 });
96
97 // package-external:@wordpress/compose
98 var require_compose = __commonJS({
99 "package-external:@wordpress/compose"(exports, module) {
100 module.exports = window.wp.compose;
101 }
102 });
103
104 // package-external:@wordpress/hooks
105 var require_hooks = __commonJS({
106 "package-external:@wordpress/hooks"(exports, module) {
107 module.exports = window.wp.hooks;
108 }
109 });
110
111 // vendor-external:react/jsx-runtime
112 var require_jsx_runtime = __commonJS({
113 "vendor-external:react/jsx-runtime"(exports, module) {
114 module.exports = window.ReactJSXRuntime;
115 }
116 });
117
118 // package-external:@wordpress/core-data
119 var require_core_data = __commonJS({
120 "package-external:@wordpress/core-data"(exports, module) {
121 module.exports = window.wp.coreData;
122 }
123 });
124
125 // package-external:@wordpress/media-utils
126 var require_media_utils = __commonJS({
127 "package-external:@wordpress/media-utils"(exports, module) {
128 module.exports = window.wp.mediaUtils;
129 }
130 });
131
132 // package-external:@wordpress/keycodes
133 var require_keycodes = __commonJS({
134 "package-external:@wordpress/keycodes"(exports, module) {
135 module.exports = window.wp.keycodes;
136 }
137 });
138
139 // package-external:@wordpress/primitives
140 var require_primitives = __commonJS({
141 "package-external:@wordpress/primitives"(exports, module) {
142 module.exports = window.wp.primitives;
143 }
144 });
145
146 // package-external:@wordpress/keyboard-shortcuts
147 var require_keyboard_shortcuts = __commonJS({
148 "package-external:@wordpress/keyboard-shortcuts"(exports, module) {
149 module.exports = window.wp.keyboardShortcuts;
150 }
151 });
152
153 // vendor-external:react
154 var require_react = __commonJS({
155 "vendor-external:react"(exports, module) {
156 module.exports = window.React;
157 }
158 });
159
160 // package-external:@wordpress/private-apis
161 var require_private_apis = __commonJS({
162 "package-external:@wordpress/private-apis"(exports, module) {
163 module.exports = window.wp.privateApis;
164 }
165 });
166
167 // node_modules/fast-deep-equal/es6/index.js
168 var require_es6 = __commonJS({
169 "node_modules/fast-deep-equal/es6/index.js"(exports, module) {
170 "use strict";
171 module.exports = function equal(a, b) {
172 if (a === b) return true;
173 if (a && b && typeof a == "object" && typeof b == "object") {
174 if (a.constructor !== b.constructor) return false;
175 var length, i, keys;
176 if (Array.isArray(a)) {
177 length = a.length;
178 if (length != b.length) return false;
179 for (i = length; i-- !== 0; )
180 if (!equal(a[i], b[i])) return false;
181 return true;
182 }
183 if (a instanceof Map && b instanceof Map) {
184 if (a.size !== b.size) return false;
185 for (i of a.entries())
186 if (!b.has(i[0])) return false;
187 for (i of a.entries())
188 if (!equal(i[1], b.get(i[0]))) return false;
189 return true;
190 }
191 if (a instanceof Set && b instanceof Set) {
192 if (a.size !== b.size) return false;
193 for (i of a.entries())
194 if (!b.has(i[0])) return false;
195 return true;
196 }
197 if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
198 length = a.length;
199 if (length != b.length) return false;
200 for (i = length; i-- !== 0; )
201 if (a[i] !== b[i]) return false;
202 return true;
203 }
204 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
205 if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
206 if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
207 keys = Object.keys(a);
208 length = keys.length;
209 if (length !== Object.keys(b).length) return false;
210 for (i = length; i-- !== 0; )
211 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
212 for (i = length; i-- !== 0; ) {
213 var key = keys[i];
214 if (!equal(a[key], b[key])) return false;
215 }
216 return true;
217 }
218 return a !== a && b !== b;
219 };
220 }
221 });
222
223 // package-external:@wordpress/is-shallow-equal
224 var require_is_shallow_equal = __commonJS({
225 "package-external:@wordpress/is-shallow-equal"(exports, module) {
226 module.exports = window.wp.isShallowEqual;
227 }
228 });
229
230 // package-external:@wordpress/dom
231 var require_dom = __commonJS({
232 "package-external:@wordpress/dom"(exports, module) {
233 module.exports = window.wp.dom;
234 }
235 });
236
237 // packages/customize-widgets/build-module/index.mjs
238 var index_exports = {};
239 __export(index_exports, {
240 initialize: () => initialize,
241 store: () => store
242 });
243 var import_element18 = __toESM(require_element(), 1);
244 var import_block_library2 = __toESM(require_block_library(), 1);
245 var import_widgets5 = __toESM(require_widgets(), 1);
246 var import_blocks2 = __toESM(require_blocks(), 1);
247 var import_data17 = __toESM(require_data(), 1);
248 var import_preferences4 = __toESM(require_preferences(), 1);
249
250 // packages/customize-widgets/build-module/components/customize-widgets/index.mjs
251 var import_element17 = __toESM(require_element(), 1);
252 var import_components8 = __toESM(require_components(), 1);
253
254 // packages/customize-widgets/build-module/components/error-boundary/index.mjs
255 var import_element = __toESM(require_element(), 1);
256 var import_i18n = __toESM(require_i18n(), 1);
257 var import_components = __toESM(require_components(), 1);
258 var import_block_editor = __toESM(require_block_editor(), 1);
259 var import_compose = __toESM(require_compose(), 1);
260 var import_hooks = __toESM(require_hooks(), 1);
261 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
262 function CopyButton({ text, children }) {
263 const ref = (0, import_compose.useCopyToClipboard)(text);
264 return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Button, { size: "compact", variant: "secondary", ref, children });
265 }
266 var ErrorBoundary = class extends import_element.Component {
267 constructor() {
268 super(...arguments);
269 this.state = {
270 error: null
271 };
272 }
273 componentDidCatch(error) {
274 this.setState({ error });
275 (0, import_hooks.doAction)("editor.ErrorBoundary.errorLogged", error);
276 }
277 render() {
278 const { error } = this.state;
279 if (!error) {
280 return this.props.children;
281 }
282 return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
283 import_block_editor.Warning,
284 {
285 className: "customize-widgets-error-boundary",
286 actions: [
287 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: error.stack, children: (0, import_i18n.__)("Copy Error") }, "copy-error")
288 ],
289 children: (0, import_i18n.__)("The editor has encountered an unexpected error.")
290 }
291 );
292 }
293 };
294
295 // packages/customize-widgets/build-module/components/sidebar-block-editor/index.mjs
296 var import_compose3 = __toESM(require_compose(), 1);
297 var import_core_data = __toESM(require_core_data(), 1);
298 var import_data12 = __toESM(require_data(), 1);
299 var import_element14 = __toESM(require_element(), 1);
300 var import_block_editor9 = __toESM(require_block_editor(), 1);
301 var import_media_utils = __toESM(require_media_utils(), 1);
302 var import_preferences3 = __toESM(require_preferences(), 1);
303 var import_block_library = __toESM(require_block_library(), 1);
304
305 // packages/customize-widgets/build-module/components/block-inspector-button/index.mjs
306 var import_element2 = __toESM(require_element(), 1);
307 var import_i18n2 = __toESM(require_i18n(), 1);
308 var import_components2 = __toESM(require_components(), 1);
309 var import_data = __toESM(require_data(), 1);
310 var import_block_editor2 = __toESM(require_block_editor(), 1);
311 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
312 function BlockInspectorButton({ inspector, closeMenu, ...props }) {
313 const selectedBlockClientId = (0, import_data.useSelect)(
314 (select) => select(import_block_editor2.store).getSelectedBlockClientId(),
315 []
316 );
317 const selectedBlock = (0, import_element2.useMemo)(
318 () => document.getElementById(`block-${selectedBlockClientId}`),
319 [selectedBlockClientId]
320 );
321 return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
322 import_components2.MenuItem,
323 {
324 onClick: () => {
325 inspector.open({
326 returnFocusWhenClose: selectedBlock
327 });
328 closeMenu();
329 },
330 ...props,
331 children: (0, import_i18n2.__)("Show more settings")
332 }
333 );
334 }
335 var block_inspector_button_default = BlockInspectorButton;
336
337 // node_modules/clsx/dist/clsx.mjs
338 function r(e) {
339 var t, f, n = "";
340 if ("string" == typeof e || "number" == typeof e) n += e;
341 else if ("object" == typeof e) if (Array.isArray(e)) {
342 var o = e.length;
343 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
344 } else for (f in e) e[f] && (n && (n += " "), n += f);
345 return n;
346 }
347 function clsx() {
348 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
349 return n;
350 }
351 var clsx_default = clsx;
352
353 // packages/customize-widgets/build-module/components/header/index.mjs
354 var import_components6 = __toESM(require_components(), 1);
355 var import_block_editor4 = __toESM(require_block_editor(), 1);
356 var import_element7 = __toESM(require_element(), 1);
357 var import_keycodes3 = __toESM(require_keycodes(), 1);
358 var import_i18n7 = __toESM(require_i18n(), 1);
359
360 // packages/icons/build-module/library/close-small.mjs
361 var import_primitives = __toESM(require_primitives(), 1);
362 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
363 var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) });
364
365 // packages/icons/build-module/library/external.mjs
366 var import_primitives2 = __toESM(require_primitives(), 1);
367 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
368 var external_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives2.Path, { d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" }) });
369
370 // packages/icons/build-module/library/more-vertical.mjs
371 var import_primitives3 = __toESM(require_primitives(), 1);
372 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
373 var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives3.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) });
374
375 // packages/icons/build-module/library/plus.mjs
376 var import_primitives4 = __toESM(require_primitives(), 1);
377 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
378 var plus_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives4.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) });
379
380 // packages/icons/build-module/library/redo.mjs
381 var import_primitives5 = __toESM(require_primitives(), 1);
382 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
383 var redo_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives5.Path, { d: "M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z" }) });
384
385 // packages/icons/build-module/library/undo.mjs
386 var import_primitives6 = __toESM(require_primitives(), 1);
387 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
388 var undo_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives6.Path, { d: "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z" }) });
389
390 // packages/customize-widgets/build-module/components/inserter/index.mjs
391 var import_i18n3 = __toESM(require_i18n(), 1);
392 var import_block_editor3 = __toESM(require_block_editor(), 1);
393 var import_components3 = __toESM(require_components(), 1);
394 var import_compose2 = __toESM(require_compose(), 1);
395 var import_data4 = __toESM(require_data(), 1);
396
397 // packages/customize-widgets/build-module/store/index.mjs
398 var import_data3 = __toESM(require_data(), 1);
399
400 // packages/customize-widgets/build-module/store/reducer.mjs
401 var import_data2 = __toESM(require_data(), 1);
402 function blockInserterPanel(state = false, action) {
403 switch (action.type) {
404 case "SET_IS_INSERTER_OPENED":
405 return action.value;
406 }
407 return state;
408 }
409 var reducer_default = (0, import_data2.combineReducers)({
410 blockInserterPanel
411 });
412
413 // packages/customize-widgets/build-module/store/selectors.mjs
414 var selectors_exports = {};
415 __export(selectors_exports, {
416 __experimentalGetInsertionPoint: () => __experimentalGetInsertionPoint,
417 isInserterOpened: () => isInserterOpened
418 });
419 var EMPTY_INSERTION_POINT = {
420 rootClientId: void 0,
421 insertionIndex: void 0
422 };
423 function isInserterOpened(state) {
424 return !!state.blockInserterPanel;
425 }
426 function __experimentalGetInsertionPoint(state) {
427 if (typeof state.blockInserterPanel === "boolean") {
428 return EMPTY_INSERTION_POINT;
429 }
430 return state.blockInserterPanel;
431 }
432
433 // packages/customize-widgets/build-module/store/actions.mjs
434 var actions_exports = {};
435 __export(actions_exports, {
436 setIsInserterOpened: () => setIsInserterOpened
437 });
438 function setIsInserterOpened(value) {
439 return {
440 type: "SET_IS_INSERTER_OPENED",
441 value
442 };
443 }
444
445 // packages/customize-widgets/build-module/store/constants.mjs
446 var STORE_NAME = "core/customize-widgets";
447
448 // packages/customize-widgets/build-module/store/index.mjs
449 var storeConfig = {
450 reducer: reducer_default,
451 selectors: selectors_exports,
452 actions: actions_exports
453 };
454 var store = (0, import_data3.createReduxStore)(STORE_NAME, storeConfig);
455 (0, import_data3.register)(store);
456
457 // packages/customize-widgets/build-module/components/inserter/index.mjs
458 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
459 function Inserter({ setIsOpened }) {
460 const inserterTitleId = (0, import_compose2.useInstanceId)(
461 Inserter,
462 "customize-widget-layout__inserter-panel-title"
463 );
464 const insertionPoint = (0, import_data4.useSelect)(
465 (select) => select(store).__experimentalGetInsertionPoint(),
466 []
467 );
468 return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
469 "div",
470 {
471 className: "customize-widgets-layout__inserter-panel",
472 "aria-labelledby": inserterTitleId,
473 children: [
474 /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "customize-widgets-layout__inserter-panel-header", children: [
475 /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
476 "h2",
477 {
478 id: inserterTitleId,
479 className: "customize-widgets-layout__inserter-panel-header-title",
480 children: (0, import_i18n3.__)("Add a block")
481 }
482 ),
483 /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
484 import_components3.Button,
485 {
486 size: "small",
487 icon: close_small_default,
488 onClick: () => setIsOpened(false),
489 "aria-label": (0, import_i18n3.__)("Close inserter")
490 }
491 )
492 ] }),
493 /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "customize-widgets-layout__inserter-panel-content", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
494 import_block_editor3.__experimentalLibrary,
495 {
496 rootClientId: insertionPoint.rootClientId,
497 __experimentalInsertionIndex: insertionPoint.insertionIndex,
498 showInserterHelpPanel: true,
499 onSelect: () => setIsOpened(false)
500 }
501 ) })
502 ]
503 }
504 );
505 }
506 var inserter_default = Inserter;
507
508 // packages/customize-widgets/build-module/components/more-menu/index.mjs
509 var import_components5 = __toESM(require_components(), 1);
510 var import_element6 = __toESM(require_element(), 1);
511 var import_i18n6 = __toESM(require_i18n(), 1);
512 var import_keycodes2 = __toESM(require_keycodes(), 1);
513 var import_keyboard_shortcuts3 = __toESM(require_keyboard_shortcuts(), 1);
514 var import_preferences = __toESM(require_preferences(), 1);
515
516 // node_modules/@base-ui/utils/useRefWithInit.mjs
517 var React = __toESM(require_react(), 1);
518 var UNINITIALIZED = {};
519 function useRefWithInit(init, initArg) {
520 const ref = React.useRef(UNINITIALIZED);
521 if (ref.current === UNINITIALIZED) {
522 ref.current = init(initArg);
523 }
524 return ref;
525 }
526
527 // node_modules/@base-ui/utils/warn.mjs
528 var set;
529 if (true) {
530 set = /* @__PURE__ */ new Set();
531 }
532 function warn(...messages) {
533 if (true) {
534 const messageKey = messages.join(" ");
535 if (!set.has(messageKey)) {
536 set.add(messageKey);
537 console.warn(`Base UI: ${messageKey}`);
538 }
539 }
540 }
541
542 // node_modules/@base-ui/react/internals/useRenderElement.mjs
543 var React4 = __toESM(require_react(), 1);
544
545 // node_modules/@base-ui/utils/useMergedRefs.mjs
546 function useMergedRefs(a, b, c, d) {
547 const forkRef = useRefWithInit(createForkRef).current;
548 if (didChange(forkRef, a, b, c, d)) {
549 update(forkRef, [a, b, c, d]);
550 }
551 return forkRef.callback;
552 }
553 function useMergedRefsN(refs) {
554 const forkRef = useRefWithInit(createForkRef).current;
555 if (didChangeN(forkRef, refs)) {
556 update(forkRef, refs);
557 }
558 return forkRef.callback;
559 }
560 function createForkRef() {
561 return {
562 callback: null,
563 cleanup: null,
564 refs: []
565 };
566 }
567 function didChange(forkRef, a, b, c, d) {
568 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
569 }
570 function didChangeN(forkRef, newRefs) {
571 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
572 }
573 function update(forkRef, refs) {
574 forkRef.refs = refs;
575 if (refs.every((ref) => ref == null)) {
576 forkRef.callback = null;
577 return;
578 }
579 forkRef.callback = (instance) => {
580 if (forkRef.cleanup) {
581 forkRef.cleanup();
582 forkRef.cleanup = null;
583 }
584 if (instance != null) {
585 const cleanupCallbacks = Array(refs.length).fill(null);
586 for (let i = 0; i < refs.length; i += 1) {
587 const ref = refs[i];
588 if (ref == null) {
589 continue;
590 }
591 switch (typeof ref) {
592 case "function": {
593 const refCleanup = ref(instance);
594 if (typeof refCleanup === "function") {
595 cleanupCallbacks[i] = refCleanup;
596 }
597 break;
598 }
599 case "object": {
600 ref.current = instance;
601 break;
602 }
603 default:
604 }
605 }
606 forkRef.cleanup = () => {
607 for (let i = 0; i < refs.length; i += 1) {
608 const ref = refs[i];
609 if (ref == null) {
610 continue;
611 }
612 switch (typeof ref) {
613 case "function": {
614 const cleanupCallback = cleanupCallbacks[i];
615 if (typeof cleanupCallback === "function") {
616 cleanupCallback();
617 } else {
618 ref(null);
619 }
620 break;
621 }
622 case "object": {
623 ref.current = null;
624 break;
625 }
626 default:
627 }
628 }
629 };
630 }
631 };
632 }
633
634 // node_modules/@base-ui/utils/getReactElementRef.mjs
635 var React3 = __toESM(require_react(), 1);
636
637 // node_modules/@base-ui/utils/reactVersion.mjs
638 var React2 = __toESM(require_react(), 1);
639 var majorVersion = parseInt(React2.version, 10);
640 function isReactVersionAtLeast(reactVersionToCheck) {
641 return majorVersion >= reactVersionToCheck;
642 }
643
644 // node_modules/@base-ui/utils/getReactElementRef.mjs
645 function getReactElementRef(element) {
646 if (!/* @__PURE__ */ React3.isValidElement(element)) {
647 return null;
648 }
649 const reactElement = element;
650 const propsWithRef = reactElement.props;
651 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
652 }
653
654 // node_modules/@base-ui/utils/mergeObjects.mjs
655 function mergeObjects(a, b) {
656 if (a && !b) {
657 return a;
658 }
659 if (!a && b) {
660 return b;
661 }
662 if (a || b) {
663 return {
664 ...a,
665 ...b
666 };
667 }
668 return void 0;
669 }
670
671 // node_modules/@base-ui/utils/empty.mjs
672 var EMPTY_ARRAY = Object.freeze([]);
673 var EMPTY_OBJECT = Object.freeze({});
674
675 // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
676 function getStateAttributesProps(state, customMapping) {
677 const props = {};
678 for (const key in state) {
679 const value = state[key];
680 if (customMapping?.hasOwnProperty(key)) {
681 const customProps = customMapping[key](value);
682 if (customProps != null) {
683 Object.assign(props, customProps);
684 }
685 continue;
686 }
687 if (value === true) {
688 props[`data-${key.toLowerCase()}`] = "";
689 } else if (value) {
690 props[`data-${key.toLowerCase()}`] = value.toString();
691 }
692 }
693 return props;
694 }
695
696 // node_modules/@base-ui/react/utils/resolveClassName.mjs
697 function resolveClassName(className, state) {
698 return typeof className === "function" ? className(state) : className;
699 }
700
701 // node_modules/@base-ui/react/utils/resolveStyle.mjs
702 function resolveStyle(style, state) {
703 return typeof style === "function" ? style(state) : style;
704 }
705
706 // node_modules/@base-ui/react/merge-props/mergeProps.mjs
707 var EMPTY_PROPS = {};
708 function mergeProps(a, b, c, d, e) {
709 if (!c && !d && !e && !a) {
710 return createInitialMergedProps(b);
711 }
712 let merged = createInitialMergedProps(a);
713 if (b) {
714 merged = mergeInto(merged, b);
715 }
716 if (c) {
717 merged = mergeInto(merged, c);
718 }
719 if (d) {
720 merged = mergeInto(merged, d);
721 }
722 if (e) {
723 merged = mergeInto(merged, e);
724 }
725 return merged;
726 }
727 function mergePropsN(props) {
728 if (props.length === 0) {
729 return EMPTY_PROPS;
730 }
731 if (props.length === 1) {
732 return createInitialMergedProps(props[0]);
733 }
734 let merged = createInitialMergedProps(props[0]);
735 for (let i = 1; i < props.length; i += 1) {
736 merged = mergeInto(merged, props[i]);
737 }
738 return merged;
739 }
740 function createInitialMergedProps(inputProps) {
741 if (isPropsGetter(inputProps)) {
742 return {
743 ...resolvePropsGetter(inputProps, EMPTY_PROPS)
744 };
745 }
746 return copyInitialProps(inputProps);
747 }
748 function mergeInto(merged, inputProps) {
749 if (isPropsGetter(inputProps)) {
750 return resolvePropsGetter(inputProps, merged);
751 }
752 return mutablyMergeInto(merged, inputProps);
753 }
754 function copyInitialProps(inputProps) {
755 const copiedProps = {
756 ...inputProps
757 };
758 for (const propName in copiedProps) {
759 const propValue = copiedProps[propName];
760 if (isEventHandler(propName, propValue)) {
761 copiedProps[propName] = wrapEventHandler(propValue);
762 }
763 }
764 return copiedProps;
765 }
766 function mutablyMergeInto(mergedProps, externalProps) {
767 if (!externalProps) {
768 return mergedProps;
769 }
770 for (const propName in externalProps) {
771 const externalPropValue = externalProps[propName];
772 switch (propName) {
773 case "style": {
774 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
775 break;
776 }
777 case "className": {
778 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
779 break;
780 }
781 default: {
782 if (isEventHandler(propName, externalPropValue)) {
783 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
784 } else {
785 mergedProps[propName] = externalPropValue;
786 }
787 }
788 }
789 }
790 return mergedProps;
791 }
792 function isEventHandler(key, value) {
793 const code0 = key.charCodeAt(0);
794 const code1 = key.charCodeAt(1);
795 const code2 = key.charCodeAt(2);
796 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
797 }
798 function isPropsGetter(inputProps) {
799 return typeof inputProps === "function";
800 }
801 function resolvePropsGetter(inputProps, previousProps) {
802 if (isPropsGetter(inputProps)) {
803 return inputProps(previousProps);
804 }
805 return inputProps ?? EMPTY_PROPS;
806 }
807 function mergeEventHandlers(ourHandler, theirHandler) {
808 if (!theirHandler) {
809 return ourHandler;
810 }
811 if (!ourHandler) {
812 return wrapEventHandler(theirHandler);
813 }
814 return (...args) => {
815 const event = args[0];
816 if (isSyntheticEvent(event)) {
817 const baseUIEvent = event;
818 makeEventPreventable(baseUIEvent);
819 const result2 = theirHandler(...args);
820 if (!baseUIEvent.baseUIHandlerPrevented) {
821 ourHandler?.(...args);
822 }
823 return result2;
824 }
825 const result = theirHandler(...args);
826 ourHandler?.(...args);
827 return result;
828 };
829 }
830 function wrapEventHandler(handler) {
831 if (!handler) {
832 return handler;
833 }
834 return (...args) => {
835 const event = args[0];
836 if (isSyntheticEvent(event)) {
837 makeEventPreventable(event);
838 }
839 return handler(...args);
840 };
841 }
842 function makeEventPreventable(event) {
843 event.preventBaseUIHandler = () => {
844 event.baseUIHandlerPrevented = true;
845 };
846 return event;
847 }
848 function mergeClassNames(ourClassName, theirClassName) {
849 if (theirClassName) {
850 if (ourClassName) {
851 return theirClassName + " " + ourClassName;
852 }
853 return theirClassName;
854 }
855 return ourClassName;
856 }
857 function isSyntheticEvent(event) {
858 return event != null && typeof event === "object" && "nativeEvent" in event;
859 }
860
861 // node_modules/@base-ui/react/internals/useRenderElement.mjs
862 var import_react = __toESM(require_react(), 1);
863 function useRenderElement(element, componentProps, params = {}) {
864 const renderProp = componentProps.render;
865 const outProps = useRenderElementProps(componentProps, params);
866 if (params.enabled === false) {
867 return null;
868 }
869 const state = params.state ?? EMPTY_OBJECT;
870 return evaluateRenderProp(element, renderProp, outProps, state);
871 }
872 function useRenderElementProps(componentProps, params = {}) {
873 const {
874 className: classNameProp,
875 style: styleProp,
876 render: renderProp
877 } = componentProps;
878 const {
879 state = EMPTY_OBJECT,
880 ref,
881 props,
882 stateAttributesMapping,
883 enabled = true
884 } = params;
885 const className = enabled ? resolveClassName(classNameProp, state) : void 0;
886 const style = enabled ? resolveStyle(styleProp, state) : void 0;
887 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;
888 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
889 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
890 if (typeof document !== "undefined") {
891 if (!enabled) {
892 useMergedRefs(null, null);
893 } else if (Array.isArray(ref)) {
894 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
895 } else {
896 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
897 }
898 }
899 if (!enabled) {
900 return EMPTY_OBJECT;
901 }
902 if (className !== void 0) {
903 outProps.className = mergeClassNames(outProps.className, className);
904 }
905 if (style !== void 0) {
906 outProps.style = mergeObjects(outProps.style, style);
907 }
908 return outProps;
909 }
910 function resolveRenderFunctionProps(props) {
911 if (Array.isArray(props)) {
912 return mergePropsN(props);
913 }
914 return mergeProps(void 0, props);
915 }
916 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
917 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
918 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
919 function evaluateRenderProp(element, render, props, state) {
920 if (render) {
921 if (typeof render === "function") {
922 if (true) {
923 warnIfRenderPropLooksLikeComponent(render);
924 }
925 return render(props, state);
926 }
927 const mergedProps = mergeProps(props, render.props);
928 mergedProps.ref = props.ref;
929 let newElement = render;
930 if (newElement?.$$typeof === REACT_LAZY_TYPE) {
931 const children = React4.Children.toArray(render);
932 newElement = children[0];
933 }
934 if (true) {
935 if (!/* @__PURE__ */ React4.isValidElement(newElement)) {
936 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"));
937 }
938 }
939 return /* @__PURE__ */ React4.cloneElement(newElement, mergedProps);
940 }
941 if (element) {
942 if (typeof element === "string") {
943 return renderTag(element, props);
944 }
945 }
946 throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8));
947 }
948 function warnIfRenderPropLooksLikeComponent(renderFn) {
949 const functionName = renderFn.name;
950 if (functionName.length === 0) {
951 return;
952 }
953 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {
954 return;
955 }
956 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {
957 return;
958 }
959 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");
960 }
961 function renderTag(Tag, props) {
962 if (Tag === "button") {
963 return /* @__PURE__ */ (0, import_react.createElement)("button", {
964 type: "button",
965 ...props,
966 key: props.key
967 });
968 }
969 if (Tag === "img") {
970 return /* @__PURE__ */ (0, import_react.createElement)("img", {
971 alt: "",
972 ...props,
973 key: props.key
974 });
975 }
976 return /* @__PURE__ */ React4.createElement(Tag, props);
977 }
978
979 // node_modules/@base-ui/react/use-render/useRender.mjs
980 function useRender(params) {
981 return useRenderElement(params.defaultTagName ?? "div", params, params);
982 }
983
984 // packages/ui/build-module/visually-hidden/visually-hidden.mjs
985 var import_element3 = __toESM(require_element(), 1);
986 var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
987 function getRuntime() {
988 const globalScope = globalThis;
989 if (globalScope.__wpStyleRuntime) {
990 return globalScope.__wpStyleRuntime;
991 }
992 globalScope.__wpStyleRuntime = {
993 documents: /* @__PURE__ */ new Map(),
994 styles: /* @__PURE__ */ new Map(),
995 injectedStyles: /* @__PURE__ */ new WeakMap()
996 };
997 if (typeof document !== "undefined") {
998 registerDocument(document);
999 }
1000 return globalScope.__wpStyleRuntime;
1001 }
1002 function documentContainsStyleHash(targetDocument, hash) {
1003 if (!targetDocument.head) {
1004 return false;
1005 }
1006 for (const style of targetDocument.head.querySelectorAll(
1007 `style[${STYLE_HASH_ATTRIBUTE}]`
1008 )) {
1009 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
1010 return true;
1011 }
1012 }
1013 return false;
1014 }
1015 function injectStyle(targetDocument, hash, css) {
1016 if (!targetDocument.head) {
1017 return;
1018 }
1019 const runtime = getRuntime();
1020 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1021 if (!injectedStyles) {
1022 injectedStyles = /* @__PURE__ */ new Set();
1023 runtime.injectedStyles.set(targetDocument, injectedStyles);
1024 }
1025 if (injectedStyles.has(hash)) {
1026 return;
1027 }
1028 if (documentContainsStyleHash(targetDocument, hash)) {
1029 injectedStyles.add(hash);
1030 return;
1031 }
1032 const style = targetDocument.createElement("style");
1033 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
1034 style.appendChild(targetDocument.createTextNode(css));
1035 targetDocument.head.appendChild(style);
1036 injectedStyles.add(hash);
1037 }
1038 function registerDocument(targetDocument) {
1039 const runtime = getRuntime();
1040 runtime.documents.set(
1041 targetDocument,
1042 (runtime.documents.get(targetDocument) ?? 0) + 1
1043 );
1044 for (const [hash, css] of runtime.styles) {
1045 injectStyle(targetDocument, hash, css);
1046 }
1047 return () => {
1048 const count = runtime.documents.get(targetDocument);
1049 if (count === void 0) {
1050 return;
1051 }
1052 if (count <= 1) {
1053 runtime.documents.delete(targetDocument);
1054 return;
1055 }
1056 runtime.documents.set(targetDocument, count - 1);
1057 };
1058 }
1059 function registerStyle(hash, css) {
1060 const runtime = getRuntime();
1061 runtime.styles.set(hash, css);
1062 for (const targetDocument of runtime.documents.keys()) {
1063 injectStyle(targetDocument, hash, css);
1064 }
1065 }
1066 if (typeof process === "undefined" || true) {
1067 registerStyle("fa606a57ae", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{word-wrap:normal;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-break:normal}}}");
1068 }
1069 var style_default = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" };
1070 var VisuallyHidden = (0, import_element3.forwardRef)(
1071 function VisuallyHidden2({ render, ...restProps }, ref) {
1072 const element = useRender({
1073 render,
1074 ref,
1075 props: mergeProps(
1076 { className: style_default["visually-hidden"] },
1077 restProps,
1078 {
1079 // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it.
1080 "data-visually-hidden": ""
1081 }
1082 )
1083 });
1084 return element;
1085 }
1086 );
1087
1088 // packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/index.mjs
1089 var import_components4 = __toESM(require_components(), 1);
1090 var import_i18n5 = __toESM(require_i18n(), 1);
1091 var import_keyboard_shortcuts2 = __toESM(require_keyboard_shortcuts(), 1);
1092 var import_data6 = __toESM(require_data(), 1);
1093 var import_element5 = __toESM(require_element(), 1);
1094
1095 // packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/config.mjs
1096 var import_i18n4 = __toESM(require_i18n(), 1);
1097 var textFormattingShortcuts = [
1098 {
1099 keyCombination: { modifier: "primary", character: "b" },
1100 description: (0, import_i18n4.__)("Make the selected text bold.")
1101 },
1102 {
1103 keyCombination: { modifier: "primary", character: "i" },
1104 description: (0, import_i18n4.__)("Make the selected text italic.")
1105 },
1106 {
1107 keyCombination: { modifier: "primary", character: "k" },
1108 description: (0, import_i18n4.__)("Convert the selected text into a link.")
1109 },
1110 {
1111 keyCombination: { modifier: "primaryShift", character: "k" },
1112 description: (0, import_i18n4.__)("Remove a link.")
1113 },
1114 {
1115 keyCombination: { character: "[[" },
1116 description: (0, import_i18n4.__)("Insert a link to a post or page.")
1117 },
1118 {
1119 keyCombination: { modifier: "primary", character: "u" },
1120 description: (0, import_i18n4.__)("Underline the selected text.")
1121 },
1122 {
1123 keyCombination: { modifier: "access", character: "d" },
1124 description: (0, import_i18n4.__)("Strikethrough the selected text.")
1125 },
1126 {
1127 keyCombination: { modifier: "access", character: "x" },
1128 description: (0, import_i18n4.__)("Make the selected text inline code.")
1129 },
1130 {
1131 keyCombination: {
1132 modifier: "access",
1133 character: "0"
1134 },
1135 aliases: [
1136 {
1137 modifier: "access",
1138 character: "7"
1139 }
1140 ],
1141 description: (0, import_i18n4.__)("Convert the current heading to a paragraph.")
1142 },
1143 {
1144 keyCombination: { modifier: "access", character: "1-6" },
1145 description: (0, import_i18n4.__)(
1146 "Convert the current paragraph or heading to a heading of level 1 to 6."
1147 )
1148 },
1149 {
1150 keyCombination: { modifier: "primaryShift", character: "SPACE" },
1151 description: (0, import_i18n4.__)("Add non breaking space.")
1152 }
1153 ];
1154
1155 // packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs
1156 var import_element4 = __toESM(require_element(), 1);
1157 var import_keycodes = __toESM(require_keycodes(), 1);
1158 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
1159 function KeyCombination({ keyCombination, forceAriaLabel }) {
1160 const shortcut = keyCombination.modifier ? import_keycodes.displayShortcutList[keyCombination.modifier](
1161 keyCombination.character
1162 ) : keyCombination.character;
1163 const ariaLabel = keyCombination.modifier ? import_keycodes.shortcutAriaLabel[keyCombination.modifier](
1164 keyCombination.character
1165 ) : keyCombination.character;
1166 return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1167 "kbd",
1168 {
1169 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination",
1170 "aria-label": forceAriaLabel || ariaLabel,
1171 children: (Array.isArray(shortcut) ? shortcut : [shortcut]).map(
1172 (character, index) => {
1173 if (character === "+") {
1174 return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_element4.Fragment, { children: character }, index);
1175 }
1176 return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1177 "kbd",
1178 {
1179 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-key",
1180 children: character
1181 },
1182 index
1183 );
1184 }
1185 )
1186 }
1187 );
1188 }
1189 function Shortcut({ description, keyCombination, aliases = [], ariaLabel }) {
1190 return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1191 /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-description", children: description }),
1192 /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-term", children: [
1193 /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1194 KeyCombination,
1195 {
1196 keyCombination,
1197 forceAriaLabel: ariaLabel
1198 }
1199 ),
1200 aliases.map((alias, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1201 KeyCombination,
1202 {
1203 keyCombination: alias,
1204 forceAriaLabel: ariaLabel
1205 },
1206 index
1207 ))
1208 ] })
1209 ] });
1210 }
1211 var shortcut_default = Shortcut;
1212
1213 // packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs
1214 var import_data5 = __toESM(require_data(), 1);
1215 var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1);
1216 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
1217 function DynamicShortcut({ name }) {
1218 const { keyCombination, description, aliases } = (0, import_data5.useSelect)(
1219 (select) => {
1220 const {
1221 getShortcutKeyCombination,
1222 getShortcutDescription,
1223 getShortcutAliases
1224 } = select(import_keyboard_shortcuts.store);
1225 return {
1226 keyCombination: getShortcutKeyCombination(name),
1227 aliases: getShortcutAliases(name),
1228 description: getShortcutDescription(name)
1229 };
1230 },
1231 [name]
1232 );
1233 if (!keyCombination) {
1234 return null;
1235 }
1236 return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1237 shortcut_default,
1238 {
1239 keyCombination,
1240 description,
1241 aliases
1242 }
1243 );
1244 }
1245 var dynamic_shortcut_default = DynamicShortcut;
1246
1247 // packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/index.mjs
1248 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
1249 var ShortcutList = ({ shortcuts }) => (
1250 /*
1251 * Disable reason: The `list` ARIA role is redundant but
1252 * Safari+VoiceOver won't announce the list otherwise.
1253 */
1254 /* eslint-disable jsx-a11y/no-redundant-roles */
1255 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1256 "ul",
1257 {
1258 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-list",
1259 role: "list",
1260 children: shortcuts.map((shortcut, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1261 "li",
1262 {
1263 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut",
1264 children: typeof shortcut === "string" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(dynamic_shortcut_default, { name: shortcut }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(shortcut_default, { ...shortcut })
1265 },
1266 index
1267 ))
1268 }
1269 )
1270 );
1271 var ShortcutSection = ({ title, shortcuts, className }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1272 "section",
1273 {
1274 className: clsx_default(
1275 "customize-widgets-keyboard-shortcut-help-modal__section",
1276 className
1277 ),
1278 children: [
1279 !!title && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { className: "customize-widgets-keyboard-shortcut-help-modal__section-title", children: title }),
1280 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ShortcutList, { shortcuts })
1281 ]
1282 }
1283 );
1284 var ShortcutCategorySection = ({
1285 title,
1286 categoryName,
1287 additionalShortcuts = []
1288 }) => {
1289 const categoryShortcuts = (0, import_data6.useSelect)(
1290 (select) => {
1291 return select(import_keyboard_shortcuts2.store).getCategoryShortcuts(
1292 categoryName
1293 );
1294 },
1295 [categoryName]
1296 );
1297 return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1298 ShortcutSection,
1299 {
1300 title,
1301 shortcuts: categoryShortcuts.concat(additionalShortcuts)
1302 }
1303 );
1304 };
1305 function KeyboardShortcutHelpModal({
1306 isModalActive,
1307 toggleModal
1308 }) {
1309 const { registerShortcut } = (0, import_data6.useDispatch)(import_keyboard_shortcuts2.store);
1310 (0, import_element5.useEffect)(() => {
1311 registerShortcut({
1312 name: "core/customize-widgets/keyboard-shortcuts",
1313 category: "main",
1314 description: (0, import_i18n5.__)("Display these keyboard shortcuts."),
1315 keyCombination: {
1316 modifier: "access",
1317 character: "h"
1318 }
1319 });
1320 }, [registerShortcut]);
1321 (0, import_keyboard_shortcuts2.useShortcut)("core/customize-widgets/keyboard-shortcuts", toggleModal);
1322 if (!isModalActive) {
1323 return null;
1324 }
1325 return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1326 import_components4.Modal,
1327 {
1328 className: "customize-widgets-keyboard-shortcut-help-modal",
1329 title: (0, import_i18n5.__)("Keyboard shortcuts"),
1330 onRequestClose: toggleModal,
1331 children: [
1332 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1333 ShortcutSection,
1334 {
1335 className: "customize-widgets-keyboard-shortcut-help-modal__main-shortcuts",
1336 shortcuts: ["core/customize-widgets/keyboard-shortcuts"]
1337 }
1338 ),
1339 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1340 ShortcutCategorySection,
1341 {
1342 title: (0, import_i18n5.__)("Global shortcuts"),
1343 categoryName: "global"
1344 }
1345 ),
1346 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1347 ShortcutCategorySection,
1348 {
1349 title: (0, import_i18n5.__)("Selection shortcuts"),
1350 categoryName: "selection"
1351 }
1352 ),
1353 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1354 ShortcutCategorySection,
1355 {
1356 title: (0, import_i18n5.__)("Block shortcuts"),
1357 categoryName: "block",
1358 additionalShortcuts: [
1359 {
1360 keyCombination: { character: "/" },
1361 description: (0, import_i18n5.__)(
1362 "Change the block type after adding a new paragraph."
1363 ),
1364 /* translators: The forward-slash character. e.g. '/'. */
1365 ariaLabel: (0, import_i18n5.__)("Forward-slash")
1366 }
1367 ]
1368 }
1369 ),
1370 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1371 ShortcutSection,
1372 {
1373 title: (0, import_i18n5.__)("Text formatting"),
1374 shortcuts: textFormattingShortcuts
1375 }
1376 )
1377 ]
1378 }
1379 );
1380 }
1381
1382 // packages/customize-widgets/build-module/components/more-menu/index.mjs
1383 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
1384 function MoreMenu() {
1385 const [
1386 isKeyboardShortcutsModalActive,
1387 setIsKeyboardShortcutsModalVisible
1388 ] = (0, import_element6.useState)(false);
1389 const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive);
1390 (0, import_keyboard_shortcuts3.useShortcut)(
1391 "core/customize-widgets/keyboard-shortcuts",
1392 toggleKeyboardShortcutsModal
1393 );
1394 return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1395 /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1396 import_components5.ToolbarDropdownMenu,
1397 {
1398 icon: more_vertical_default,
1399 label: (0, import_i18n6.__)("Options"),
1400 popoverProps: {
1401 placement: "bottom-end",
1402 className: "more-menu-dropdown__content"
1403 },
1404 toggleProps: {
1405 tooltipPosition: "bottom",
1406 size: "compact"
1407 },
1408 children: () => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1409 /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_components5.MenuGroup, { label: (0, import_i18n6._x)("View", "noun"), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1410 import_preferences.PreferenceToggleMenuItem,
1411 {
1412 scope: "core/customize-widgets",
1413 name: "fixedToolbar",
1414 label: (0, import_i18n6.__)("Top toolbar"),
1415 info: (0, import_i18n6.__)(
1416 "Access all block and document tools in a single place"
1417 ),
1418 messageActivated: (0, import_i18n6.__)(
1419 "Top toolbar activated"
1420 ),
1421 messageDeactivated: (0, import_i18n6.__)(
1422 "Top toolbar deactivated"
1423 )
1424 }
1425 ) }),
1426 /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_components5.MenuGroup, { label: (0, import_i18n6.__)("Tools"), children: [
1427 /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1428 import_components5.MenuItem,
1429 {
1430 onClick: () => {
1431 setIsKeyboardShortcutsModalVisible(true);
1432 },
1433 shortcut: import_keycodes2.displayShortcut.access("h"),
1434 children: (0, import_i18n6.__)("Keyboard shortcuts")
1435 }
1436 ),
1437 /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1438 import_preferences.PreferenceToggleMenuItem,
1439 {
1440 scope: "core/customize-widgets",
1441 name: "welcomeGuide",
1442 label: (0, import_i18n6.__)("Welcome Guide")
1443 }
1444 ),
1445 /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1446 import_components5.MenuItem,
1447 {
1448 role: "menuitem",
1449 icon: external_default,
1450 href: (0, import_i18n6.__)(
1451 "https://wordpress.org/documentation/article/block-based-widgets-editor/"
1452 ),
1453 target: "_blank",
1454 rel: "noopener",
1455 children: [
1456 (0, import_i18n6.__)("Help"),
1457 /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(VisuallyHidden, {
1458 render: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", {}),
1459 /* translators: accessibility text */
1460 children: (0, import_i18n6.__)("(opens in a new tab)")
1461 })
1462 ]
1463 }
1464 )
1465 ] }),
1466 /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_components5.MenuGroup, { label: (0, import_i18n6.__)("Preferences"), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1467 import_preferences.PreferenceToggleMenuItem,
1468 {
1469 scope: "core/customize-widgets",
1470 name: "keepCaretInsideBlock",
1471 label: (0, import_i18n6.__)(
1472 "Contain text cursor inside block"
1473 ),
1474 info: (0, import_i18n6.__)(
1475 "Aids screen readers by stopping text caret from leaving blocks."
1476 ),
1477 messageActivated: (0, import_i18n6.__)(
1478 "Contain text cursor inside block activated"
1479 ),
1480 messageDeactivated: (0, import_i18n6.__)(
1481 "Contain text cursor inside block deactivated"
1482 )
1483 }
1484 ) })
1485 ] })
1486 }
1487 ),
1488 /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1489 KeyboardShortcutHelpModal,
1490 {
1491 isModalActive: isKeyboardShortcutsModalActive,
1492 toggleModal: toggleKeyboardShortcutsModal
1493 }
1494 )
1495 ] });
1496 }
1497
1498 // packages/customize-widgets/build-module/components/header/index.mjs
1499 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
1500 function Header({
1501 sidebar,
1502 inserter,
1503 isInserterOpened: isInserterOpened2,
1504 setIsInserterOpened: setIsInserterOpened2,
1505 isFixedToolbarActive
1506 }) {
1507 const [[hasUndo, hasRedo], setUndoRedo] = (0, import_element7.useState)([
1508 sidebar.hasUndo(),
1509 sidebar.hasRedo()
1510 ]);
1511 const shortcut = (0, import_keycodes3.isAppleOS)() ? import_keycodes3.displayShortcut.primaryShift("z") : import_keycodes3.displayShortcut.primary("y");
1512 (0, import_element7.useEffect)(() => {
1513 return sidebar.subscribeHistory(() => {
1514 setUndoRedo([sidebar.hasUndo(), sidebar.hasRedo()]);
1515 });
1516 }, [sidebar]);
1517 return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
1518 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1519 "div",
1520 {
1521 className: clsx_default("customize-widgets-header", {
1522 "is-fixed-toolbar-active": isFixedToolbarActive
1523 }),
1524 children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1525 import_block_editor4.NavigableToolbar,
1526 {
1527 className: "customize-widgets-header-toolbar",
1528 "aria-label": (0, import_i18n7.__)("Document tools"),
1529 children: [
1530 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1531 import_components6.ToolbarButton,
1532 {
1533 icon: !(0, import_i18n7.isRTL)() ? undo_default : redo_default,
1534 label: (0, import_i18n7.__)("Undo"),
1535 shortcut: import_keycodes3.displayShortcut.primary("z"),
1536 disabled: !hasUndo,
1537 onClick: sidebar.undo,
1538 className: "customize-widgets-editor-history-button undo-button"
1539 }
1540 ),
1541 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1542 import_components6.ToolbarButton,
1543 {
1544 icon: !(0, import_i18n7.isRTL)() ? redo_default : undo_default,
1545 label: (0, import_i18n7.__)("Redo"),
1546 shortcut,
1547 disabled: !hasRedo,
1548 onClick: sidebar.redo,
1549 className: "customize-widgets-editor-history-button redo-button"
1550 }
1551 ),
1552 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1553 import_components6.ToolbarButton,
1554 {
1555 className: "customize-widgets-header-toolbar__inserter-toggle",
1556 isPressed: isInserterOpened2,
1557 variant: "primary",
1558 icon: plus_default,
1559 label: (0, import_i18n7._x)(
1560 "Add block",
1561 "Generic label for block inserter button"
1562 ),
1563 onClick: () => {
1564 setIsInserterOpened2((isOpen) => !isOpen);
1565 }
1566 }
1567 ),
1568 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MoreMenu, {})
1569 ]
1570 }
1571 )
1572 }
1573 ),
1574 (0, import_element7.createPortal)(
1575 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(inserter_default, { setIsOpened: setIsInserterOpened2 }),
1576 inserter.contentContainer[0]
1577 )
1578 ] });
1579 }
1580 var header_default = Header;
1581
1582 // packages/customize-widgets/build-module/components/inserter/use-inserter.mjs
1583 var import_element8 = __toESM(require_element(), 1);
1584 var import_data7 = __toESM(require_data(), 1);
1585 function useInserter(inserter) {
1586 const isInserterOpened2 = (0, import_data7.useSelect)(
1587 (select) => select(store).isInserterOpened(),
1588 []
1589 );
1590 const { setIsInserterOpened: setIsInserterOpened2 } = (0, import_data7.useDispatch)(store);
1591 (0, import_element8.useEffect)(() => {
1592 if (isInserterOpened2) {
1593 inserter.open();
1594 } else {
1595 inserter.close();
1596 }
1597 }, [inserter, isInserterOpened2]);
1598 return [
1599 isInserterOpened2,
1600 (0, import_element8.useCallback)(
1601 (updater) => {
1602 let isOpen = updater;
1603 if (typeof updater === "function") {
1604 isOpen = updater(
1605 (0, import_data7.select)(store).isInserterOpened()
1606 );
1607 }
1608 setIsInserterOpened2(isOpen);
1609 },
1610 [setIsInserterOpened2]
1611 )
1612 ];
1613 }
1614
1615 // packages/customize-widgets/build-module/components/sidebar-block-editor/sidebar-editor-provider.mjs
1616 var import_block_editor6 = __toESM(require_block_editor(), 1);
1617
1618 // packages/customize-widgets/build-module/components/sidebar-block-editor/use-sidebar-block-editor.mjs
1619 var import_es6 = __toESM(require_es6(), 1);
1620 var import_element9 = __toESM(require_element(), 1);
1621 var import_is_shallow_equal = __toESM(require_is_shallow_equal(), 1);
1622 var import_widgets2 = __toESM(require_widgets(), 1);
1623
1624 // packages/customize-widgets/build-module/utils.mjs
1625 var import_blocks = __toESM(require_blocks(), 1);
1626 var import_widgets = __toESM(require_widgets(), 1);
1627 function settingIdToWidgetId(settingId) {
1628 const matches = settingId.match(/^widget_(.+)(?:\[(\d+)\])$/);
1629 if (matches) {
1630 const idBase = matches[1];
1631 const number = parseInt(matches[2], 10);
1632 return `${idBase}-${number}`;
1633 }
1634 return settingId;
1635 }
1636 function blockToWidget(block, existingWidget = null) {
1637 let widget;
1638 const isValidLegacyWidgetBlock = block.name === "core/legacy-widget" && (block.attributes.id || block.attributes.instance);
1639 if (isValidLegacyWidgetBlock) {
1640 if (block.attributes.id) {
1641 widget = {
1642 id: block.attributes.id
1643 };
1644 } else {
1645 const { encoded, hash, raw, ...rest } = block.attributes.instance;
1646 widget = {
1647 idBase: block.attributes.idBase,
1648 instance: {
1649 ...existingWidget?.instance,
1650 // Required only for the customizer.
1651 is_widget_customizer_js_value: true,
1652 encoded_serialized_instance: encoded,
1653 instance_hash_key: hash,
1654 raw_instance: raw,
1655 ...rest
1656 }
1657 };
1658 }
1659 } else {
1660 const instance = {
1661 content: (0, import_blocks.serialize)(block)
1662 };
1663 widget = {
1664 idBase: "block",
1665 widgetClass: "WP_Widget_Block",
1666 instance: {
1667 raw_instance: instance
1668 }
1669 };
1670 }
1671 const { form, rendered, ...restExistingWidget } = existingWidget || {};
1672 return {
1673 ...restExistingWidget,
1674 ...widget
1675 };
1676 }
1677 function widgetToBlock({ id, idBase, number, instance }) {
1678 let block;
1679 const {
1680 encoded_serialized_instance: encoded,
1681 instance_hash_key: hash,
1682 raw_instance: raw,
1683 ...rest
1684 } = instance;
1685 if (idBase === "block") {
1686 const parsedBlocks = (0, import_blocks.parse)(raw.content ?? "", {
1687 __unstableSkipAutop: true
1688 });
1689 block = parsedBlocks.length ? parsedBlocks[0] : (0, import_blocks.createBlock)("core/paragraph", {});
1690 } else if (number) {
1691 block = (0, import_blocks.createBlock)("core/legacy-widget", {
1692 idBase,
1693 instance: {
1694 encoded,
1695 hash,
1696 raw,
1697 ...rest
1698 }
1699 });
1700 } else {
1701 block = (0, import_blocks.createBlock)("core/legacy-widget", {
1702 id
1703 });
1704 }
1705 return (0, import_widgets.addWidgetIdToBlock)(block, id);
1706 }
1707
1708 // packages/customize-widgets/build-module/components/sidebar-block-editor/use-sidebar-block-editor.mjs
1709 function widgetsToBlocks(widgets) {
1710 return widgets.map((widget) => widgetToBlock(widget));
1711 }
1712 function useSidebarBlockEditor(sidebar) {
1713 const [blocks, setBlocks] = (0, import_element9.useState)(
1714 () => widgetsToBlocks(sidebar.getWidgets())
1715 );
1716 (0, import_element9.useEffect)(() => {
1717 return sidebar.subscribe((prevWidgets, nextWidgets) => {
1718 setBlocks((prevBlocks) => {
1719 const prevWidgetsMap = new Map(
1720 prevWidgets.map((widget) => [widget.id, widget])
1721 );
1722 const prevBlocksMap = new Map(
1723 prevBlocks.map((block) => [
1724 (0, import_widgets2.getWidgetIdFromBlock)(block),
1725 block
1726 ])
1727 );
1728 const nextBlocks = nextWidgets.map((nextWidget) => {
1729 const prevWidget = prevWidgetsMap.get(nextWidget.id);
1730 if (prevWidget && prevWidget === nextWidget) {
1731 return prevBlocksMap.get(nextWidget.id);
1732 }
1733 return widgetToBlock(nextWidget);
1734 });
1735 if ((0, import_is_shallow_equal.isShallowEqual)(prevBlocks, nextBlocks)) {
1736 return prevBlocks;
1737 }
1738 return nextBlocks;
1739 });
1740 });
1741 }, [sidebar]);
1742 const onChangeBlocks = (0, import_element9.useCallback)(
1743 (nextBlocks) => {
1744 setBlocks((prevBlocks) => {
1745 if ((0, import_is_shallow_equal.isShallowEqual)(prevBlocks, nextBlocks)) {
1746 return prevBlocks;
1747 }
1748 const prevBlocksMap = new Map(
1749 prevBlocks.map((block) => [
1750 (0, import_widgets2.getWidgetIdFromBlock)(block),
1751 block
1752 ])
1753 );
1754 const nextWidgets = nextBlocks.map((nextBlock) => {
1755 const widgetId = (0, import_widgets2.getWidgetIdFromBlock)(nextBlock);
1756 if (widgetId && prevBlocksMap.has(widgetId)) {
1757 const prevBlock = prevBlocksMap.get(widgetId);
1758 const prevWidget = sidebar.getWidget(widgetId);
1759 if ((0, import_es6.default)(nextBlock, prevBlock) && prevWidget) {
1760 return prevWidget;
1761 }
1762 return blockToWidget(nextBlock, prevWidget);
1763 }
1764 return blockToWidget(nextBlock);
1765 });
1766 if ((0, import_is_shallow_equal.isShallowEqual)(sidebar.getWidgets(), nextWidgets)) {
1767 return prevBlocks;
1768 }
1769 const addedWidgetIds = sidebar.setWidgets(nextWidgets);
1770 return nextBlocks.reduce(
1771 (updatedNextBlocks, nextBlock, index) => {
1772 const addedWidgetId = addedWidgetIds[index];
1773 if (addedWidgetId !== null) {
1774 if (updatedNextBlocks === nextBlocks) {
1775 updatedNextBlocks = nextBlocks.slice();
1776 }
1777 updatedNextBlocks[index] = (0, import_widgets2.addWidgetIdToBlock)(
1778 nextBlock,
1779 addedWidgetId
1780 );
1781 }
1782 return updatedNextBlocks;
1783 },
1784 nextBlocks
1785 );
1786 });
1787 },
1788 [sidebar]
1789 );
1790 return [blocks, onChangeBlocks, onChangeBlocks];
1791 }
1792
1793 // packages/customize-widgets/build-module/components/focus-control/use-blocks-focus-control.mjs
1794 var import_element11 = __toESM(require_element(), 1);
1795 var import_data8 = __toESM(require_data(), 1);
1796 var import_block_editor5 = __toESM(require_block_editor(), 1);
1797 var import_widgets3 = __toESM(require_widgets(), 1);
1798
1799 // packages/customize-widgets/build-module/components/focus-control/index.mjs
1800 var import_element10 = __toESM(require_element(), 1);
1801 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
1802 var FocusControlContext = (0, import_element10.createContext)();
1803 FocusControlContext.displayName = "FocusControlContext";
1804 function FocusControl({ api, sidebarControls, children }) {
1805 const [focusedWidgetIdRef, setFocusedWidgetIdRef] = (0, import_element10.useState)({
1806 current: null
1807 });
1808 const focusWidget = (0, import_element10.useCallback)(
1809 (widgetId) => {
1810 for (const sidebarControl of sidebarControls) {
1811 const widgets = sidebarControl.setting.get();
1812 if (widgets.includes(widgetId)) {
1813 sidebarControl.sectionInstance.expand({
1814 // Schedule it after the complete callback so that
1815 // it won't be overridden by the "Back" button focus.
1816 completeCallback() {
1817 setFocusedWidgetIdRef({ current: widgetId });
1818 }
1819 });
1820 break;
1821 }
1822 }
1823 },
1824 [sidebarControls]
1825 );
1826 (0, import_element10.useEffect)(() => {
1827 function handleFocus(settingId) {
1828 const widgetId = settingIdToWidgetId(settingId);
1829 focusWidget(widgetId);
1830 }
1831 let previewBound = false;
1832 function handleReady() {
1833 api.previewer.preview.bind(
1834 "focus-control-for-setting",
1835 handleFocus
1836 );
1837 previewBound = true;
1838 }
1839 api.previewer.bind("ready", handleReady);
1840 return () => {
1841 api.previewer.unbind("ready", handleReady);
1842 if (previewBound) {
1843 api.previewer.preview.unbind(
1844 "focus-control-for-setting",
1845 handleFocus
1846 );
1847 }
1848 };
1849 }, [api, focusWidget]);
1850 const context = (0, import_element10.useMemo)(
1851 () => [focusedWidgetIdRef, focusWidget],
1852 [focusedWidgetIdRef, focusWidget]
1853 );
1854 return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FocusControlContext.Provider, { value: context, children });
1855 }
1856 var useFocusControl = () => (0, import_element10.useContext)(FocusControlContext);
1857
1858 // packages/customize-widgets/build-module/components/focus-control/use-blocks-focus-control.mjs
1859 function useBlocksFocusControl(blocks) {
1860 const { selectBlock } = (0, import_data8.useDispatch)(import_block_editor5.store);
1861 const [focusedWidgetIdRef] = useFocusControl();
1862 const blocksRef = (0, import_element11.useRef)(blocks);
1863 (0, import_element11.useEffect)(() => {
1864 blocksRef.current = blocks;
1865 }, [blocks]);
1866 (0, import_element11.useEffect)(() => {
1867 if (focusedWidgetIdRef.current) {
1868 const focusedBlock = blocksRef.current.find(
1869 (block) => (0, import_widgets3.getWidgetIdFromBlock)(block) === focusedWidgetIdRef.current
1870 );
1871 if (focusedBlock) {
1872 selectBlock(focusedBlock.clientId);
1873 const blockNode = document.querySelector(
1874 `[data-block="${focusedBlock.clientId}"]`
1875 );
1876 blockNode?.focus();
1877 }
1878 }
1879 }, [focusedWidgetIdRef, selectBlock]);
1880 }
1881
1882 // packages/customize-widgets/build-module/lock-unlock.mjs
1883 var import_private_apis = __toESM(require_private_apis(), 1);
1884 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
1885 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
1886 "@wordpress/customize-widgets"
1887 );
1888
1889 // packages/customize-widgets/build-module/components/sidebar-block-editor/sidebar-editor-provider.mjs
1890 var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
1891 var { ExperimentalBlockEditorProvider } = unlock(import_block_editor6.privateApis);
1892 function SidebarEditorProvider({
1893 sidebar,
1894 settings,
1895 children
1896 }) {
1897 const [blocks, onInput, onChange] = useSidebarBlockEditor(sidebar);
1898 useBlocksFocusControl(blocks);
1899 return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1900 ExperimentalBlockEditorProvider,
1901 {
1902 value: blocks,
1903 onInput,
1904 onChange,
1905 settings,
1906 useSubRegistry: false,
1907 children
1908 }
1909 );
1910 }
1911
1912 // packages/customize-widgets/build-module/components/welcome-guide/index.mjs
1913 var import_i18n8 = __toESM(require_i18n(), 1);
1914 var import_components7 = __toESM(require_components(), 1);
1915 var import_data9 = __toESM(require_data(), 1);
1916 var import_preferences2 = __toESM(require_preferences(), 1);
1917 var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
1918 function WelcomeGuide({ sidebar }) {
1919 const { toggle } = (0, import_data9.useDispatch)(import_preferences2.store);
1920 const isEntirelyBlockWidgets = sidebar.getWidgets().every((widget) => widget.id.startsWith("block-"));
1921 return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "customize-widgets-welcome-guide", children: [
1922 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "customize-widgets-welcome-guide__image__wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("picture", { children: [
1923 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1924 "source",
1925 {
1926 srcSet: "https://s.w.org/images/block-editor/welcome-editor.svg",
1927 media: "(prefers-reduced-motion: reduce)"
1928 }
1929 ),
1930 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1931 "img",
1932 {
1933 className: "customize-widgets-welcome-guide__image",
1934 src: "https://s.w.org/images/block-editor/welcome-editor.gif",
1935 width: "312",
1936 height: "240",
1937 alt: ""
1938 }
1939 )
1940 ] }) }),
1941 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { className: "customize-widgets-welcome-guide__heading", children: (0, import_i18n8.__)("Welcome to block Widgets") }),
1942 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "customize-widgets-welcome-guide__text", children: isEntirelyBlockWidgets ? (0, import_i18n8.__)(
1943 "Your theme provides different \u201Cblock\u201D areas for you to add and edit content.\xA0Try adding a search bar, social icons, or other types of blocks here and see how they\u2019ll look on your site."
1944 ) : (0, import_i18n8.__)(
1945 "You can now add any block to your site\u2019s widget areas. Don\u2019t worry, all of your favorite widgets still work flawlessly."
1946 ) }),
1947 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1948 import_components7.Button,
1949 {
1950 size: "compact",
1951 variant: "primary",
1952 onClick: () => toggle("core/customize-widgets", "welcomeGuide"),
1953 children: (0, import_i18n8.__)("Got it")
1954 }
1955 ),
1956 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("hr", { className: "customize-widgets-welcome-guide__separator" }),
1957 !isEntirelyBlockWidgets && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "customize-widgets-welcome-guide__more-info", children: [
1958 (0, import_i18n8.__)("Want to stick with the old widgets?"),
1959 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("br", {}),
1960 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1961 import_components7.ExternalLink,
1962 {
1963 href: (0, import_i18n8.__)(
1964 "https://wordpress.org/plugins/classic-widgets/"
1965 ),
1966 children: (0, import_i18n8.__)("Get the Classic Widgets plugin.")
1967 }
1968 )
1969 ] }),
1970 /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "customize-widgets-welcome-guide__more-info", children: [
1971 (0, import_i18n8.__)("New to the block editor?"),
1972 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("br", {}),
1973 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1974 import_components7.ExternalLink,
1975 {
1976 href: (0, import_i18n8.__)(
1977 "https://wordpress.org/documentation/article/wordpress-block-editor/"
1978 ),
1979 children: (0, import_i18n8.__)("Here's a detailed guide.")
1980 }
1981 )
1982 ] })
1983 ] });
1984 }
1985
1986 // packages/customize-widgets/build-module/components/keyboard-shortcuts/index.mjs
1987 var import_element12 = __toESM(require_element(), 1);
1988 var import_keyboard_shortcuts4 = __toESM(require_keyboard_shortcuts(), 1);
1989 var import_keycodes4 = __toESM(require_keycodes(), 1);
1990 var import_data10 = __toESM(require_data(), 1);
1991 var import_i18n9 = __toESM(require_i18n(), 1);
1992 var import_block_editor7 = __toESM(require_block_editor(), 1);
1993 var { usesNativeUndo } = unlock(import_block_editor7.privateApis);
1994 function KeyboardShortcuts({ undo, redo, save }) {
1995 (0, import_keyboard_shortcuts4.useShortcut)("core/customize-widgets/undo", (event) => {
1996 if (usesNativeUndo(event)) {
1997 return;
1998 }
1999 undo();
2000 event.preventDefault();
2001 });
2002 (0, import_keyboard_shortcuts4.useShortcut)("core/customize-widgets/redo", (event) => {
2003 if (usesNativeUndo(event)) {
2004 return;
2005 }
2006 redo();
2007 event.preventDefault();
2008 });
2009 (0, import_keyboard_shortcuts4.useShortcut)("core/customize-widgets/save", (event) => {
2010 event.preventDefault();
2011 save();
2012 });
2013 return null;
2014 }
2015 function KeyboardShortcutsRegister() {
2016 const { registerShortcut, unregisterShortcut } = (0, import_data10.useDispatch)(
2017 import_keyboard_shortcuts4.store
2018 );
2019 (0, import_element12.useEffect)(() => {
2020 registerShortcut({
2021 name: "core/customize-widgets/undo",
2022 category: "global",
2023 description: (0, import_i18n9.__)("Undo your last changes."),
2024 keyCombination: {
2025 modifier: "primary",
2026 character: "z"
2027 }
2028 });
2029 registerShortcut({
2030 name: "core/customize-widgets/redo",
2031 category: "global",
2032 description: (0, import_i18n9.__)("Redo your last undo."),
2033 keyCombination: {
2034 modifier: "primaryShift",
2035 character: "z"
2036 },
2037 // Disable on Apple OS because it conflicts with the browser's
2038 // history shortcut. It's a fine alias for both Windows and Linux.
2039 // Since there's no conflict for Ctrl+Shift+Z on both Windows and
2040 // Linux, we keep it as the default for consistency.
2041 aliases: (0, import_keycodes4.isAppleOS)() ? [] : [
2042 {
2043 modifier: "primary",
2044 character: "y"
2045 }
2046 ]
2047 });
2048 registerShortcut({
2049 name: "core/customize-widgets/save",
2050 category: "global",
2051 description: (0, import_i18n9.__)("Save your changes."),
2052 keyCombination: {
2053 modifier: "primary",
2054 character: "s"
2055 }
2056 });
2057 return () => {
2058 unregisterShortcut("core/customize-widgets/undo");
2059 unregisterShortcut("core/customize-widgets/redo");
2060 unregisterShortcut("core/customize-widgets/save");
2061 };
2062 }, [registerShortcut]);
2063 return null;
2064 }
2065 KeyboardShortcuts.Register = KeyboardShortcutsRegister;
2066 var keyboard_shortcuts_default = KeyboardShortcuts;
2067
2068 // packages/customize-widgets/build-module/components/block-appender/index.mjs
2069 var import_element13 = __toESM(require_element(), 1);
2070 var import_block_editor8 = __toESM(require_block_editor(), 1);
2071 var import_data11 = __toESM(require_data(), 1);
2072 var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
2073 function BlockAppender(props) {
2074 const ref = (0, import_element13.useRef)();
2075 const isBlocksListEmpty = (0, import_data11.useSelect)(
2076 (select) => select(import_block_editor8.store).getBlockCount() === 0
2077 );
2078 (0, import_element13.useEffect)(() => {
2079 if (isBlocksListEmpty && ref.current) {
2080 const { ownerDocument } = ref.current;
2081 if (!ownerDocument.activeElement || ownerDocument.activeElement === ownerDocument.body) {
2082 ref.current.focus();
2083 }
2084 }
2085 }, [isBlocksListEmpty]);
2086 return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_block_editor8.ButtonBlockAppender, { ...props, ref });
2087 }
2088
2089 // packages/customize-widgets/build-module/components/sidebar-block-editor/index.mjs
2090 var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
2091 var { ExperimentalBlockCanvas: BlockCanvas } = unlock(
2092 import_block_editor9.privateApis
2093 );
2094 var { BlockKeyboardShortcuts } = unlock(import_block_library.privateApis);
2095 function SidebarBlockEditor({
2096 blockEditorSettings,
2097 sidebar,
2098 inserter,
2099 inspector
2100 }) {
2101 const [isInserterOpened2, setIsInserterOpened2] = useInserter(inserter);
2102 const isMediumViewport = (0, import_compose3.useViewportMatch)("small");
2103 const {
2104 hasUploadPermissions,
2105 isFixedToolbarActive,
2106 keepCaretInsideBlock,
2107 isWelcomeGuideActive
2108 } = (0, import_data12.useSelect)((select) => {
2109 const { get } = select(import_preferences3.store);
2110 return {
2111 hasUploadPermissions: select(import_core_data.store).canUser("create", {
2112 kind: "postType",
2113 name: "attachment"
2114 }) ?? true,
2115 isFixedToolbarActive: !!get(
2116 "core/customize-widgets",
2117 "fixedToolbar"
2118 ),
2119 keepCaretInsideBlock: !!get(
2120 "core/customize-widgets",
2121 "keepCaretInsideBlock"
2122 ),
2123 isWelcomeGuideActive: !!get(
2124 "core/customize-widgets",
2125 "welcomeGuide"
2126 )
2127 };
2128 }, []);
2129 const settings = (0, import_element14.useMemo)(() => {
2130 let mediaUploadBlockEditor;
2131 if (hasUploadPermissions) {
2132 mediaUploadBlockEditor = ({ onError, ...argumentsObject }) => {
2133 (0, import_media_utils.uploadMedia)({
2134 wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,
2135 onError: ({ message }) => onError(message),
2136 ...argumentsObject
2137 });
2138 };
2139 }
2140 return {
2141 ...blockEditorSettings,
2142 __experimentalSetIsInserterOpened: setIsInserterOpened2,
2143 mediaUpload: mediaUploadBlockEditor,
2144 hasFixedToolbar: isFixedToolbarActive || !isMediumViewport,
2145 keepCaretInsideBlock,
2146 editorTool: "edit",
2147 __unstableHasCustomAppender: true
2148 };
2149 }, [
2150 hasUploadPermissions,
2151 blockEditorSettings,
2152 isFixedToolbarActive,
2153 isMediumViewport,
2154 keepCaretInsideBlock,
2155 setIsInserterOpened2
2156 ]);
2157 if (isWelcomeGuideActive) {
2158 return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WelcomeGuide, { sidebar });
2159 }
2160 return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
2161 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(keyboard_shortcuts_default.Register, {}),
2162 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(BlockKeyboardShortcuts, {}),
2163 /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(SidebarEditorProvider, { sidebar, settings, children: [
2164 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2165 keyboard_shortcuts_default,
2166 {
2167 undo: sidebar.undo,
2168 redo: sidebar.redo,
2169 save: sidebar.save
2170 }
2171 ),
2172 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2173 header_default,
2174 {
2175 sidebar,
2176 inserter,
2177 isInserterOpened: isInserterOpened2,
2178 setIsInserterOpened: setIsInserterOpened2,
2179 isFixedToolbarActive: isFixedToolbarActive || !isMediumViewport
2180 }
2181 ),
2182 (isFixedToolbarActive || !isMediumViewport) && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_block_editor9.BlockToolbar, { hideDragHandle: true }),
2183 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2184 BlockCanvas,
2185 {
2186 shouldIframe: false,
2187 styles: settings.defaultEditorStyles,
2188 height: "100%",
2189 children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_block_editor9.BlockList, { renderAppender: BlockAppender })
2190 }
2191 ),
2192 (0, import_element14.createPortal)(
2193 // This is a temporary hack to prevent button component inside <BlockInspector>
2194 // from submitting form when type="button" is not specified.
2195 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("form", { onSubmit: (event) => event.preventDefault(), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_block_editor9.BlockInspector, {}) }),
2196 inspector.contentContainer[0]
2197 )
2198 ] }),
2199 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_block_editor9.__unstableBlockSettingsMenuFirstItem, { children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2200 block_inspector_button_default,
2201 {
2202 inspector,
2203 closeMenu: onClose
2204 }
2205 ) })
2206 ] });
2207 }
2208
2209 // packages/customize-widgets/build-module/components/sidebar-controls/index.mjs
2210 var import_element15 = __toESM(require_element(), 1);
2211 var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
2212 var SidebarControlsContext = (0, import_element15.createContext)();
2213 SidebarControlsContext.displayName = "SidebarControlsContext";
2214 function SidebarControls({
2215 sidebarControls,
2216 activeSidebarControl,
2217 children
2218 }) {
2219 const context = (0, import_element15.useMemo)(
2220 () => ({
2221 sidebarControls,
2222 activeSidebarControl
2223 }),
2224 [sidebarControls, activeSidebarControl]
2225 );
2226 return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SidebarControlsContext.Provider, { value: context, children });
2227 }
2228 function useSidebarControls() {
2229 const { sidebarControls } = (0, import_element15.useContext)(SidebarControlsContext);
2230 return sidebarControls;
2231 }
2232 function useActiveSidebarControl() {
2233 const { activeSidebarControl } = (0, import_element15.useContext)(SidebarControlsContext);
2234 return activeSidebarControl;
2235 }
2236
2237 // packages/customize-widgets/build-module/components/customize-widgets/use-clear-selected-block.mjs
2238 var import_element16 = __toESM(require_element(), 1);
2239 var import_data13 = __toESM(require_data(), 1);
2240 var import_block_editor10 = __toESM(require_block_editor(), 1);
2241 function useClearSelectedBlock(sidebarControl, popoverRef) {
2242 const { hasSelectedBlock, hasMultiSelection } = (0, import_data13.useSelect)(import_block_editor10.store);
2243 const { clearSelectedBlock } = (0, import_data13.useDispatch)(import_block_editor10.store);
2244 (0, import_element16.useEffect)(() => {
2245 if (popoverRef.current && sidebarControl) {
2246 let handleClearSelectedBlock = function(element) {
2247 if (
2248 // 1. Make sure there are blocks being selected.
2249 (hasSelectedBlock() || hasMultiSelection()) && // 2. The element should exist in the DOM (not deleted).
2250 element && ownerDocument.contains(element) && // 3. It should also not exist in the container, the popover, nor the dialog.
2251 !container.contains(element) && !popoverRef.current.contains(element) && !element.closest('[role="dialog"]') && // 4. The inspector should not be opened.
2252 !inspector.expanded()
2253 ) {
2254 clearSelectedBlock();
2255 }
2256 }, handleMouseDown = function(event) {
2257 handleClearSelectedBlock(event.target);
2258 }, handleBlur = function() {
2259 handleClearSelectedBlock(ownerDocument.activeElement);
2260 };
2261 const inspector = sidebarControl.inspector;
2262 const container = sidebarControl.container[0];
2263 const ownerDocument = container.ownerDocument;
2264 const ownerWindow = ownerDocument.defaultView;
2265 ownerDocument.addEventListener("mousedown", handleMouseDown);
2266 ownerWindow.addEventListener("blur", handleBlur);
2267 return () => {
2268 ownerDocument.removeEventListener(
2269 "mousedown",
2270 handleMouseDown
2271 );
2272 ownerWindow.removeEventListener("blur", handleBlur);
2273 };
2274 }
2275 }, [
2276 popoverRef,
2277 sidebarControl,
2278 hasSelectedBlock,
2279 hasMultiSelection,
2280 clearSelectedBlock
2281 ]);
2282 }
2283
2284 // packages/customize-widgets/build-module/components/customize-widgets/index.mjs
2285 var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
2286 function CustomizeWidgets({
2287 api,
2288 sidebarControls,
2289 blockEditorSettings
2290 }) {
2291 const [activeSidebarControl, setActiveSidebarControl] = (0, import_element17.useState)(null);
2292 const parentContainer = document.getElementById(
2293 "customize-theme-controls"
2294 );
2295 const popoverRef = (0, import_element17.useRef)();
2296 useClearSelectedBlock(activeSidebarControl, popoverRef);
2297 (0, import_element17.useEffect)(() => {
2298 const unsubscribers = sidebarControls.map(
2299 (sidebarControl) => sidebarControl.subscribe((expanded) => {
2300 if (expanded) {
2301 setActiveSidebarControl(sidebarControl);
2302 }
2303 })
2304 );
2305 return () => {
2306 unsubscribers.forEach((unsubscriber) => unsubscriber());
2307 };
2308 }, [sidebarControls]);
2309 const activeSidebar = activeSidebarControl && (0, import_element17.createPortal)(
2310 /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2311 SidebarBlockEditor,
2312 {
2313 blockEditorSettings,
2314 sidebar: activeSidebarControl.sidebarAdapter,
2315 inserter: activeSidebarControl.inserter,
2316 inspector: activeSidebarControl.inspector
2317 },
2318 activeSidebarControl.id
2319 ) }),
2320 activeSidebarControl.container[0]
2321 );
2322 const popover = parentContainer && (0, import_element17.createPortal)(
2323 /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "customize-widgets-popover", ref: popoverRef, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components8.Popover.Slot, {}) }),
2324 parentContainer
2325 );
2326 return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components8.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2327 SidebarControls,
2328 {
2329 sidebarControls,
2330 activeSidebarControl,
2331 children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(FocusControl, { api, sidebarControls, children: [
2332 activeSidebar,
2333 popover
2334 ] })
2335 }
2336 ) });
2337 }
2338
2339 // packages/customize-widgets/build-module/controls/sidebar-section.mjs
2340 var import_i18n10 = __toESM(require_i18n(), 1);
2341
2342 // packages/customize-widgets/build-module/controls/inspector-section.mjs
2343 function getInspectorSection() {
2344 const {
2345 wp: { customize }
2346 } = window;
2347 return class InspectorSection extends customize.Section {
2348 constructor(id, options) {
2349 super(id, options);
2350 this.parentSection = options.parentSection;
2351 this.returnFocusWhenClose = null;
2352 this._isOpen = false;
2353 }
2354 get isOpen() {
2355 return this._isOpen;
2356 }
2357 set isOpen(value) {
2358 this._isOpen = value;
2359 this.triggerActiveCallbacks();
2360 }
2361 ready() {
2362 this.contentContainer[0].classList.add(
2363 "customize-widgets-layout__inspector"
2364 );
2365 }
2366 isContextuallyActive() {
2367 return this.isOpen;
2368 }
2369 onChangeExpanded(expanded, args) {
2370 super.onChangeExpanded(expanded, args);
2371 if (this.parentSection && !args.unchanged) {
2372 if (expanded) {
2373 this.parentSection.collapse({
2374 manualTransition: true
2375 });
2376 } else {
2377 this.parentSection.expand({
2378 manualTransition: true,
2379 completeCallback: () => {
2380 if (this.returnFocusWhenClose && !this.contentContainer[0].contains(
2381 this.returnFocusWhenClose
2382 )) {
2383 this.returnFocusWhenClose.focus();
2384 }
2385 }
2386 });
2387 }
2388 }
2389 }
2390 open({ returnFocusWhenClose } = {}) {
2391 this.isOpen = true;
2392 this.returnFocusWhenClose = returnFocusWhenClose;
2393 this.expand({
2394 allowMultiple: true
2395 });
2396 }
2397 close() {
2398 this.collapse({
2399 allowMultiple: true
2400 });
2401 }
2402 collapse(options) {
2403 this.isOpen = false;
2404 super.collapse(options);
2405 }
2406 triggerActiveCallbacks() {
2407 this.active.callbacks.fireWith(this.active, [false, true]);
2408 }
2409 };
2410 }
2411
2412 // packages/customize-widgets/build-module/controls/sidebar-section.mjs
2413 var getInspectorSectionId = (sidebarId) => `widgets-inspector-${sidebarId}`;
2414 function getSidebarSection() {
2415 const {
2416 wp: { customize }
2417 } = window;
2418 const reduceMotionMediaQuery = window.matchMedia(
2419 "(prefers-reduced-motion: reduce)"
2420 );
2421 let isReducedMotion = reduceMotionMediaQuery.matches;
2422 reduceMotionMediaQuery.addEventListener("change", (event) => {
2423 isReducedMotion = event.matches;
2424 });
2425 return class SidebarSection extends customize.Section {
2426 ready() {
2427 const InspectorSection = getInspectorSection();
2428 this.inspector = new InspectorSection(
2429 getInspectorSectionId(this.id),
2430 {
2431 title: (0, import_i18n10.__)("Block Settings"),
2432 parentSection: this,
2433 customizeAction: [
2434 (0, import_i18n10.__)("Customizing"),
2435 (0, import_i18n10.__)("Widgets"),
2436 this.params.title
2437 ].join(" \u25B8 ")
2438 }
2439 );
2440 customize.section.add(this.inspector);
2441 this.contentContainer[0].classList.add(
2442 "customize-widgets__sidebar-section"
2443 );
2444 }
2445 hasSubSectionOpened() {
2446 return this.inspector.expanded();
2447 }
2448 onChangeExpanded(expanded, _args) {
2449 const controls = this.controls();
2450 const args = {
2451 ..._args,
2452 completeCallback() {
2453 controls.forEach((control) => {
2454 control.onChangeSectionExpanded?.(expanded, args);
2455 });
2456 _args.completeCallback?.();
2457 }
2458 };
2459 if (args.manualTransition) {
2460 if (expanded) {
2461 this.contentContainer.addClass(["busy", "open"]);
2462 this.contentContainer.removeClass("is-sub-section-open");
2463 this.contentContainer.closest(".wp-full-overlay").addClass("section-open");
2464 } else {
2465 this.contentContainer.addClass([
2466 "busy",
2467 "is-sub-section-open"
2468 ]);
2469 this.contentContainer.closest(".wp-full-overlay").addClass("section-open");
2470 this.contentContainer.removeClass("open");
2471 }
2472 const handleTransitionEnd = () => {
2473 this.contentContainer.removeClass("busy");
2474 args.completeCallback();
2475 };
2476 if (isReducedMotion) {
2477 handleTransitionEnd();
2478 } else {
2479 this.contentContainer.one(
2480 "transitionend",
2481 handleTransitionEnd
2482 );
2483 }
2484 } else {
2485 super.onChangeExpanded(expanded, args);
2486 }
2487 }
2488 };
2489 }
2490
2491 // packages/customize-widgets/build-module/controls/sidebar-control.mjs
2492 var import_data15 = __toESM(require_data(), 1);
2493
2494 // packages/customize-widgets/build-module/components/sidebar-block-editor/sidebar-adapter.mjs
2495 var { wp } = window;
2496 function parseWidgetId(widgetId) {
2497 const matches = widgetId.match(/^(.+)-(\d+)$/);
2498 if (matches) {
2499 return {
2500 idBase: matches[1],
2501 number: parseInt(matches[2], 10)
2502 };
2503 }
2504 return { idBase: widgetId };
2505 }
2506 function widgetIdToSettingId(widgetId) {
2507 const { idBase, number } = parseWidgetId(widgetId);
2508 if (number) {
2509 return `widget_${idBase}[${number}]`;
2510 }
2511 return `widget_${idBase}`;
2512 }
2513 function debounce(leading, callback, timeout) {
2514 let isLeading = false;
2515 let timerID;
2516 function debounced(...args) {
2517 const result = (isLeading ? callback : leading).apply(this, args);
2518 isLeading = true;
2519 clearTimeout(timerID);
2520 timerID = setTimeout(() => {
2521 isLeading = false;
2522 }, timeout);
2523 return result;
2524 }
2525 debounced.cancel = () => {
2526 isLeading = false;
2527 clearTimeout(timerID);
2528 };
2529 return debounced;
2530 }
2531 var SidebarAdapter = class {
2532 constructor(setting, api) {
2533 this.setting = setting;
2534 this.api = api;
2535 this.locked = false;
2536 this.widgetsCache = /* @__PURE__ */ new WeakMap();
2537 this.subscribers = /* @__PURE__ */ new Set();
2538 this.history = [
2539 this._getWidgetIds().map(
2540 (widgetId) => this.getWidget(widgetId)
2541 )
2542 ];
2543 this.historyIndex = 0;
2544 this.historySubscribers = /* @__PURE__ */ new Set();
2545 this._debounceSetHistory = debounce(
2546 this._pushHistory,
2547 this._replaceHistory,
2548 1e3
2549 );
2550 this.setting.bind(this._handleSettingChange.bind(this));
2551 this.api.bind("change", this._handleAllSettingsChange.bind(this));
2552 this.undo = this.undo.bind(this);
2553 this.redo = this.redo.bind(this);
2554 this.save = this.save.bind(this);
2555 }
2556 subscribe(callback) {
2557 this.subscribers.add(callback);
2558 return () => {
2559 this.subscribers.delete(callback);
2560 };
2561 }
2562 getWidgets() {
2563 return this.history[this.historyIndex];
2564 }
2565 _emit(...args) {
2566 for (const callback of this.subscribers) {
2567 callback(...args);
2568 }
2569 }
2570 _getWidgetIds() {
2571 return this.setting.get();
2572 }
2573 _pushHistory() {
2574 this.history = [
2575 ...this.history.slice(0, this.historyIndex + 1),
2576 this._getWidgetIds().map(
2577 (widgetId) => this.getWidget(widgetId)
2578 )
2579 ];
2580 this.historyIndex += 1;
2581 this.historySubscribers.forEach((listener) => listener());
2582 }
2583 _replaceHistory() {
2584 this.history[this.historyIndex] = this._getWidgetIds().map(
2585 (widgetId) => this.getWidget(widgetId)
2586 );
2587 }
2588 _handleSettingChange() {
2589 if (this.locked) {
2590 return;
2591 }
2592 const prevWidgets = this.getWidgets();
2593 this._pushHistory();
2594 this._emit(prevWidgets, this.getWidgets());
2595 }
2596 _handleAllSettingsChange(setting) {
2597 if (this.locked) {
2598 return;
2599 }
2600 if (!setting.id.startsWith("widget_")) {
2601 return;
2602 }
2603 const widgetId = settingIdToWidgetId(setting.id);
2604 if (!this.setting.get().includes(widgetId)) {
2605 return;
2606 }
2607 const prevWidgets = this.getWidgets();
2608 this._pushHistory();
2609 this._emit(prevWidgets, this.getWidgets());
2610 }
2611 _createWidget(widget) {
2612 const widgetModel = wp.customize.Widgets.availableWidgets.findWhere({
2613 id_base: widget.idBase
2614 });
2615 let number = widget.number;
2616 if (widgetModel.get("is_multi") && !number) {
2617 widgetModel.set(
2618 "multi_number",
2619 widgetModel.get("multi_number") + 1
2620 );
2621 number = widgetModel.get("multi_number");
2622 }
2623 const settingId = number ? `widget_${widget.idBase}[${number}]` : `widget_${widget.idBase}`;
2624 const settingArgs = {
2625 transport: wp.customize.Widgets.data.selectiveRefreshableWidgets[widgetModel.get("id_base")] ? "postMessage" : "refresh",
2626 previewer: this.setting.previewer
2627 };
2628 const setting = this.api.create(
2629 settingId,
2630 settingId,
2631 "",
2632 settingArgs
2633 );
2634 setting.set(widget.instance);
2635 const widgetId = settingIdToWidgetId(settingId);
2636 return widgetId;
2637 }
2638 _removeWidget(widget) {
2639 const settingId = widgetIdToSettingId(widget.id);
2640 const setting = this.api(settingId);
2641 if (setting) {
2642 const instance = setting.get();
2643 this.widgetsCache.delete(instance);
2644 }
2645 this.api.remove(settingId);
2646 }
2647 _updateWidget(widget) {
2648 const prevWidget = this.getWidget(widget.id);
2649 if (prevWidget === widget) {
2650 return widget.id;
2651 }
2652 if (prevWidget.idBase && widget.idBase && prevWidget.idBase === widget.idBase) {
2653 const settingId = widgetIdToSettingId(widget.id);
2654 this.api(settingId).set(widget.instance);
2655 return widget.id;
2656 }
2657 this._removeWidget(widget);
2658 return this._createWidget(widget);
2659 }
2660 getWidget(widgetId) {
2661 if (!widgetId) {
2662 return null;
2663 }
2664 const { idBase, number } = parseWidgetId(widgetId);
2665 const settingId = widgetIdToSettingId(widgetId);
2666 const setting = this.api(settingId);
2667 if (!setting) {
2668 return null;
2669 }
2670 const instance = setting.get();
2671 if (this.widgetsCache.has(instance)) {
2672 return this.widgetsCache.get(instance);
2673 }
2674 const widget = {
2675 id: widgetId,
2676 idBase,
2677 number,
2678 instance
2679 };
2680 this.widgetsCache.set(instance, widget);
2681 return widget;
2682 }
2683 _updateWidgets(nextWidgets) {
2684 this.locked = true;
2685 const addedWidgetIds = [];
2686 const nextWidgetIds = nextWidgets.map((nextWidget) => {
2687 if (nextWidget.id && this.getWidget(nextWidget.id)) {
2688 addedWidgetIds.push(null);
2689 return this._updateWidget(nextWidget);
2690 }
2691 const widgetId = this._createWidget(nextWidget);
2692 addedWidgetIds.push(widgetId);
2693 return widgetId;
2694 });
2695 const deletedWidgets = this.getWidgets().filter(
2696 (widget) => !nextWidgetIds.includes(widget.id)
2697 );
2698 deletedWidgets.forEach((widget) => this._removeWidget(widget));
2699 this.setting.set(nextWidgetIds);
2700 this.locked = false;
2701 return addedWidgetIds;
2702 }
2703 setWidgets(nextWidgets) {
2704 const addedWidgetIds = this._updateWidgets(nextWidgets);
2705 this._debounceSetHistory();
2706 return addedWidgetIds;
2707 }
2708 /**
2709 * Undo/Redo related features
2710 */
2711 hasUndo() {
2712 return this.historyIndex > 0;
2713 }
2714 hasRedo() {
2715 return this.historyIndex < this.history.length - 1;
2716 }
2717 _seek(historyIndex) {
2718 const currentWidgets = this.getWidgets();
2719 this.historyIndex = historyIndex;
2720 const widgets = this.history[this.historyIndex];
2721 this._updateWidgets(widgets);
2722 this._emit(currentWidgets, this.getWidgets());
2723 this.historySubscribers.forEach((listener) => listener());
2724 this._debounceSetHistory.cancel();
2725 }
2726 undo() {
2727 if (!this.hasUndo()) {
2728 return;
2729 }
2730 this._seek(this.historyIndex - 1);
2731 }
2732 redo() {
2733 if (!this.hasRedo()) {
2734 return;
2735 }
2736 this._seek(this.historyIndex + 1);
2737 }
2738 subscribeHistory(listener) {
2739 this.historySubscribers.add(listener);
2740 return () => {
2741 this.historySubscribers.delete(listener);
2742 };
2743 }
2744 save() {
2745 this.api.previewer.save();
2746 }
2747 };
2748
2749 // packages/customize-widgets/build-module/controls/inserter-outer-section.mjs
2750 var import_keycodes5 = __toESM(require_keycodes(), 1);
2751 var import_dom = __toESM(require_dom(), 1);
2752 var import_data14 = __toESM(require_data(), 1);
2753 function getInserterOuterSection() {
2754 const {
2755 wp: { customize }
2756 } = window;
2757 const OuterSection = customize.OuterSection;
2758 customize.OuterSection = class extends OuterSection {
2759 onChangeExpanded(expanded, args) {
2760 if (expanded) {
2761 customize.section.each((section) => {
2762 if (section.params.type === "outer" && section.id !== this.id) {
2763 if (section.expanded()) {
2764 section.collapse();
2765 }
2766 }
2767 });
2768 }
2769 return super.onChangeExpanded(expanded, args);
2770 }
2771 };
2772 customize.sectionConstructor.outer = customize.OuterSection;
2773 return class InserterOuterSection extends customize.OuterSection {
2774 constructor(...args) {
2775 super(...args);
2776 this.params.type = "outer";
2777 this.activeElementBeforeExpanded = null;
2778 const ownerWindow = this.contentContainer[0].ownerDocument.defaultView;
2779 ownerWindow.addEventListener(
2780 "keydown",
2781 (event) => {
2782 if (this.expanded() && (event.keyCode === import_keycodes5.ESCAPE || event.code === "Escape") && !event.defaultPrevented) {
2783 event.preventDefault();
2784 event.stopPropagation();
2785 (0, import_data14.dispatch)(store).setIsInserterOpened(
2786 false
2787 );
2788 }
2789 },
2790 // Use capture mode to make this run before other event listeners.
2791 true
2792 );
2793 this.contentContainer.addClass("widgets-inserter");
2794 this.isFromInternalAction = false;
2795 this.expanded.bind(() => {
2796 if (!this.isFromInternalAction) {
2797 (0, import_data14.dispatch)(store).setIsInserterOpened(
2798 this.expanded()
2799 );
2800 }
2801 this.isFromInternalAction = false;
2802 });
2803 }
2804 open() {
2805 if (!this.expanded()) {
2806 const contentContainer = this.contentContainer[0];
2807 this.activeElementBeforeExpanded = contentContainer.ownerDocument.activeElement;
2808 this.isFromInternalAction = true;
2809 this.expand({
2810 completeCallback() {
2811 const searchBox = import_dom.focus.tabbable.find(contentContainer)[1];
2812 if (searchBox) {
2813 searchBox.focus();
2814 }
2815 }
2816 });
2817 }
2818 }
2819 close() {
2820 if (this.expanded()) {
2821 const contentContainer = this.contentContainer[0];
2822 const activeElement = contentContainer.ownerDocument.activeElement;
2823 this.isFromInternalAction = true;
2824 this.collapse({
2825 completeCallback() {
2826 if (contentContainer.contains(activeElement)) {
2827 if (this.activeElementBeforeExpanded) {
2828 this.activeElementBeforeExpanded.focus();
2829 }
2830 }
2831 }
2832 });
2833 }
2834 }
2835 };
2836 }
2837
2838 // packages/customize-widgets/build-module/controls/sidebar-control.mjs
2839 var getInserterId = (controlId) => `widgets-inserter-${controlId}`;
2840 function getSidebarControl() {
2841 const {
2842 wp: { customize }
2843 } = window;
2844 return class SidebarControl extends customize.Control {
2845 constructor(...args) {
2846 super(...args);
2847 this.subscribers = /* @__PURE__ */ new Set();
2848 }
2849 ready() {
2850 const InserterOuterSection = getInserterOuterSection();
2851 this.inserter = new InserterOuterSection(
2852 getInserterId(this.id),
2853 {}
2854 );
2855 customize.section.add(this.inserter);
2856 this.sectionInstance = customize.section(this.section());
2857 this.inspector = this.sectionInstance.inspector;
2858 this.sidebarAdapter = new SidebarAdapter(this.setting, customize);
2859 }
2860 subscribe(callback) {
2861 this.subscribers.add(callback);
2862 return () => {
2863 this.subscribers.delete(callback);
2864 };
2865 }
2866 onChangeSectionExpanded(expanded, args) {
2867 if (!args.unchanged) {
2868 if (!expanded) {
2869 (0, import_data15.dispatch)(store).setIsInserterOpened(
2870 false
2871 );
2872 }
2873 this.subscribers.forEach(
2874 (subscriber) => subscriber(expanded, args)
2875 );
2876 }
2877 }
2878 };
2879 }
2880
2881 // packages/customize-widgets/build-module/filters/move-to-sidebar.mjs
2882 var import_block_editor11 = __toESM(require_block_editor(), 1);
2883 var import_compose4 = __toESM(require_compose(), 1);
2884 var import_data16 = __toESM(require_data(), 1);
2885 var import_hooks2 = __toESM(require_hooks(), 1);
2886 var import_widgets4 = __toESM(require_widgets(), 1);
2887 var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
2888 var withMoveToSidebarToolbarItem = (0, import_compose4.createHigherOrderComponent)(
2889 (BlockEdit) => (props) => {
2890 let widgetId = (0, import_widgets4.getWidgetIdFromBlock)(props);
2891 const sidebarControls = useSidebarControls();
2892 const activeSidebarControl = useActiveSidebarControl();
2893 const hasMultipleSidebars = sidebarControls?.length > 1;
2894 const blockName = props.name;
2895 const clientId = props.clientId;
2896 const canInsertBlockInSidebar = (0, import_data16.useSelect)(
2897 (select) => {
2898 return select(import_block_editor11.store).canInsertBlockType(
2899 blockName,
2900 ""
2901 );
2902 },
2903 [blockName]
2904 );
2905 const block = (0, import_data16.useSelect)(
2906 (select) => select(import_block_editor11.store).getBlock(clientId),
2907 [clientId]
2908 );
2909 const { removeBlock } = (0, import_data16.useDispatch)(import_block_editor11.store);
2910 const [, focusWidget] = useFocusControl();
2911 function moveToSidebar(sidebarControlId) {
2912 const newSidebarControl = sidebarControls.find(
2913 (sidebarControl) => sidebarControl.id === sidebarControlId
2914 );
2915 if (widgetId) {
2916 const oldSetting = activeSidebarControl.setting;
2917 const newSetting = newSidebarControl.setting;
2918 oldSetting(oldSetting().filter((id) => id !== widgetId));
2919 newSetting([...newSetting(), widgetId]);
2920 } else {
2921 const sidebarAdapter = newSidebarControl.sidebarAdapter;
2922 removeBlock(clientId);
2923 const addedWidgetIds = sidebarAdapter.setWidgets([
2924 ...sidebarAdapter.getWidgets(),
2925 blockToWidget(block)
2926 ]);
2927 widgetId = addedWidgetIds.reverse().find((id) => !!id);
2928 }
2929 focusWidget(widgetId);
2930 }
2931 return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
2932 /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(BlockEdit, { ...props }, "edit"),
2933 hasMultipleSidebars && canInsertBlockInSidebar && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_block_editor11.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2934 import_widgets4.MoveToWidgetArea,
2935 {
2936 widgetAreas: sidebarControls.map(
2937 (sidebarControl) => ({
2938 id: sidebarControl.id,
2939 name: sidebarControl.params.label,
2940 description: sidebarControl.params.description
2941 })
2942 ),
2943 currentWidgetAreaId: activeSidebarControl?.id,
2944 onSelect: moveToSidebar
2945 }
2946 ) })
2947 ] });
2948 },
2949 "withMoveToSidebarToolbarItem"
2950 );
2951 (0, import_hooks2.addFilter)(
2952 "editor.BlockEdit",
2953 "core/customize-widgets/block-edit",
2954 withMoveToSidebarToolbarItem
2955 );
2956
2957 // packages/customize-widgets/build-module/filters/replace-media-upload.mjs
2958 var import_hooks3 = __toESM(require_hooks(), 1);
2959 var import_media_utils2 = __toESM(require_media_utils(), 1);
2960 var replaceMediaUpload = () => import_media_utils2.MediaUpload;
2961 (0, import_hooks3.addFilter)(
2962 "editor.MediaUpload",
2963 "core/edit-widgets/replace-media-upload",
2964 replaceMediaUpload
2965 );
2966
2967 // packages/customize-widgets/build-module/filters/wide-widget-display.mjs
2968 var import_compose5 = __toESM(require_compose(), 1);
2969 var import_hooks4 = __toESM(require_hooks(), 1);
2970 var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
2971 var { wp: wp2 } = window;
2972 var withWideWidgetDisplay = (0, import_compose5.createHigherOrderComponent)(
2973 (BlockEdit) => (props) => {
2974 const { idBase } = props.attributes;
2975 const isWide = wp2.customize.Widgets.data.availableWidgets.find(
2976 (widget) => widget.id_base === idBase
2977 )?.is_wide ?? false;
2978 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(BlockEdit, { ...props, isWide }, "edit");
2979 },
2980 "withWideWidgetDisplay"
2981 );
2982 (0, import_hooks4.addFilter)(
2983 "editor.BlockEdit",
2984 "core/customize-widgets/wide-widget-display",
2985 withWideWidgetDisplay
2986 );
2987
2988 // packages/customize-widgets/build-module/index.mjs
2989 var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
2990 var { wp: wp3 } = window;
2991 var DISABLED_BLOCKS = [
2992 "core/more",
2993 "core/block",
2994 "core/freeform",
2995 "core/template-part"
2996 ];
2997 var ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;
2998 function initialize(editorName, blockEditorSettings) {
2999 (0, import_data17.dispatch)(import_preferences4.store).setDefaults("core/customize-widgets", {
3000 fixedToolbar: false,
3001 welcomeGuide: true
3002 });
3003 (0, import_data17.dispatch)(import_blocks2.store).reapplyBlockTypeFilters();
3004 const coreBlocks = (0, import_block_library2.__experimentalGetCoreBlocks)().filter((block) => {
3005 return !(DISABLED_BLOCKS.includes(block.name) || block.name.startsWith("core/post") || block.name.startsWith("core/query") || block.name.startsWith("core/site") || block.name.startsWith("core/navigation") || block.name.startsWith("core/term"));
3006 });
3007 (0, import_block_library2.registerCoreBlocks)(coreBlocks);
3008 (0, import_widgets5.registerLegacyWidgetBlock)();
3009 if (true) {
3010 (0, import_block_library2.__experimentalRegisterExperimentalCoreBlocks)({
3011 enableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS
3012 });
3013 }
3014 (0, import_widgets5.registerLegacyWidgetVariations)(blockEditorSettings);
3015 (0, import_widgets5.registerWidgetGroupBlock)();
3016 (0, import_blocks2.setFreeformContentHandlerName)("core/html");
3017 const SidebarControl = getSidebarControl(blockEditorSettings);
3018 wp3.customize.sectionConstructor.sidebar = getSidebarSection();
3019 wp3.customize.controlConstructor.sidebar_block_editor = SidebarControl;
3020 const container = document.createElement("div");
3021 document.body.appendChild(container);
3022 wp3.customize.bind("ready", () => {
3023 const sidebarControls = [];
3024 wp3.customize.control.each((control) => {
3025 if (control instanceof SidebarControl) {
3026 sidebarControls.push(control);
3027 }
3028 });
3029 (0, import_element18.createRoot)(container).render(
3030 /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_element18.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3031 CustomizeWidgets,
3032 {
3033 api: wp3.customize,
3034 sidebarControls,
3035 blockEditorSettings
3036 }
3037 ) })
3038 );
3039 });
3040 }
3041 return __toCommonJS(index_exports);
3042 })();
3043 //# sourceMappingURL=index.js.map
3044